summaryrefslogtreecommitdiffstats
path: root/eopayment/systempayv2.py
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-29 14:54:49 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-05-29 14:55:55 (GMT)
commitb3254d60f472ddf80c07886c3026e2a6b13d7009 (patch)
treebbffe3657d547a01fab171c42bc1ee6ed61ac411 /eopayment/systempayv2.py
parente8e31d6f4df826fcc8b679ca41773cc81c3d72aa (diff)
downloadeopayment-b3254d60f472ddf80c07886c3026e2a6b13d7009.zip
eopayment-b3254d60f472ddf80c07886c3026e2a6b13d7009.tar.gz
eopayment-b3254d60f472ddf80c07886c3026e2a6b13d7009.tar.bz2
properly initialize PaymentResponse.result attribute
Diffstat (limited to 'eopayment/systempayv2.py')
-rw-r--r--eopayment/systempayv2.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py
index 2ebdfcf..7b5f0ae 100644
--- a/eopayment/systempayv2.py
+++ b/eopayment/systempayv2.py
@@ -9,7 +9,7 @@ import urllib
from decimal import Decimal
from gettext import gettext as _
-from common import PaymentCommon, PaymentResponse, URL
+from common import PaymentCommon, PaymentResponse, URL, PAID, ERROR
from cb import CB_RESPONSE_CODES
__all__ = ['Payment']
@@ -329,7 +329,11 @@ class Payment(PaymentCommon):
fields[SIGNATURE])
if not signature_result:
bank_status.append('invalid signature')
- result = fields[VADS_AUTH_RESULT] == '00'
+
+ if fields[VADS_AUTH_RESULT] == '00':
+ result = PAID
+ else:
+ result = ERROR
transaction_id = '%s_%s' % (copy[VADS_TRANS_DATE], copy[VADS_TRANS_ID])
# the VADS_AUTH_NUMBER is the number to match payment in bank logs
copy[self.BANK_ID] = copy.get(VADS_AUTH_NUMBER, '')