[FIX] payment_stripe: fix the 404 error and redirect on /my/orders page

Fix the 404 error with stripe on the page /my/orders if website_quote and website_sale aren't installed
This commit is contained in:
fda-odoo
2018-01-24 15:41:01 +01:00
parent 9ba1cc46c5
commit 2bd17285ea
@@ -120,6 +120,14 @@ odoo.define('payment_stripe.stripe', function(require) {
}).then(function (data) {
try { provider_form[0].innerHTML = data; } catch (e) {};
});
} else if (window.location.href.includes("/my/orders/")) {
var create_tx = ajax.jsonRpc('/pay/sale/' + acquirer_id + '/form_tx/', 'call', {
so_id: so_id,
access_token: access_token,
acquirer_id: acquirer_id
}).then(function (data) {
try { provider_form.innerHTML = data; } catch (e) {};
});
}
else {
var create_tx = ajax.jsonRpc('/shop/payment/transaction/' + acquirer_id, 'call', {