diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py index 45f5bfd..6df7c89 100644 --- a/eopayment/systempayv2.py +++ b/eopayment/systempayv2.py @@ -92,6 +92,7 @@ class Parameter: choices=None, description=None, help_text=None, + scope='global', ): self.name = name self.ptype = ptype @@ -103,6 +104,7 @@ class Parameter: self.choices = choices self.description = description self.help_text = help_text + self.scope = scope def check_value(self, value): if self.length and len(value) != self.length: @@ -152,9 +154,30 @@ PARAMETERS = [ # ISO 639 code Parameter('vads_language', 'a', 12, length=2, default='fr'), Parameter('vads_order_id', 'an-', 13, max_length=32), - Parameter('vads_order_info', 'an', 14, max_length=255, description="Complément d'information 1"), - Parameter('vads_order_info2', 'an', 14, max_length=255, description="Complément d'information 2"), - Parameter('vads_order_info3', 'an', 14, max_length=255, description="Complément d'information 3"), + Parameter( + 'vads_order_info', + 'an', + 14, + max_length=255, + description="Complément d'information 1", + scope='transaction', + ), + Parameter( + 'vads_order_info2', + 'an', + 14, + max_length=255, + description="Complément d'information 2", + scope='transaction', + ), + Parameter( + 'vads_order_info3', + 'an', + 14, + max_length=255, + description="Complément d'information 3", + scope='transaction', + ), Parameter('vads_page_action', None, 46, needed=True, default='PAYMENT', choices=('PAYMENT',)), Parameter( 'vads_payment_cards', @@ -168,6 +191,7 @@ PARAMETERS = [ 'E-CARTEBLEUE, MASTERCARD, JCB, MAESTRO, ONEY, ' 'ONEY_SANDBOX, PAYPAL, PAYPAL_SB, PAYSAFECARD, ' 'VISA', + scope='transaction', ), # must be SINGLE or MULTI with parameters Parameter('vads_payment_config', '', 7, default='SINGLE', choices=('SINGLE', 'MULTI'), needed=True), @@ -320,6 +344,7 @@ class Payment(PaymentCommon): 'required': parameter.needed, 'help_text': parameter.help_text, 'max_length': parameter.max_length, + 'scope': parameter.scope, } description['parameters'].append(x)