diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/payment_buckaroo/controllers | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/payment_buckaroo/controllers')
| -rw-r--r-- | addons/payment_buckaroo/controllers/__init__.py | 3 | ||||
| -rw-r--r-- | addons/payment_buckaroo/controllers/main.py | 31 |
2 files changed, 34 insertions, 0 deletions
diff --git a/addons/payment_buckaroo/controllers/__init__.py b/addons/payment_buckaroo/controllers/__init__.py new file mode 100644 index 00000000..65a8c120 --- /dev/null +++ b/addons/payment_buckaroo/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import main diff --git a/addons/payment_buckaroo/controllers/main.py b/addons/payment_buckaroo/controllers/main.py new file mode 100644 index 00000000..1810355c --- /dev/null +++ b/addons/payment_buckaroo/controllers/main.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import logging +import pprint +import werkzeug + +from odoo import http +from odoo.http import request + +_logger = logging.getLogger(__name__) + + +class BuckarooController(http.Controller): + _return_url = '/payment/buckaroo/return' + _cancel_url = '/payment/buckaroo/cancel' + _exception_url = '/payment/buckaroo/error' + _reject_url = '/payment/buckaroo/reject' + + @http.route([ + '/payment/buckaroo/return', + '/payment/buckaroo/cancel', + '/payment/buckaroo/error', + '/payment/buckaroo/reject', + ], type='http', auth='public', csrf=False) + def buckaroo_return(self, **post): + """ Buckaroo.""" + _logger.info('Buckaroo: entering form_feedback with post data %s', pprint.pformat(post)) # debug + request.env['payment.transaction'].sudo().form_feedback(post, 'buckaroo') + post = {key.upper(): value for key, value in post.items()} + return_url = post.get('ADD_RETURNDATA') or '/' + return werkzeug.utils.redirect('/payment/process') |
