0003-lingo-pass-reference_id-to-eopayment-as-orderid-for-.patch
combo/apps/lingo/views.py | ||
---|---|---|
417 | 417 | |
418 | 418 |
item = (items or remote_items)[0] |
419 | 419 |
kwargs['subject'] = item.subject |
420 | ||
421 |
# merchant command reference, handling by different backends : |
|
422 |
# |
|
423 |
# dummy : in the 'orderid' query-string field, free format |
|
424 |
# |
|
425 |
# paybox: prefix of the PBX_CMD form field, free format, |
|
426 |
# separated from the transaction_id by '|' |
|
427 |
# |
|
428 |
# payzen,systempayv2: in the vads_order_id, format is alphan-numeric + '-', |
|
429 |
# could be 9-character alpha numeric form some systempayv2 |
|
430 |
# backends |
|
431 |
# |
|
432 |
# tipi/payfip_ws: ignored, use exer/refdet instead |
|
433 |
# |
|
434 |
# sips2: in the Data form field, encoded as |orderId=<value>| |
|
435 |
# |
|
436 |
# ogone: prefix of the ORDERID form field, separated from the transaction_id reference by '|' |
|
437 |
# |
|
438 |
# mollie,keyware: ignored |
|
439 |
if item.reference_id: |
|
440 |
kwargs['orderid'] = item.reference_id |
|
441 | ||
420 | 442 |
# allow easy testing/use of backend specific keyword arguments |
421 | 443 |
EOPAYMENT_REQUEST_KWARGS_PREFIX = 'eopayment_request_kwargs_' |
422 | 444 |
if hasattr(item, 'request_data'): |
tests/test_lingo_payment.py | ||
---|---|---|
1556 | 1556 | |
1557 | 1557 | |
1558 | 1558 |
def test_successfull_items_can_pay_only_one_basket_item(app, basket_page, mono_regie, user): |
1559 |
item = BasketItem.objects.create(user=user, regie=mono_regie, amount=42, subject='foo item') |
|
1559 |
item = BasketItem.objects.create(user=user, regie=mono_regie, amount=42, subject='foo item', |
|
1560 |
reference_id='form-3-23') |
|
1560 | 1561 |
BasketItem.objects.create(user=user, regie=mono_regie, amount=84, subject='bar item') |
1561 | 1562 | |
1562 | 1563 |
resp = login(app).get('/test_basket_cell/') |
... | ... | |
1568 | 1569 |
# successful payment |
1569 | 1570 |
qs = urlparse.parse_qs(urlparse.urlparse(resp.location).query) |
1570 | 1571 |
assert qs['subject'][0] == 'foo item', 'item.subject was not provided to eopayment' |
1572 |
assert qs['orderid'][0] == 'form-3-23' |
|
1571 | 1573 |
args = {'transaction_id': qs['transaction_id'][0], 'signed': True, 'ok': True, 'reason': 'Paid'} |
1572 | 1574 |
with mock.patch('combo.utils.requests_wrapper.RequestsSession.request'): |
1573 | 1575 |
resp = app.get(get_url(True, 'lingo-callback', mono_regie), params=args) |
1574 |
- |