From cca12fbb08626094c24a245c5bf54dad2696fae7 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Wed, 10 Jan 2018 11:58:06 +0100 Subject: [PATCH] [FIX] payment_stripe: route receive wrong currency parameter This commit b335ae0348ac74b2edb6d5ea56cc230e276ef283 previously sent currency instead of currency_id on /website_payment/transaction route resulting in a cast error. Now, we send the currency_id as the route expect This closes #19468, closes #22165 --- addons/payment_stripe/static/src/js/stripe.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment_stripe/static/src/js/stripe.js b/addons/payment_stripe/static/src/js/stripe.js index 14e19775747..9db27aea858 100644 --- a/addons/payment_stripe/static/src/js/stripe.js +++ b/addons/payment_stripe/static/src/js/stripe.js @@ -68,6 +68,7 @@ odoo.define('payment_stripe.stripe', function(require) { e.preventDefault(); if ($('.o_website_payment').length !== 0) { var currency = $("input[name='currency']").val(); + var currency_id = $("input[name='currency_id']").val(); var amount = parseFloat($("input[name='amount']").val() || '0.0'); if (!_.contains(int_currencies, currency)) { amount = amount*100; @@ -76,7 +77,7 @@ odoo.define('payment_stripe.stripe', function(require) { ajax.jsonRpc('/website_payment/transaction', 'call', { reference: $("input[name='invoice_num']").val(), amount: amount, - currency_id: currency, + currency_id: currency_id, acquirer_id: acquirer_id }) handler.open({