From 6ded4d9ce89465a4a83f8bca4a1c01d995995bc1 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 7 Aug 2018 14:43:21 +0200 Subject: [PATCH] [FIX] payment_stripe: disable button - Create an order from the eCommerce - Choose to pay with Stripe - Enter the credit card info, validate There is a short window of time (before the reload of the page) where the user can click on 'Pay Now' again. This is because the HTML is completely replaced, including the button. We restore it when necessary. opw-1866332 --- addons/payment_stripe/static/src/js/stripe.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index c1ddb41351b..2701edf015e 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -92,7 +92,10 @@ odoo.define('payment_stripe.stripe', function(require) { so_id: so_id, so_token: so_token }, {'async': false}).then(function (data) { + var $pay_stripe = $('#pay_stripe').detach(); $form.html(data); + // Restore 'Pay Now' button HTML since data might have changed it. + $form.find('#pay_stripe').replaceWith($pay_stripe); handler.open({ name: $("input[name='merchant']").val(), email: $("input[name='email']").val(),