<input t-if="tx_values.get('merchantReturnData')" type='hidden' name='merchantReturnData'
t-att-value="tx_values.get('merchantReturnData')"/>
<!-- submit -->
- <button type="image" name="submit" width="100px"
+ <button type="submit" width="100px"
t-att-class="submit_class">
<img t-if="not submit_txt" src="/payment_adyen/static/src/img/adyen_icon.png"/>
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
<input type='hidden' name='EXCEPTIONURL' t-att-value='tx_values["EXCEPTIONURL"]'/>
<input type='hidden' name='CANCELURL' t-att-value='tx_values["CANCELURL"]'/>
<!-- submit -->
- <button type="image" name="submit" width="100px"
+ <button type="submit" width="100px"
t-att-class="submit_class">
<img t-if="not submit_txt" src="/payment_ogone/static/src/img/ogone_icon.png"/>
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
<input t-if="tx_values.get('cancel_return')" type="hidden" name="cancel_return"
t-att-value="tx_values.get('cancel_return')"/>
<!-- submit -->
- <button type="image" name="submit" width="100px"
+ <button type="submit" width="100px"
t-att-class="submit_class">
<img t-if="not submit_txt" src="/payment_paypal/static/src/img/paypal_icon.png"/>
<span t-if="submit_txt"><t t-esc="submit_txt"/> <span class="fa fa-long-arrow-right"/></span>
<input type='hidden' name='amount' t-att-value='amount or "0.0"'/>
<input type='hidden' name='currency' t-att-value='currency.name'/>
<!-- submit -->
- <button name="submit" width="100px"
+ <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>
.find("input[name='acquirer']:checked").click();
// When clicking on payment button: create the tx using json then continue to the acquirer
- $payment.on("click", "button[name='submit']", function (ev) {
- var acquirer_id = $(ev.currentTarget).parents('div.oe_sale_acquirer_button').first().data('id');
- if (! acquirer_id) {
- return false;
- }
- var def = openerp.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {});
- $.when(def).then(function (data) {
- return true;
- });
+ $('button[type="submit"]').on("click", function (ev) {
+ ev.preventDefault();
+ ev.stopPropagation();
+ var $form = $(ev.currentTarget).parents('form');
+ var acquirer_id = $(ev.currentTarget).parents('div.oe_sale_acquirer_button').first().data('id');
+ if (! acquirer_id) {
+ return false;
+ }
+ openerp.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {}).then(function (data) {
+ $form.submit();
+ });
});
});