systempayv2: allos spaces in user first and last names (#13834)
This commit is contained in:
parent
11ba668f42
commit
ea7e051c9e
|
@ -140,8 +140,8 @@ PARAMETERS = [
|
|||
Parameter('vads_url_return', 'ans', 28, max_length=127),
|
||||
Parameter('vads_user_info', 'ans', 61, max_length=255),
|
||||
Parameter('vads_contracts', 'ans', 62, max_length=255),
|
||||
Parameter(VADS_CUST_FIRST_NAME, 'an', 104, max_length=63),
|
||||
Parameter(VADS_CUST_LAST_NAME, 'an', 104, max_length=63),
|
||||
Parameter(VADS_CUST_FIRST_NAME, 'ans', 104, max_length=63),
|
||||
Parameter(VADS_CUST_LAST_NAME, 'ans', 104, max_length=63),
|
||||
]
|
||||
PARAMETER_MAP = dict(((parameter.name,
|
||||
parameter) for parameter in PARAMETERS))
|
||||
|
|
|
@ -15,23 +15,23 @@ PARAMS = {
|
|||
def test_systempayv2():
|
||||
p = Payment(PARAMS)
|
||||
data = {'amount': 15.24, 'orderid': '654321',
|
||||
'first_name': u'Sergheï',
|
||||
'first_name': u'Jean Michél',
|
||||
'last_name': u'Mihaï'
|
||||
}
|
||||
qs = 'vads_version=V2&vads_page_action=PAYMENT&vads_action_mode=INTERACTIV' \
|
||||
'E&vads_payment_config=SINGLE&vads_site_id=12345678&vads_ctx_mode=TES' \
|
||||
'T&vads_trans_id=654321&vads_trans_date=20090501193530&vads_amount=15' \
|
||||
'24&vads_currency=978&vads_cust_first_name=Sergheï&vads_cust_last_name=Mihaï'
|
||||
'24&vads_currency=978&vads_cust_first_name=Jean+Mich%C3%A9l&vads_cust_last_name=Mihaï'
|
||||
qs = urlparse.parse_qs(qs)
|
||||
for key in qs.keys():
|
||||
qs[key] = qs[key][0]
|
||||
assert p.signature(qs) == '4d2010d3b4566841ee0b0b2c74b6650bce65365e'
|
||||
assert p.signature(qs) == 'cf1ccac335590a33d6c243345c4f4531a0316b7f'
|
||||
transaction_id, f, form = p.request(**data)
|
||||
|
||||
# check that user first and last names are unicode
|
||||
for field in form.fields:
|
||||
if field['name'] in (VADS_CUST_FIRST_NAME, VADS_CUST_LAST_NAME):
|
||||
assert field['value'] in (u'Sergheï', u'Mihaï')
|
||||
assert field['value'] in (u'Jean Michél', u'Mihaï')
|
||||
|
||||
response_qs = 'vads_amount=1042&vads_auth_mode=FULL&vads_auth_number=3feadf' \
|
||||
'&vads_auth_result=00&vads_capture_delay=0&vads_card_brand=CB' \
|
||||
|
|
Loading…
Reference in New Issue