diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-05-15 20:18:14 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-05-15 20:18:14 +0200 |
| commit | fa8a67ee5ff6b3bdc15d000bfda0c57350e01aa9 (patch) | |
| tree | 13f57e095568fb456803f5d967b9e582eacd933c /addons/payment_sips/models | |
| parent | 05ef2f24e08a06d586f9dc390878ecd3c069042f (diff) | |
| parent | 5a943390f2abf82883316052ad0eeb601b0194c3 (diff) | |
[MERGE] forward port branch 11.0 up to 5a943390f2a
Diffstat (limited to 'addons/payment_sips/models')
| -rw-r--r-- | addons/payment_sips/models/payment.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/payment_sips/models/payment.py b/addons/payment_sips/models/payment.py index bbbe64b3feb..874d88508e4 100644 --- a/addons/payment_sips/models/payment.py +++ b/addons/payment_sips/models/payment.py @@ -4,6 +4,7 @@ import json import logging +import re from hashlib import sha256 from werkzeug import urls @@ -111,6 +112,16 @@ class AcquirerSips(models.Model): return self.environment == 'prod' and self.sips_prod_url or self.sips_test_url +class PaymentTransactionSips(models.Model): + _inherit = 'payment.transaction' + + @api.model + def _get_next_reference(self, reference, acquirer=None): + if acquirer and acquirer.provider == 'sips': + reference = re.sub(r'[^0-9a-zA-Z]+', 'x' , reference) + return super(PaymentTransactionSips, self)._get_next_reference(reference, acquirer=acquirer) + + class TxSips(models.Model): _inherit = 'payment.transaction' |
