summaryrefslogtreecommitdiffstats
path: root/eopayment/systempayv2.py
diff options
context:
space:
mode:
authorEmmanuel Cazenave <ecazenave@entrouvert.com>2018-10-12 13:35:23 (GMT)
committerEmmanuel Cazenave <ecazenave@entrouvert.com>2018-11-12 14:18:10 (GMT)
commit980ab967ba9eb3ddbb67f10b0cc574c4a12bdb47 (patch)
treea71290ca48bb82c0c597df9034d4de0496ec059a /eopayment/systempayv2.py
parentd383315b34639421d6ef29dcdb603c41f07dde28 (diff)
downloadeopayment-980ab967ba9eb3ddbb67f10b0cc574c4a12bdb47.zip
eopayment-980ab967ba9eb3ddbb67f10b0cc574c4a12bdb47.tar.gz
eopayment-980ab967ba9eb3ddbb67f10b0cc574c4a12bdb47.tar.bz2
allow arbitrary date for deferred payment (#26992)
Diffstat (limited to 'eopayment/systempayv2.py')
-rw-r--r--eopayment/systempayv2.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py
index 201cb2c..31731fd 100644
--- a/eopayment/systempayv2.py
+++ b/eopayment/systempayv2.py
@@ -82,6 +82,9 @@ PARAMETERS = [
choices=('SILENT', 'INTERACTIVE')),
Parameter('vads_amount', 'n', 9, max_length=12, needed=True),
Parameter('vads_capture_delay', 'n', 6, max_length=3, default=''),
+ # Same as 'vads_capture_delay' but matches other backend naming for
+ # deferred payment
+ Parameter('capture_day', 'n', 6, max_length=3, default=''),
Parameter('vads_contrib', 'ans', 31, max_length=255, default='eopayment'),
# defaut currency = EURO, norme ISO4217
Parameter('vads_currency', 'n', 10, length=3, default='978', needed=True),
@@ -248,7 +251,7 @@ class Payment(PaymentCommon):
for name in ('vads_ctx_mode', VADS_SITE_ID, 'vads_order_info',
'vads_order_info2', 'vads_order_info3',
- 'vads_payment_cards', 'vads_payment_config'):
+ 'vads_payment_cards', 'vads_payment_config', 'capture_day'):
parameter = PARAMETER_MAP[name]
x = {'name': name,
'caption': parameter.description or name,
@@ -332,6 +335,9 @@ class Payment(PaymentCommon):
fields[name] = parameter.default()
else:
fields[name] = parameter.default
+ capture_day = fields.pop('capture_day')
+ if capture_day:
+ fields['vads_capture_delay'] = capture_day
check_vads(fields)
fields[SIGNATURE] = force_text(self.signature(fields))
self.logger.debug('%s request contains fields: %s', __name__, fields)