0001-paybox-handle-CANCELLED-and-DENIED-situations-9746.patch
eopayment/paybox.py | ||
---|---|---|
35 | 35 | |
36 | 36 |
import base64 |
37 | 37 |
from gettext import gettext as _ |
38 |
import string |
|
39 | 38 |
import warnings |
40 | 39 | |
41 |
from .common import (PaymentCommon, PaymentResponse, FORM, PAID, ERROR, Form,
|
|
42 |
ORDERID_TRANSACTION_SEPARATOR, ResponseError, force_text,
|
|
40 |
from .common import (PaymentCommon, PaymentResponse, FORM, PAID, CANCELLED,
|
|
41 |
DENIED, ERROR, Form, ResponseError, force_text,
|
|
43 | 42 |
force_byte) |
44 | 43 | |
45 | 44 |
__all__ = ['sign', 'Payment'] |
... | ... | |
368 | 367 |
data.append('%s=%s' % (key, urllib.quote(value))) |
369 | 368 |
data = '&'.join(data) |
370 | 369 |
signed = verify(data, sig) |
371 |
if d['erreur'][0] == '00000': |
|
370 |
erreur = d['erreur'][0] |
|
371 |
if erreur == '00000': |
|
372 | 372 |
result = PAID |
373 |
elif erreur == '00117': |
|
374 |
result = CANCELLED |
|
375 |
elif erreur[:3] == '001' and 0 < int(erreur[3:5]) < 100: |
|
376 |
result = DENIED |
|
373 | 377 |
else: |
374 | 378 |
result = ERROR |
375 | 379 |
for l in (5, 3): |
376 |
- |