summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-10-11 13:39:08 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2020-10-12 13:58:44 (GMT)
commit100315ee6a6c68e060e07a144f938b425e7f8437 (patch)
tree6d759a0b803884fb48afc039f205493b6f3ca18e
parent26758d925fc195f693d583be676277b65a10808e (diff)
downloadeopayment-100315ee6a6c68e060e07a144f938b425e7f8437.zip
eopayment-100315ee6a6c68e060e07a144f938b425e7f8437.tar.gz
eopayment-100315ee6a6c68e060e07a144f938b425e7f8437.tar.bz2
keyware: map more statuses (#9746)
-rw-r--r--eopayment/keyware.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/eopayment/keyware.py b/eopayment/keyware.py
index 6a41337..6a4ff1f 100644
--- a/eopayment/keyware.py
+++ b/eopayment/keyware.py
@@ -80,12 +80,15 @@ class Payment(PaymentCommon):
order_id = fields['order_id'][0]
resp = self.call_endpoint('GET', 'orders/' + order_id)
+ # XXX: to add accepted we need to handle the capture mode (manual or
+ # delayed), see
+ # https://dev.online.emspay.eu/rest-api/features/authorizations-captures-and-voiding
status = resp['status']
if status == 'completed':
result = PAID
- elif status == 'processing':
+ elif status in ('new', 'processing'):
result = WAITING
- elif status == 'cancelled':
+ elif status in ('cancelled', 'expired'):
result = CANCELLED
else:
result = ERROR