summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/models/authorize_request.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/payment_authorize/models/authorize_request.py')
-rw-r--r--addons/payment_authorize/models/authorize_request.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py
index e3e65648ee0..0ac1a90c071 100644
--- a/addons/payment_authorize/models/authorize_request.py
+++ b/addons/payment_authorize/models/authorize_request.py
@@ -238,7 +238,12 @@ class AuthorizeAPI():
etree.SubElement(root_profile, "customerProfileId").text = res['profile_id']
etree.SubElement(root_profile, "customerPaymentProfileId").text = res['payment_profile_id']
response_profile = self._authorize_request(root_profile)
- res['name'] = response_profile.find('paymentProfile/payment/creditCard/cardNumber').text
+ card_number = response_profile.find('paymentProfile/payment/creditCard/cardNumber')
+ if card_number:
+ res['name'] = card_number.text
+ else:
+ res['name'] = response_profile.find('paymentProfile/payment/bankAccount/accountNumber').text
+
return res
def credit(self, token, amount, transaction_id):