Now that we're closer to switching to P3 for good, these helpers have outlived their usefulness, and mostly add noise. All remaining dict.iter*() or dict.view*() must be converted to the normal keys(), values() or items() calls. Whenever the result is likely to be used for more than the scope of a loop, or when the dict needs to be modified during iteration, the calls must be wrapped in a ``list()``, to protect the new P3 semantics. Those cases are very exceptional. Also removed some dead code or improved the API to remove unnecessary conversions.
32 lines
1021 B
Python
32 lines
1021 B
Python
# -*- 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='none', 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(return_url)
|