From 338df8f49271991875479e1a69a2c3ef3acfca8d Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 30 Apr 2015 14:24:22 +0200 Subject: [PATCH] [FIX] payment_adyen: pspReference is not mandatory Indeed, when canceling a transaction, pspReference is not passed. In such a case, the arg authResult is set to `CANCELLED`, and in such a case, we should just bypass the form_feedback, as done in the payment_paypal module. opw-634210 --- addons/payment_adyen/controllers/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/payment_adyen/controllers/main.py b/addons/payment_adyen/controllers/main.py index e6e74eba9a7..63b8c9a8fb5 100644 --- a/addons/payment_adyen/controllers/main.py +++ b/addons/payment_adyen/controllers/main.py @@ -20,11 +20,10 @@ class AdyenController(http.Controller): @http.route([ '/payment/adyen/return/', ], type='http', auth='none') - def adyen_return(self, pspReference, **post): - """ Paypal IPN.""" - post["pspReference"] = pspReference + def adyen_return(self, **post): _logger.info('Beginning Adyen form_feedback with post data %s', pprint.pformat(post)) # debug - request.registry['payment.transaction'].form_feedback(request.cr, SUPERUSER_ID, post, 'adyen', context=request.context) + if post.get('authResult') not in ['CANCELLED']: + request.registry['payment.transaction'].form_feedback(request.cr, SUPERUSER_ID, post, 'adyen', context=request.context) return_url = post.pop('return_url', '') if not return_url: custom = json.loads(post.pop('merchantReturnData', '{}'))