payfip_ws: make PAYMENT_URL overridable (#43939)
This commit is contained in:
parent
6ebcd4c674
commit
b12bb1b5b6
|
@ -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):
|
||||
|
@ -155,6 +155,13 @@ class Payment(PaymentCommon):
|
|||
'help_text': _(u'do not modify if you do not know'),
|
||||
'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'),
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue