diff options
| author | fda-odoo <fda@odoo.com> | 2018-01-03 15:52:58 +0100 |
|---|---|---|
| committer | fda-odoo <fda@odoo.com> | 2018-01-24 15:36:56 +0100 |
| commit | c0e919b8ebeef0ae4f2f2477c93d277cbb03ee7a (patch) | |
| tree | 2c69ac56b0114cd7b5a1e1e2a6cf7664e277df99 /addons/payment_authorize/controllers | |
| parent | c91994fcd3a5609874daf786e2b63ccac30a1833 (diff) | |
[FIX] payment_ogone, payment_stripe, payment_authorize: give partner_id as parameter to s2s_process
If the page doesn't provide the partner_id, the three acquirer will now add it before process the payment.
Diffstat (limited to 'addons/payment_authorize/controllers')
| -rw-r--r-- | addons/payment_authorize/controllers/main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/payment_authorize/controllers/main.py b/addons/payment_authorize/controllers/main.py index 451a5875b6d..9614327401a 100644 --- a/addons/payment_authorize/controllers/main.py +++ b/addons/payment_authorize/controllers/main.py @@ -36,6 +36,8 @@ class AuthorizeController(http.Controller): def authorize_s2s_create_json(self, **kwargs): acquirer_id = int(kwargs.get('acquirer_id')) acquirer = request.env['payment.acquirer'].browse(acquirer_id) + if not kwargs.get('partner_id'): + kwargs = dict(kwargs, partner_id=request.env.user.partner_id.id) return acquirer.s2s_process(kwargs).id @http.route(['/payment/authorize/s2s/create_json_3ds'], type='json', auth='public', csrf=False) @@ -44,6 +46,8 @@ class AuthorizeController(http.Controller): acquirer = request.env['payment.acquirer'].browse(int(kwargs.get('acquirer_id'))) try: + if not kwargs.get('partner_id'): + kwargs = dict(kwargs, partner_id=request.env.user.partner_id.id) token = acquirer.s2s_process(kwargs) except ValidationError as e: message = e.args[0] |
