main.py 700 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. import logging
  4. from odoo import http
  5. from odoo.http import request
  6. from odoo.addons.payment_adyen.controllers.main import AdyenController
  7. _logger = logging.getLogger(__name__)
  8. class PosRestaurantAdyenController(AdyenController):
  9. @http.route()
  10. def adyen_webhook(self, **post):
  11. if post.get('eventCode') in ['CAPTURE', 'AUTHORISATION_ADJUSTMENT'] and post.get('success') != 'true':
  12. _logger.warning('%s for transaction_id %s failed', post.get('eventCode'), post.get('originalReference'))
  13. return super(PosRestaurantAdyenController, self).adyen_webhook(**post)