[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
This commit is contained in:
parent
238f1fa591
commit
338df8f492
|
@ -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', '{}'))
|
||||
|
|
Loading…
Reference in New Issue