mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Fix 3DSv2 implementation (#542)
* Fixed wrong HMAC signature generation * Fix xml du panier Co-authored-by: Julien Constant <julienconstant190@gmail.com>
This commit is contained in:
parent
7079761ffe
commit
fe8b8f46aa
@ -181,7 +181,7 @@ class BillingInfo(models.Model):
|
||||
if self.address_2:
|
||||
data["Address"]["Address2"] = self.address_2
|
||||
xml = dict2xml(data, wrap="Billing", newlines=False)
|
||||
return '<?xml version="1.0" encoding="UTF-8" ?>\n' + xml
|
||||
return '<?xml version="1.0" encoding="UTF-8" ?>' + xml
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.first_name} {self.last_name}"
|
||||
|
@ -199,9 +199,12 @@ class Basket(models.Model):
|
||||
("PBX_TYPECARTE", "CB"),
|
||||
("PBX_TIME", datetime.now().replace(microsecond=0).isoformat("T")),
|
||||
]
|
||||
cart = {"shoppingcart": {"total": min(self.items.count(), 99)}}
|
||||
cart = dict2xml(cart, newlines=False)
|
||||
cart = '<?xml version="1.0" encoding="UTF-8" ?>' + cart
|
||||
cart = {
|
||||
"shoppingcart": {"total": {"totalQuantity": min(self.items.count(), 99)}}
|
||||
}
|
||||
cart = '<?xml version="1.0" encoding="UTF-8" ?>' + dict2xml(
|
||||
cart, newlines=False
|
||||
)
|
||||
data += [
|
||||
("PBX_SHOPPINGCART", html.escape(cart)),
|
||||
("PBX_BILLING", html.escape(customer.billing_infos.to_3dsv2_xml())),
|
||||
|
Loading…
Reference in New Issue
Block a user