From fb010a10045c2bcc05fd15df7bbb11e27eb74705 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 28 Oct 2016 11:33:35 +0200 Subject: [PATCH] [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 --- addons/payment_stripe/static/src/js/stripe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }); });