diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-10-28 11:33:35 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-10-28 11:33:35 +0200 |
| commit | fb010a10045c2bcc05fd15df7bbb11e27eb74705 (patch) | |
| tree | c288349f3475af19d690b2747fd052c3089f5bdd | |
| parent | 815f0853c899663628987c30d4980f1fbf66f803 (diff) | |
[FIX] payment_stripe: preventDefault
When a user uses Strip and clicks on "Pay & Confirm", a "Bad Request"
error can pop-up. This is because it tries to reload the page, while it
should only display the Strip pop-up.
This is simply due to a `preventDefault` done after the event is
performed, and not before.
opw-692341
| -rw-r--r-- | addons/payment_stripe/static/src/js/stripe.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 6d98a15f6e9..022e279f1de 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -47,6 +47,7 @@ odoo.define('payment_stripe.stripe', function(require) { return false; } + e.preventDefault(); ajax.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {}).then(function (data) { $form.html(data); handler.open({ @@ -55,7 +56,6 @@ odoo.define('payment_stripe.stripe', function(require) { currency: $("input[name='currency']").val(), amount: $("input[name='amount']").val()*100 }); - e.preventDefault(); }); }); |
