summaryrefslogtreecommitdiffstats
path: root/eopayment/paybox.py
diff options
context:
space:
mode:
Diffstat (limited to 'eopayment/paybox.py')
-rw-r--r--eopayment/paybox.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/eopayment/paybox.py b/eopayment/paybox.py
index d5cd6ce..ec4d479 100644
--- a/eopayment/paybox.py
+++ b/eopayment/paybox.py
@@ -113,6 +113,10 @@ PAYBOX_DIRECT_VERSION_NUMBER = '00104'
PAYBOX_DIRECT_SUCCESS_RESPONSE_CODE = '00000'
+# payment modes
+PAYMENT_MODES = {'AUTHOR_CAPTURE': 'O',
+ 'IMMEDIATE': 'N'}
+
def sign(data, key):
'''Take a list of tuple key, value and sign it by building a string to
@@ -236,6 +240,13 @@ class Payment(PaymentCommon):
'validation': lambda x: isinstance(x, basestring) and
x.isdigit() and (1 <= len(x) <= 2)
},
+ {
+ 'name': 'capture_mode',
+ 'caption': _('Capture Mode'),
+ 'default': 'IMMEDIATE',
+ 'required': False,
+ 'choices': PAYMENT_MODES.keys()
+ },
]
}
@@ -270,6 +281,7 @@ class Payment(PaymentCommon):
automatic_return_url = self.callback
if self.capture_day:
d['PBX_DIFF'] = self.capture_day.zfill(2)
+ d['PBX_AUTOSEULE'] = PAYMENT_MODES[self.capture_mode]
if automatic_return_url:
d['PBX_REPONDRE_A'] = force_text(automatic_return_url)
d = d.items()