From 100315ee6a6c68e060e07a144f938b425e7f8437 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sun, 11 Oct 2020 15:39:08 +0200 Subject: [PATCH] keyware: map more statuses (#9746) --- eopayment/keyware.py | 7 +++++-- 1 file 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