[FIX][H4547] website_sale_signifyd: make module installable

This commit is contained in:
Milan
2024-10-19 19:26:57 +02:00
parent 84c4774b35
commit dc248d1c20
4 changed files with 33 additions and 32 deletions

View File

@@ -125,6 +125,7 @@ class SaleOrder(models.Model):
'confirmationEmail': self.partner_id.email,
'confirmationPhone': self.partner_id.phone,
'products': [
{
'itemName': line.product_id.name,
'itemPrice': line.price_unit,
'itemQuantity': line.product_uom_qty,
@@ -134,7 +135,7 @@ class SaleOrder(models.Model):
'itemId': line.product_id.id,
'itemUrl': line.product_id.website_url,
'itemWeight': line.product_id.weight,
for line in self.order_line if line.product_id
} for line in self.order_line if line.product_id
],
'shipments': [
{
@@ -146,24 +147,24 @@ class SaleOrder(models.Model):
},
'transactions': [
{
"parentTransactionId": None,
"transactionId": tx.id,
"gateway": tx.acquirer_id.name,
"paymentMethod": "CREDIT_CARD",
"gatewayStatusCode": tx_status_type.get(tx.state, 'PENDING'),
"currency": tx.currency_id.name,
"amount": tx.amount,
'parentTransactionId': None,
'transactionId': tx.id,
'gateway': tx.acquirer_id.name,
'paymentMethod': 'CREDIT_CARD',
'gatewayStatusCode': tx_status_type.get(tx.state, 'PENDING'),
'currency': tx.currency_id.name,
'amount': tx.amount,
# "avsResponseCode": "Y",
# "cvvResponseCode": "N",
"checkoutPaymentDetails": {
"accountHolderName": tx.partner_id.name,
"billingAddress": {
"streetAddress": tx.partner_id.street,
"unit": tx.partner_id.street2,
"city": tx.partner_id.city,
"provinceCode": tx.partner_id.state_id.code,
"postalCode": tx.partner_id.zip,
"countryCode": tx.partner_id.country_id.code,
'checkoutPaymentDetails': {
'accountHolderName': tx.partner_id.name,
'billingAddress': {
'streetAddress': tx.partner_id.street,
'unit': tx.partner_id.street2,
'city': tx.partner_id.city,
'provinceCode': tx.partner_id.state_id.code,
'postalCode': tx.partner_id.zip,
'countryCode': tx.partner_id.country_id.code,
}
}
}

View File

@@ -8,7 +8,7 @@ class SignifydCoverage(models.Model):
name = fields.Char(required=True)
description = fields.Char()
code = fields.Char(required=True)
exclusive = fields.Boolean())
exclusive = fields.Boolean()
def _apply_exclusivity(self):
return self.filtered('exclusive')[:1] or self

View File

@@ -8,7 +8,7 @@
<field name="arch" type="xml">
<xpath expr="//field[@name='website_id']" position="after">
<field name="signifyd_case_required"/>
<field name="signifyd_coverage_type_ids"/>
<field name="signifyd_coverage_ids"/>
</xpath>
</field>
</record>

View File

@@ -107,7 +107,7 @@
<field name="secret_key" attrs="{'invisible': [('test_mode', '=', True)]}"/>
<field name="secret_key_test" attrs="{'invisible': [('test_mode', '!=', True)]}"/>
<!-- <field name="signifyd_case_type" /> -->
<field name="signifyd_coverage_type_ids"/>
<field name="signifyd_coverage_ids"/>
<p class="text-muted">
Optional: Add users to be notified if a sale order is declined by Signifyd.
</p>