diff options
Diffstat (limited to 'addons/payment_authorize/models/authorize_request.py')
| -rw-r--r-- | addons/payment_authorize/models/authorize_request.py | 6 |
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() |
