summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/controllers/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/payment_authorize/controllers/main.py')
-rw-r--r--addons/payment_authorize/controllers/main.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/addons/payment_authorize/controllers/main.py b/addons/payment_authorize/controllers/main.py
index b42efe817bb..6b0aae9bf6a 100644
--- a/addons/payment_authorize/controllers/main.py
+++ b/addons/payment_authorize/controllers/main.py
@@ -35,7 +35,31 @@ 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)
- return acquirer.s2s_process(kwargs)
+ return acquirer.s2s_process(kwargs).id
+
+ @http.route(['/payment/authorize/s2s/create_json_3ds'], type='json', auth='public', csrf=False)
+ def authorize_s2s_create_json_3ds(self, verify_validity=False, **kwargs):
+ token = request.env['payment.acquirer'].browse(int(kwargs.get('acquirer_id'))).s2s_process(kwargs)
+
+ if not token:
+ res = {
+ 'result': False,
+ }
+ return res
+
+ res = {
+ 'result': True,
+ 'id': token.id,
+ 'short_name': token.short_name,
+ '3d_secure': False,
+ 'verified': False,
+ }
+
+ if verify_validity != False:
+ token.validate()
+ res['verified'] = token.verified
+
+ return res
@http.route(['/payment/authorize/s2s/create'], type='http', auth='public')
def authorize_s2s_create(self, **post):