diff options
| author | jev-odoo <jev@odoo.com> | 2020-05-27 08:23:09 +0000 |
|---|---|---|
| committer | jev-odoo <jev@odoo.com> | 2020-05-29 09:36:02 +0000 |
| commit | 013831b17699d05ee3adf1b7ba3a652f335d6044 (patch) | |
| tree | 5bab29295acbe459964b47db78907ebfdbbd641c /addons/payment_stripe/controllers | |
| parent | ed2f14784dde25ff372dcf31ac1b2a3d40634972 (diff) | |
[FIX] payment_stripe: Request error handling with automatic flow
PR https://github.com/odoo/odoo/pull/49964 fixed manual payment flow
but broke automatic payment flow.
This commit should allow both by raising the exception only for
manual flow, giving only an error for automatic flows.
FW-PORT of https://github.com/odoo/odoo/pull/50908/commits/46e977a21743644a2e98344e3491f0dd6fcbe892
closes odoo/odoo#52151
X-original-commit: a40089d67b66b593a09b0fa4c4cd24f6ce5fcc71
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Diffstat (limited to 'addons/payment_stripe/controllers')
| -rw-r--r-- | addons/payment_stripe/controllers/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment_stripe/controllers/main.py b/addons/payment_stripe/controllers/main.py index 5b5d70bcf6d..8d5f5bf65df 100644 --- a/addons/payment_stripe/controllers/main.py +++ b/addons/payment_stripe/controllers/main.py @@ -21,7 +21,7 @@ class StripeController(http.Controller): def stripe_s2s_create_json_3ds(self, verify_validity=False, **kwargs): if not kwargs.get('partner_id'): kwargs = dict(kwargs, partner_id=request.env.user.partner_id.id) - token = request.env['payment.acquirer'].browse(int(kwargs.get('acquirer_id'))).s2s_process(kwargs) + token = request.env['payment.acquirer'].browse(int(kwargs.get('acquirer_id'))).with_context(stripe_manual_payment=True).s2s_process(kwargs) if not token: res = { @@ -46,7 +46,7 @@ class StripeController(http.Controller): @http.route('/payment/stripe/s2s/create_setup_intent', type='json', auth='public', csrf=False) def stripe_s2s_create_setup_intent(self, acquirer_id, **kwargs): acquirer = request.env['payment.acquirer'].browse(int(acquirer_id)) - res = acquirer._create_setup_intent(kwargs) + res = acquirer.with_context(stripe_manual_payment=True)._create_setup_intent(kwargs) return res.get('client_secret') @http.route('/payment/stripe/s2s/process_payment_intent', type='json', auth='public', csrf=False) |
