[FIX] payment_authorize: add required fields for wespac Australia (#26709)
for the payment processor wespac there are required fields we do not send. required: •Card Number •Expiration Date •Amount •First Name •Last Name •Address •City •State/Province** •Zip Code (Postal Code/Postcode)** •Country •Email ** These fields are optional if the billing address is not in the U.S. or Canada. If the address is in the U.S. or Canada, the two-digit State/Province code must be provided, along with the Zip/Postal Code.
This commit is contained in:
@@ -138,6 +138,8 @@ class AuthorizeAPI():
|
||||
payment_profile = etree.SubElement(profile, "paymentProfiles")
|
||||
etree.SubElement(payment_profile, "customerType").text = 'business' if partner.is_company else 'individual'
|
||||
billTo = etree.SubElement(payment_profile, "billTo")
|
||||
etree.SubElement(billTo, "firstName").text = (partner.name.split(' ')[0] or None)
|
||||
etree.SubElement(billTo, "lastName").text = (' '.join(partner.name.split(' ')[1:]) or None)
|
||||
etree.SubElement(billTo, "address").text = (partner.street or '' + (partner.street2 if partner.street2 else '')) or None
|
||||
|
||||
missing_fields = [partner._fields[field].string for field in ['city', 'country_id'] if not partner[field]]
|
||||
|
||||
Reference in New Issue
Block a user