summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Deniaud <vdeniaud@entrouvert.com>2020-05-19 09:44:14 (GMT)
committerValentin Deniaud <vdeniaud@entrouvert.com>2020-05-19 12:59:10 (GMT)
commitab3d0d150694aa6415e833562c996186767de55e (patch)
tree9bbf8a50302864018beba93adef528a5dbd6771d
parentbc7bdd12084887a96853536a05fc85ab4d246244 (diff)
downloadeopayment-ab3d0d150694aa6415e833562c996186767de55e.zip
eopayment-ab3d0d150694aa6415e833562c996186767de55e.tar.gz
eopayment-ab3d0d150694aa6415e833562c996186767de55e.tar.bz2
systempayv2: do not rely on outside scope for validation (#43030)
-rw-r--r--eopayment/systempayv2.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py
index 49ff6fb..91a56b9 100644
--- a/eopayment/systempayv2.py
+++ b/eopayment/systempayv2.py
@@ -284,9 +284,15 @@ class Payment(PaymentCommon):
'vads_order_info2', 'vads_order_info3',
'vads_payment_cards', 'vads_payment_config', 'capture_day'):
parameter = PARAMETER_MAP[name]
+
+ def check_value(parameter):
+ def validate(value):
+ return parameter.check_value(value)
+ return validate
+
x = {'name': name,
'caption': parameter.description or name,
- 'validation': lambda value: parameter.check_value(value),
+ 'validation': check_value(parameter),
'default': parameter.default,
'required': parameter.needed,
'help_text': parameter.help_text,