[IMP] website_sale_signifyd: hibou_professional and improve filter for submitting

This commit is contained in:
Jared Kipe
2021-06-15 10:34:58 -07:00
parent 117f80889d
commit 7c3513ef00
11 changed files with 33 additions and 4 deletions

View File

@@ -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):