summaryrefslogtreecommitdiff
path: root/addons/payment_authorize
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-04-05 18:46:10 +0200
committerChristophe Simonis <chs@odoo.com>2019-04-05 18:46:10 +0200
commit3f95b074e959f0f4ac93fbf4048c0c7276f2c17a (patch)
treef4e793da5d83bcd1bd4347f71cb3f45cbc953df3 /addons/payment_authorize
parent1a871d72438c731d08ef10e668b81b4ade900b85 (diff)
parentf2be461f0906ed47306da58c31240014b6239d80 (diff)
[MERGE] forward port branch saas-12.2 up to f2be461f090
Diffstat (limited to 'addons/payment_authorize')
-rw-r--r--addons/payment_authorize/models/authorize_request.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/payment_authorize/models/authorize_request.py b/addons/payment_authorize/models/authorize_request.py
index bca2164dac1..79d0a7589c5 100644
--- a/addons/payment_authorize/models/authorize_request.py
+++ b/addons/payment_authorize/models/authorize_request.py
@@ -148,7 +148,8 @@ class AuthorizeAPI():
"""
root = self._base_tree('createCustomerProfileRequest')
profile = etree.SubElement(root, "profile")
- etree.SubElement(profile, "merchantCustomerId").text = 'ODOO-%s-%s' % (partner.id, uuid4().hex[:8])
+ # merchantCustomerId is ODOO-{partner.id}-{random hex string} truncated to maximum 20 characters
+ etree.SubElement(profile, "merchantCustomerId").text = ('ODOO-%s-%s' % (partner.id, uuid4().hex[:8]))[:20]
etree.SubElement(profile, "email").text = partner.email or ''
payment_profile = etree.SubElement(profile, "paymentProfiles")
etree.SubElement(payment_profile, "customerType").text = 'business' if partner.is_company else 'individual'
@@ -220,7 +221,8 @@ class AuthorizeAPI():
root = self._base_tree('createCustomerProfileFromTransactionRequest')
etree.SubElement(root, "transId").text = transaction_id
customer = etree.SubElement(root, "customer")
- etree.SubElement(customer, "merchantCustomerId").text = 'ODOO-%s-%s' % (partner.id, uuid4().hex[:8])
+ # merchantCustomerId is ODOO-{partner.id}-{random hex string} truncated to maximum 20 characters
+ etree.SubElement(customer, "merchantCustomerId").text = ('ODOO-%s-%s' % (partner.id, uuid4().hex[:8]))[:20]
etree.SubElement(customer, "email").text = partner.email or ''
response = self._authorize_request(root)
res = dict()