summaryrefslogtreecommitdiff
path: root/addons/payment_stripe/controllers/main.py
diff options
context:
space:
mode:
authorfda-odoo <fda@odoo.com>2018-01-03 15:52:58 +0100
committerfda-odoo <fda@odoo.com>2018-01-24 15:36:56 +0100
commitc0e919b8ebeef0ae4f2f2477c93d277cbb03ee7a (patch)
tree2c69ac56b0114cd7b5a1e1e2a6cf7664e277df99 /addons/payment_stripe/controllers/main.py
parentc91994fcd3a5609874daf786e2b63ccac30a1833 (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_stripe/controllers/main.py')
-rw-r--r--addons/payment_stripe/controllers/main.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/payment_stripe/controllers/main.py b/addons/payment_stripe/controllers/main.py
index 61c1f003b59..f446375d429 100644
--- a/addons/payment_stripe/controllers/main.py
+++ b/addons/payment_stripe/controllers/main.py
@@ -15,6 +15,8 @@ class StripeController(http.Controller):
def stripe_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/stripe/s2s/create'], type='http', auth='public')
@@ -36,6 +38,8 @@ class StripeController(http.Controller):
@http.route(['/payment/stripe/s2s/create_json_3ds'], type='json', auth='public', csrf=False)
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)
if not token: