Change country id to ISO 3166 1 numeric for 3DSV2 (#510)

This commit is contained in:
thomas girod 2022-12-12 22:54:31 +01:00 committed by GitHub
parent b8a72c57e1
commit 1d82e2a7d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,13 +175,13 @@ class BillingInfo(models.Model):
"Address1": self.address_1,
"ZipCode": self.zip_code,
"City": self.city,
"CountryCode": self.country,
"CountryCode": self.country.numeric, # ISO-3166-1 numeric code
}
}
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" ?>' + xml
return '<?xml version="1.0" encoding="UTF-8" ?>\n' + xml
def __str__(self):
return f"{self.first_name} {self.last_name}"