[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:
Gert Pellin
2018-08-31 11:29:38 +02:00
committed by GitHub
parent 4877030d64
commit 26974d4e5f
@@ -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]]