tipi: confound order_id/transaction_id with refdet (#36322)
TIPI has no concept of a transaction_id and our main user (lingo application in combo) use only order_id. PaymentResponse documentation should be changed to deprecate transaction_id, and first return value of .request() should be renamed order_id to make things understandable as with all backend what you get in PaymentResponse.order_id is what is returned by backend.request()[0].
This commit is contained in:
parent
4153a0e597
commit
d7889675b7
|
@ -161,8 +161,8 @@ class Payment(PaymentCommon):
|
||||||
raise ResponseError('missing refdet or resultrans')
|
raise ResponseError('missing refdet or resultrans')
|
||||||
for key, value in fields.items():
|
for key, value in fields.items():
|
||||||
fields[key] = value[0]
|
fields[key] = value[0]
|
||||||
transaction_id = fields.get('refdet')
|
refdet = fields.get('refdet')
|
||||||
if transaction_id is None:
|
if refdet is None:
|
||||||
raise ResponseError('refdet is missing')
|
raise ResponseError('refdet is missing')
|
||||||
|
|
||||||
result = fields.get('resultrans')
|
result = fields.get('resultrans')
|
||||||
|
@ -186,5 +186,6 @@ class Payment(PaymentCommon):
|
||||||
bank_status=bank_status,
|
bank_status=bank_status,
|
||||||
signed=True,
|
signed=True,
|
||||||
bank_data=fields,
|
bank_data=fields,
|
||||||
transaction_id=transaction_id,
|
order_id=refdet,
|
||||||
|
transaction_id=refdet,
|
||||||
test=test)
|
test=test)
|
||||||
|
|
|
@ -31,6 +31,8 @@ def test_tipi():
|
||||||
'objet=tout+a+fait&montant=12312&saisie=T&mel=info%40entrouvert.com'
|
'objet=tout+a+fait&montant=12312&saisie=T&mel=info%40entrouvert.com'
|
||||||
'&numcli=12345&exer=9999&refdet=999900000000999999&resultrans=P')
|
'&numcli=12345&exer=9999&refdet=999900000000999999&resultrans=P')
|
||||||
assert response.signed # ...
|
assert response.signed # ...
|
||||||
|
assert response.order_id == '999900000000999999'
|
||||||
|
assert response.transaction_id == '999900000000999999'
|
||||||
assert response.result == eopayment.PAID
|
assert response.result == eopayment.PAID
|
||||||
|
|
||||||
with pytest.raises(eopayment.ResponseError, match='missing refdet or resultrans'):
|
with pytest.raises(eopayment.ResponseError, match='missing refdet or resultrans'):
|
||||||
|
|
Loading…
Reference in New Issue