From 84c4774b35a55aa7470cb14fc53114c90b18d84c Mon Sep 17 00:00:00 2001 From: Milan Cosnefroy Date: Wed, 9 Oct 2024 13:48:06 +0200 Subject: [PATCH] [IMP][H4547] website_sale_signifyd: API v3 (WIP) --- website_sale_signifyd/models/sale_order.py | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/website_sale_signifyd/models/sale_order.py b/website_sale_signifyd/models/sale_order.py index b2ec4b5f..9fd51509 100644 --- a/website_sale_signifyd/models/sale_order.py +++ b/website_sale_signifyd/models/sale_order.py @@ -143,7 +143,32 @@ class SaleOrder(models.Model): } for carrier in self.carrier_id ], 'coverageRequests': coverage_codes, - + }, + '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, + # "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, + } + } + } + for tx in self.transaction_ids + ], } for line in new_case_vals['purchase']['products']: