summaryrefslogtreecommitdiffstats
path: root/eopayment
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2017-10-11 08:09:44 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2017-10-11 08:15:08 (GMT)
commitfe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff (patch)
tree0c468ee813e472b7d1d11611ec5e6681cc16be33 /eopayment
parent2d75c65935f23949f1f30cb4774bc1b6d9e080a1 (diff)
downloadeopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.zip
eopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.tar.gz
eopayment-fe53eb36dfcc1c06cf32b95c0a0fef3f5d9d67ff.tar.bz2
introduce a new "WAITING" status and use it for ogone (#19358)
Diffstat (limited to 'eopayment')
-rw-r--r--eopayment/__init__.py4
-rw-r--r--eopayment/common.py3
-rw-r--r--eopayment/ogone.py8
3 files changed, 11 insertions, 4 deletions
diff --git a/eopayment/__init__.py b/eopayment/__init__.py
index 4858f94..7a15cbc 100644
--- a/eopayment/__init__.py
+++ b/eopayment/__init__.py
@@ -3,11 +3,11 @@
import logging
from common import (URL, HTML, FORM, RECEIVED, ACCEPTED, PAID, DENIED,
- CANCELED, CANCELLED, ERROR, ResponseError, force_text)
+ CANCELED, CANCELLED, ERROR, WAITING, ResponseError, force_text)
__all__ = ['Payment', 'URL', 'HTML', 'FORM', 'SIPS',
'SYSTEMPAY', 'SPPLUS', 'TIPI', 'DUMMY', 'get_backend', 'RECEIVED', 'ACCEPTED',
-'PAID', 'DENIED', 'CANCELED', 'CANCELLED', 'ERROR', 'get_backends']
+'PAID', 'DENIED', 'CANCELED', 'CANCELLED', 'ERROR', 'WAITING', 'get_backends']
SIPS = 'sips'
SIPS2 = 'sips2'
diff --git a/eopayment/common.py b/eopayment/common.py
index 8881b43..ac37e77 100644
--- a/eopayment/common.py
+++ b/eopayment/common.py
@@ -6,7 +6,7 @@ import cgi
from datetime import date
__all__ = ['PaymentCommon', 'URL', 'HTML', 'RANDOM', 'RECEIVED', 'ACCEPTED',
- 'PAID', 'ERROR']
+ 'PAID', 'ERROR', 'WAITING']
RANDOM = random.SystemRandom()
@@ -21,6 +21,7 @@ PAID = 3
DENIED = 4
CANCELLED = 5
CANCELED = 5 # typo for backward compatibility
+WAITING = 6
ERROR = 99
# separator between order and transaction ids
diff --git a/eopayment/ogone.py b/eopayment/ogone.py
index 649e10c..d5e46ea 100644
--- a/eopayment/ogone.py
+++ b/eopayment/ogone.py
@@ -6,7 +6,7 @@ from decimal import Decimal, ROUND_HALF_UP
from common import (PaymentCommon, PaymentResponse, FORM, CANCELLED, PAID,
ERROR, Form, DENIED, ACCEPTED, ORDERID_TRANSACTION_SEPARATOR,
- ResponseError, force_byte, force_text)
+ WAITING, ResponseError, force_byte, force_text)
def N_(message): return message
ENVIRONMENT_TEST = 'TEST'
@@ -560,6 +560,12 @@ class Payment(PaymentCommon):
result = ACCEPTED
elif status == '9':
result = PAID
+ elif len(status) == 2 and status[1] == '1':
+ # Statuses with two digits represent either ‘intermediary'
+ # situations or abnormal events. When the second digit is:
+ # 1, this means the payment processing is on hold. (e.g.
+ # status 91: payment waiting/pending)
+ result = WAITING
else:
self.logger.error('response STATUS=%s NCERROR=%s NCERRORPLUS=%s',
status, error, params.get('NCERRORPLUS', ''))