paybox: accept 3 digits in rang number(#48619)
gitea/eopayment/pipeline/head Build started... Details

This commit is contained in:
Serghei Mihai 2020-11-17 16:39:27 +01:00
parent eea999db67
commit b35d048030
2 changed files with 6 additions and 6 deletions

View File

@ -240,7 +240,7 @@ class Payment(PaymentCommon):
'caption': _('Numéro de rang'),
'required': True,
'validation': lambda x: isinstance(x, six.string_types)
and x.isdigit() and len(x) == 2,
and x.isdigit() and len(x) == 3,
},
{
'name': 'identifiant',
@ -312,7 +312,7 @@ class Payment(PaymentCommon):
def request(self, amount, email, name=None, orderid=None, manual_validation=None, **kwargs):
d = OrderedDict()
d['PBX_SITE'] = force_text(self.site)
d['PBX_RANG'] = force_text(self.rang).strip()[-2:]
d['PBX_RANG'] = force_text(self.rang).strip()[-3:]
d['PBX_IDENTIFIANT'] = force_text(self.identifiant)
d['PBX_TOTAL'] = self.clean_amount(amount)
d['PBX_DEVISE'] = force_text(self.devise)

View File

@ -93,7 +93,7 @@ class PayboxTests(TestCase):
self.assertEqual(root.attrib['method'], 'POST')
self.assertEqual(root.attrib['action'], paybox.URLS['test'])
expected_form_values = {
'PBX_RANG': '01',
'PBX_RANG': '001',
'PBX_SITE': '12345678',
'PBX_IDENTIFIANT': '12345678',
'PBX_RETOUR': (
@ -108,9 +108,9 @@ class PayboxTests(TestCase):
'PBX_DEVISE': '978',
'PBX_HASH': 'SHA512',
'PBX_HMAC': (
'300CFBDFF0454403BE7FEA11B9714C6B134294313E'
'7A052580F517BFCB117FB6A175C2E0DC81F6137D95'
'8FCA3CC4F8F1883A479C474C3A7B871CCA2DB8D033D9'
'A9F561A6EA79390F1741A6B72872470BC1A1688E4581'
'F097EC80B99D2038413AB350F2F5429FFA4F8D426D99'
'B72E038164642F6F9BA10D46837EE486EEB944A2'
),
'PBX_ARCHIVAGE': '20160216',
'PBX_REPONDRE_A': 'http://example.com/callback',