diff options
| author | Thibault Delavallée <tde@openerp.com> | 2013-11-07 19:04:44 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2013-11-07 19:04:44 +0100 |
| commit | b2ea74e4e6ca98a08ccadd7f37926e7ec594ea2a (patch) | |
| tree | 8e4150fdce6f8cc6f8d6c47a4eac3caec18b4f53 /addons/payment_acquirer_ogone/controllers/main.py | |
| parent | 35619dfe125756c0911ad403e746e4a92d8046ae (diff) | |
[REF] payment: moved paypal and ogone stuff into their dedicated modules.
Added payment_acquirer_paypal and .._ogone modules. Those modules hold
the model / data / controllers related to the specific acquirer.
Also updated website_payment, to use website.menu instead of custom change
in header, as menus are now editable.
bzr revid: tde@openerp.com-20131107180444-bbzobquqq9o6pctv
Diffstat (limited to 'addons/payment_acquirer_ogone/controllers/main.py')
| -rw-r--r-- | addons/payment_acquirer_ogone/controllers/main.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/addons/payment_acquirer_ogone/controllers/main.py b/addons/payment_acquirer_ogone/controllers/main.py new file mode 100644 index 00000000000..8633ba30f12 --- /dev/null +++ b/addons/payment_acquirer_ogone/controllers/main.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +############################################################################## + +from openerp.addons.web import http +from openerp.addons.web.http import request +# from openerp.addons.payment_acquirer.models.payment_acquirer import ValidationError +from openerp.addons.website.models import website + +import logging +import requests +from urllib import urlencode + +_logger = logging.getLogger(__name__) + + +class OgoneController(http.Controller): + _accept_url = '/payment/ogone/test/accept' + _decline_url = '/payment/ogone/test/decline' + _exception_url = '/payment/ogone/test/exception' + _cancel_url = '/payment/ogone/test/cancel' + + @website.route([ + '/payment/ogone/feedback', '/payment/ogone/test/accept', + '/payment/ogone/decline', '/payment/ogone/test/decline', + '/payment/ogone/exception', '/payment/ogone/test/exception', + '/payment/ogone/cancel', '/payment/ogone/test/cancel', + ], type='http', auth='admin') + def feedback(self, **post): + cr, uid, context = request.cr, request.uid, request.context + Payment = request.registry['payment.transaction'] + print 'Entering ogone feedback with', post + + res = Payment.tx_ogone_feedback(cr, uid, post, context) + print res + return '' |
