[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
This commit is contained in:
Nicolas Martinelli
2018-08-08 14:18:17 +02:00
committed by Nicolas Martinelli
parent c61cddf814
commit 6ded4d9ce8
@@ -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(),