mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] website_sale_signifyd: hibou_professional and improve filter for submitting
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||
|
||||
import json
|
||||
from odoo.http import Controller, request, route
|
||||
from odoo.http import Response
|
||||
@@ -12,10 +14,14 @@ class SignifydWebhooks(Controller):
|
||||
def _case_update(self):
|
||||
data = json.loads(request.httprequest.data)
|
||||
vals = request.env['signifyd.connector'].process_post_values(data)
|
||||
case = self._get_case(vals.get('case_id'))
|
||||
case_id = vals.get('case_id')
|
||||
case = self._get_case(case_id)
|
||||
if case:
|
||||
case.update_case_info(vals)
|
||||
return Response({'response': 'success'}, status=200, mimetype='application/json')
|
||||
if case_id == 1:
|
||||
# Special case when verifying webhook.
|
||||
return Response({'response': 'success'}, status=200, mimetype='application/json')
|
||||
return Response({'response': 'failed'}, status=500, mimetype='application/json')
|
||||
|
||||
def _get_case(self, case_id):
|
||||
|
||||
Reference in New Issue
Block a user