Skip to Content
Menu
This question has been flagged
5 Replies
15039 Views

I am trying to find out where I can set the redirect URL for a custom payment acquirer in Odoo Online.

We are using Odoo in a virtual enterprise. A virtual enterprise is an in-school business simulation.

This is what I am trying to achieve: when a customer selects the custom payment method and clicks "Pay Now" in the webshop then the customer is redirected to the payment page of a virtual bank which is part of the business simulation platform.

According to the Odoo documentation (https://www.odoo.com/documentation/user/11.0/ecommerce/shopper_experience/payment.html#how-to-use-other-acquirers-advanced) "Odoo can submit single payment requests and redirect to any payment acquirer" but it says very little about how to configure the custom payment method.

Thank you for your help!

Avatar
Discard

if you have only redirection without having pre-tokens then setting your parameters should work as given in there. if not, you should sit down and write your own payment acquirer. way easier than you find it.

This template renders the acquirer button with all necessary values. It is rendered with qWeb with the following evaluation context:

tx_url: transaction URL to post the form

acquirer: payment.acquirer browse record

user: current user browse record

reference: the transaction reference number

currency: the transaction currency browse record

amount: the transaction amount, a float

partner: the buyer partner browse record, not necessarily set

partner_values: specific values about the buyer, for example coming from a shipping form

tx_values: transaction values

context: the current context dictionary

Author

Thanks, F.P.. Where do I set the tx_url value exactly?

This is what I did as per the Odoo documentation:

1. Switched to developer mode.

2. Selected the Custom payment method.

I got stuck at step 3 "Set up the payment form (S2S Form Template) as instructed by your payment acquirer. You can start from default_acquirer_button that you can duplicate.". Please remember there is no payment acquirer we can turn to for instructions because we are using Odoo in an in-school simulation and the payment acquirer is a virtual bank that is part of the simulation platform. We as virtual bank are trying to find out what instructions we should provide to setup the Custom Payment Acquirer.

Coming back to my original question about where to set the URL of the payment page: should I edit the Form Button Template "default_acquirer_button"? Could you please point me to documentation that details how to configure this exactly. I searched high and low for this, so I would really appreciate it.

Regarding your suggesting for writing your own payment acquirer: as the schools are using Odoo Online (hosted by Odoo S.A.), how would that be installed? It was my impression that installing of custom modules and apps is not possible in Odoo Online but I would be very interested to learn how a custom payment acquirer can be installed.

Thanks!

Author Best Answer

Hi Benno,

Sorry for the belated answer. What worked for me, is to specify the url in the action attribute of the form, like so:

<?xml version="1.0"?>
<t t-name="payment.default_acquirer_button">
    <form action="[custom_payment_acquirer_url]" method="post" target="_self">
        <input type="hidden" name="reference" t-att-value="reference"/>
        <input type="hidden" name="amount" t-att-value="amount"/>
        <input type="hidden" name="currency" t-att-value="currency.name"/>
        <!-- submit -->
        <button type="submit" width="100px" t-att-class="submit_class">
            <img t-if="not submit_txt" src="/payment_transfer/static/src/img/transfer_icon.png"/>
            <span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
        </button>
    </form>
</t>

HTH

Avatar
Discard
Best Answer

Hi Henk,

I am very curious to know if you found a solution to this mystery. I have been fiddling all evening with these payment modules. All of them seem to be acting totally different from each other. Avery payment acquirer adds his own additional data to the big "payment.acquirer" table.

I will have to develop my own module, and I would greatly benefit from your experience !

Avatar
Discard
Best Answer

form hidden inputs. if you are not able to find any documentation, i suggest you to download source code from http://nightly.odoo.com/11.0/nightly/src/odoo_11.0.latest.tar.gz and look into it. paypal, authorize etc etc.

template for authorize.net

https://github.com/odoo/odoo/blob/11.0/addons/payment_authorize/views/payment_authorize_templates.xml

code below from own payment acquirer. that works for multiple banks via single api. 2 hard-coded token + 6-12 extra tokes generated depending on bank.

<template id="custom_acquirer_button">



<t t-set="banks" t-value="tx_values.get('banks')"/>

<t t-foreach="banks" t-as="bank">
<div class="checkoutfi-bank">
<form t-att-action="bank['url']" method="post">
<input type="hidden" name="tx_url" t-att-value="bank['url']" />
<input type="hidden" name="tx_name" t-att-value="bank['name']" />

<t t-foreach="bank['fields']" t-as="item">
<input type="hidden" t-att-name="item" t-att-value="item_value" />
</t>

<div>
<button type="button" class="btn btn-submit">
<div class="btn-bank">
<img class="bank-logo" t-att-src="bank['icon']" t-att-alt="bank['name']"/>
<span class="bank-name"><t t-esc="bank['name']" /></span>
</div>
</button>
</div>
</form>
</div>
</t>

</template>


online version, i don't know if you can install or not. hosting odoo on own servers.

Avatar
Discard
Related Posts Replies Views Activity
0
Apr 17
3335
2
Oct 23
1044
3
Feb 24
1305
1
Feb 22
1285
0
Jul 21
1341