[IMP][H4547] website_sale_signifyd: API v3 (WIP)

This commit is contained in:
Milan Cosnefroy
2024-10-09 13:36:54 +02:00
parent 8098cfed01
commit 7701c61bf0
4 changed files with 26 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
{
'name': 'Signifyd Connector',
'author': 'Hibou Corp. <hello@hibou.io>',
'version': '15.0.1.1.0',
'version': '15.0.2.0.0',
'category': 'Sale',
'description': """
Automate Order Fraud Detection with the Signifyd API.
@@ -16,6 +16,7 @@ Automate Order Fraud Detection with the Signifyd API.
],
'data': [
'security/ir.model.access.csv',
'data/signifyd_coverage.xml',
'views/partner_views.xml',
'views/payment_views.xml',
'views/sale_views.xml',

View File

@@ -0,0 +1,13 @@
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
def migrate(cr, version):
cr.execute('''
ALTER TABLE payment_acquirer
ADD COLUMN signifyd_case_required BOOLEAN;
''')
cr.execute('''
UPDATE payment_acquirer
WHERE signifyd_case_type IS NOT NULL
SET signifyd_case_required = TRUE;
''')

View File

@@ -89,17 +89,17 @@ class SaleOrder(models.Model):
def _prepare_signifyd_case_values(self, order_session_id, checkout_token, browser_ip_address):
coverage_codes = self._get_coverage_types().mapped('code')
decision_request = self.website_id.signifyd_connector_id.signifyd_case_type or 'DECISION'
# decision_request = self.website_id.signifyd_connector_id.signifyd_case_type or 'DECISION'
# find the highest 'acquirer override'
# note that we shouldn't be here if the override would prevent sending
a_case_types = self.transaction_ids.mapped('acquirer_id.signifyd_case_type')
if a_case_types and 'GUARANTEE' in a_case_types:
decision_request = 'GUARANTEE'
elif a_case_types and 'SCORE' in a_case_types:
decision_request = 'SCORE'
elif a_case_types and 'DECISION' in a_case_types:
decision_request = 'DECISION'
# # find the highest 'acquirer override'
# # note that we shouldn't be here if the override would prevent sending
# a_case_types = self.transaction_ids.mapped('acquirer_id.signifyd_case_type')
# if a_case_types and 'GUARANTEE' in a_case_types:
# decision_request = 'GUARANTEE'
# elif a_case_types and 'SCORE' in a_case_types:
# decision_request = 'SCORE'
# elif a_case_types and 'DECISION' in a_case_types:
# decision_request = 'DECISION'
tx_status_type = {
'draft': 'FAILURE',

View File

@@ -7,7 +7,7 @@
<field name="inherit_id" ref="website_payment.acquirer_form_website"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='website_id']" position="after">
<!-- <field name="signifyd_case_type"/> -->
<field name="signifyd_case_required"/>
<field name="signifyd_coverage_type_ids"/>
</xpath>
</field>