add guess() method to dummy backend (#82921)
gitea/eopayment/pipeline/head This commit looks good
Details
gitea/eopayment/pipeline/head This commit looks good
Details
This commit is contained in:
parent
5749ee4266
commit
d69e64eb8b
|
@ -230,3 +230,9 @@ class Payment(PaymentCommon):
|
||||||
|
|
||||||
def cancel(self, amount, bank_data, **kwargs):
|
def cancel(self, amount, bank_data, **kwargs):
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def guess(self, *, method=None, query_string=None, body=None, headers=None, backends=(), **kwargs):
|
||||||
|
qs = parse_qs(force_text(query_string))
|
||||||
|
if set(qs.keys()) >= {'transaction_id', 'signed'}:
|
||||||
|
return qs['transaction_id'][0]
|
||||||
|
|
|
@ -119,6 +119,13 @@ GUESS_TEST_VECTORS = [
|
||||||
},
|
},
|
||||||
'result': ['sips2', '668930'],
|
'result': ['sips2', '668930'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'dummy',
|
||||||
|
'kwargs': {
|
||||||
|
'query_string': b'transaction_id=123&ok=1&signed=1',
|
||||||
|
},
|
||||||
|
'result': ['dummy', '123'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'notfound',
|
'name': 'notfound',
|
||||||
'kwargs': {},
|
'kwargs': {},
|
||||||
|
|
Loading…
Reference in New Issue