sips2: set statementReference with custom info or order id (#14454)
This commit is contained in:
parent
6ebbb5aa9d
commit
e8d556e5b2
|
@ -174,6 +174,10 @@ class Payment(PaymentCommon):
|
|||
transaction_id = self.transaction_id(6, string.digits, 'sips2', data['merchantId'])
|
||||
data['transactionReference'] = unicode(transaction_id)
|
||||
data['orderId'] = orderid or unicode(uuid.uuid4()).replace('-', '')
|
||||
if info1:
|
||||
data['statementReference'] = unicode(info1)
|
||||
else:
|
||||
data['statementReference'] = data['transactionReference']
|
||||
data['amount'] = unicode(int(Decimal(amount) * 100))
|
||||
if email:
|
||||
data['billingContact.email'] = email
|
||||
|
|
|
@ -9,6 +9,14 @@ def test_build_request():
|
|||
data = [f for f in form.fields if f['name'] == 'Data']
|
||||
assert not u'lix000000' in data[0]['value']
|
||||
|
||||
transaction, f, form = backend.request(amount=u'12')
|
||||
data = [f for f in form.fields if f['name'] == 'Data']
|
||||
assert 'statementReference=%s' % transaction in data[0]['value']
|
||||
|
||||
transaction, f, form = backend.request(amount=u'12', info1='foobar')
|
||||
data = [f for f in form.fields if f['name'] == 'Data']
|
||||
assert 'statementReference=foobar' in data[0]['value']
|
||||
|
||||
def test_options():
|
||||
payment = eopayment.Payment('sips2', {'capture_mode': u'VALIDATION'})
|
||||
assert payment.backend.get_data()['captureMode'] == 'VALIDATION'
|
||||
|
|
Loading…
Reference in New Issue