[FIX] payment_paypal: Disable csrf on paypal callbacks

When the http csrf is default enabled, callbacks raises a http error 400:
Invalid CSRF Token.

Fixes #9065
Closes #9073
This commit is contained in:
Oriol Carreras
2015-10-22 08:41:51 +02:00
committed by Martin Trigaux
parent c8a3fd9031
commit 2099f15d67
+2 -2
View File
@@ -58,14 +58,14 @@ class PaypalController(http.Controller):
_logger.warning('Paypal: unrecognized paypal answer, received %s instead of VERIFIED or INVALID' % resp.text)
return res
@http.route('/payment/paypal/ipn/', type='http', auth='none', methods=['POST'])
@http.route('/payment/paypal/ipn/', type='http', auth='none', methods=['POST'], csrf=False)
def paypal_ipn(self, **post):
""" Paypal IPN. """
_logger.info('Beginning Paypal IPN form_feedback with post data %s', pprint.pformat(post)) # debug
self.paypal_validate_data(**post)
return ''
@http.route('/payment/paypal/dpn', type='http', auth="none", methods=['POST'])
@http.route('/payment/paypal/dpn', type='http', auth="none", methods=['POST'], csrf=False)
def paypal_dpn(self, **post):
""" Paypal DPN """
_logger.info('Beginning Paypal DPN form_feedback with post data %s', pprint.pformat(post)) # debug