[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
This commit is contained in:
Nicolas Martinelli
2016-10-28 11:33:35 +02:00
parent 815f0853c8
commit fb010a1004
@@ -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();
});
});