[FIX] payment_stripe: regex to match so_ID

Before this commit, when paying a confirmed SO with the token access with Stripe,
Clicking on the button "pay now" wouldn't do anything, because the id of the SO couldn't be retrieved

After this commit, the regex that does just that is more generic and the flow works

OPW 1881192
closes #26884
This commit is contained in:
Lucas Perais (lpe)
2018-09-11 09:30:25 +02:00
parent c3ea0a7811
commit f5e145d2b9
@@ -93,7 +93,7 @@ odoo.define('payment_stripe.stripe', function(require) {
}
var access_token = $("input[name='access_token']").val() || $("input[name='token']").val() || '';
var so_id = $("input[name='return_url']").val().match(/quote\/([0-9]+)/) || undefined;
var so_id = $("input[name='return_url']").val().match(/[quote|order]s?\/([0-9]+)/) || undefined;
if (so_id) {
so_id = parseInt(so_id[1]);
}