From ab609ec4a5e9565763b9a48fe12e02a9fa26f1a0 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 ! This is a back-port from 10.0 (fb010a1) ! opw-693017 Original commit message: 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 1630c4fba99..eba83aa3d00 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -46,6 +46,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({ @@ -54,7 +55,6 @@ odoo.define('payment_stripe.stripe', function(require) { currency: $("input[name='currency']").val(), amount: $("input[name='amount']").val()*100 }); - e.preventDefault(); }); });