From 7d15a6e6d67ebd867c69ae9153dd80b70dbebac8 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 12 Apr 2017 09:51:06 +0200 Subject: [PATCH] [FIX] payment_stripe: handler.open in deferred As explained in https://stripe.com/docs/checkout#integration-more-runloop the function handler.open cannot be called in a deferred because it can block in some browser. opw:726101 --- addons/payment_stripe/static/src/js/stripe.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 5d0fa66ff23..7338313e245 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -55,19 +55,18 @@ odoo.define('payment_stripe.stripe', function(require) { amount: $("input[name='amount']").val(), currency_id: $("input[name='currency_id']").val(), acquirer_id: acquirer_id - }).then(function (data) { + }) handler.open({ name: $("input[name='merchant']").val(), description: $("input[name='invoice_num']").val(), currency: $("input[name='currency']").val(), amount: $("input[name='amount']").val()*100 }); - }); } else { ajax.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', { so_id: so_id, so_token: so_token - }).then(function (data) { + }, {'async': false}).then(function (data) { $form.html(data); handler.open({ name: $("input[name='merchant']").val(),