From 26974d4e5fe48d34294434ed52dcf8053416410e Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Fri, 31 Aug 2018 11:29:38 +0200 Subject: [PATCH] [FIX] payment_authorize: add required fields for wespac Australia (#26709) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- addons/payment_authorize/models/authorize_request.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py index ae012237341..571f86d4f68 100644 --- a/addons/payment_authorize/models/authorize_request.py +++ b/addons/payment_authorize/models/authorize_request.py @@ -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]]