keyware: map more statuses (#9746)

This commit is contained in:
Benjamin Dauvergne 2020-10-11 15:39:08 +02:00
parent 26758d925f
commit 100315ee6a
1 changed files with 5 additions and 2 deletions

View File

@ -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