From a63ea592d4e38a729c122fe12386ddc107c7f98d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 26 Jan 2017 13:22:12 +0100 Subject: [PATCH] [FIX] payment: payment reference length The payment reference of a S2S transaction has the given format: 'PAYMENT-9-170110_200204'. However, the reference is too long for some providers such as Authorize (limited to 20 characters). We make the reference less verbose as a first step to solve the issue. However, case-by-case solutions will need to be found since the reference depends on the id, which will ultimately grow. opw-704615 --- addons/payment/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment/models/account_payment.py b/addons/payment/models/account_payment.py index 8609b6b96c9..d507666f35f 100644 --- a/addons/payment/models/account_payment.py +++ b/addons/payment/models/account_payment.py @@ -41,7 +41,7 @@ class AccountPayment(models.Model): if self.payment_token_id.acquirer_id.auto_confirm == 'authorize': raise ValidationError('This feature is not available for payment acquirers set to the "Authorize" mode.\n' 'Please use a token from another provider than %s.' % self.payment_token_id.acquirer_id.name) - reference = "PAYMENT-%s-%s" % (self.id, datetime.datetime.now().strftime('%y%m%d_%H%M%S')) + reference = "P-%s-%s" % (self.id, datetime.datetime.now().strftime('%y%m%d_%H%M%S')) tx = self.env['payment.transaction'].create({ 'amount': self.amount, 'acquirer_id': self.payment_token_id.acquirer_id.id,