summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-06-11 15:02:21 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-06-17 08:10:51 (GMT)
commitb12bb1b5b64bf30067a33cd0f2fcc61bd73563b5 (patch)
tree30f3cc7a7ffedbf31b57b8991ef6d50f30d94dd9
parent6ebcd4c6743a154476c4e7c76b914b5de2e4ce55 (diff)
downloadeopayment-b12bb1b5b64bf30067a33cd0f2fcc61bd73563b5.zip
eopayment-b12bb1b5b64bf30067a33cd0f2fcc61bd73563b5.tar.gz
eopayment-b12bb1b5b64bf30067a33cd0f2fcc61bd73563b5.tar.bz2
payfip_ws: make PAYMENT_URL overridable (#43939)v1.50
-rw-r--r--eopayment/payfip_ws.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/eopayment/payfip_ws.py b/eopayment/payfip_ws.py
index 29166d6..843ba5b 100644
--- a/eopayment/payfip_ws.py
+++ b/eopayment/payfip_ws.py
@@ -40,7 +40,7 @@ WSDL_URL = 'https://www.tipi.budget.gouv.fr/tpa/services/mas_securite/contrat_pa
SERVICE_URL = 'https://www.tipi.budget.gouv.fr/tpa/services/securite' # noqa: E501
-PAYMENT_URL = 'https://www.tipi.budget.gouv.fr/tpa/paiementws.web?idop=%s'
+PAYMENT_URL = 'https://www.tipi.budget.gouv.fr/tpa/paiementws.web'
def clear_namespace(element):
@@ -156,6 +156,13 @@ class Payment(PaymentCommon):
'validation': lambda x: x.startswith('http'),
},
{
+ 'name': 'payment_url',
+ 'default': PAYMENT_URL,
+ 'caption': _(u'PayFiP payment URL'),
+ 'help_text': _(u'do not modify if you do not know'),
+ 'validation': lambda x: x.startswith('http'),
+ },
+ {
'name': 'saisie',
'caption': _('Payment type'),
'default': 'T',
@@ -220,7 +227,7 @@ class Payment(PaymentCommon):
url_notification=urlnotif,
url_redirect=urlredirect)
- return str(idop), URL, PAYMENT_URL % idop
+ return str(idop), URL, self.payment_url + '?idop=%s' % idop
def response(self, query_string, **kwargs):
fields = parse_qs(query_string, True)
@@ -324,7 +331,7 @@ if __name__ == '__main__':
objet=objet, url_notification=url_notification,
url_redirect=url_redirect)
print('idOp:', idop)
- print(PAYMENT_URL % idop)
+ print(PAYMENT_URL + '?idop=%s' % idop)
@main.command()
@click.argument('idop', type=str)