flectra/addons/payment_payumoney/controllers/main.py

25 lines
836 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2018-01-16 11:34:37 +01:00
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
import logging
import pprint
import werkzeug
2018-01-16 11:34:37 +01:00
from flectra import http
from flectra.http import request
_logger = logging.getLogger(__name__)
class PayuMoneyController(http.Controller):
@http.route(['/payment/payumoney/return', '/payment/payumoney/cancel', '/payment/payumoney/error'], type='http', auth='public', csrf=False)
def payu_return(self, **post):
""" PayUmoney."""
_logger.info(
'PayUmoney: entering form_feedback with post data %s', pprint.pformat(post))
return_url = '/'
if post:
request.env['payment.transaction'].sudo().form_feedback(post, 'payumoney')
return_url = post.get('udf1')
return werkzeug.utils.redirect(return_url)