summaryrefslogtreecommitdiffstats
path: root/eopayment/systempayv2.py
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2016-02-08 17:40:45 (GMT)
committerSerghei Mihai <smihai@entrouvert.com>2016-02-16 14:56:56 (GMT)
commit8cd625e4651ededa92d888c31d64fafa578f2a9e (patch)
tree7f2a10d67c73a9c4763a4f8868bf2a2e5031b238 /eopayment/systempayv2.py
parent33ba732c91f08a3a2cfea7ebe8e277c6cd7881cb (diff)
downloadeopayment-8cd625e4651ededa92d888c31d64fafa578f2a9e.zip
eopayment-8cd625e4651ededa92d888c31d64fafa578f2a9e.tar.gz
eopayment-8cd625e4651ededa92d888c31d64fafa578f2a9e.tar.bz2
pass order id to all backends (#9941)
Diffstat (limited to 'eopayment/systempayv2.py')
-rw-r--r--eopayment/systempayv2.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py
index f975b16..90bb822 100644
--- a/eopayment/systempayv2.py
+++ b/eopayment/systempayv2.py
@@ -252,7 +252,8 @@ class Payment(PaymentCommon):
self.logger = logger or logging.getLogger(__name__)
def request(self, amount, name=None, address=None, email=None, phone=None,
- info1=None, info2=None, info3=None, next_url=None, **kwargs):
+ orderid=None, info1=None, info2=None, info3=None,
+ next_url=None, **kwargs):
'''
Create the URL string to send a request to SystemPay
'''
@@ -281,6 +282,16 @@ class Payment(PaymentCommon):
kwargs['vads_order_info2'] = unicode(info2)
if info3 is not None:
kwargs['vads_order_info3'] = unicode(info3)
+ if orderid is not None:
+ # check orderid format first
+ name = 'vads_order_id'
+ orderid = unicode(orderid)
+ ptype = 'an-'
+ p = Parameter(name, ptype, 13, max_length=32)
+ if not p.check_value(orderid):
+ raise ValueError('%s value %s is not of the type %s' % (name,
+ orderid, ptype))
+ kwargs[name] = orderid
transaction_id = self.transaction_id(6, string.digits, 'systempay',
self.options[VADS_SITE_ID])