|
2 | 2 | from tatrapayplus.models import *
|
3 | 3 |
|
4 | 4 | client = TatrapayPlusClient(
|
5 |
| - "https://api.tatrabanka.sk/tatrapayplus/sandbox", |
6 | 5 | "your-client-id",
|
7 | 6 | "your-client-secret",
|
8 | 7 | )
|
9 | 8 |
|
10 | 9 | payment_data = InitiatePaymentRequest(
|
11 | 10 | base_payment=BasePayment(
|
12 | 11 | instructed_amount=Amount(
|
13 |
| - amount_value=120.0, |
| 12 | + amount_value=10.0, |
14 | 13 | currency="EUR",
|
15 | 14 | ),
|
16 | 15 | end_to_end="ORDER123456",
|
17 | 16 | ),
|
18 | 17 | bank_transfer=BankTransfer(),
|
| 18 | + pay_later=PayLater( |
| 19 | + order=Order( |
| 20 | + order_no="ORDER123456", |
| 21 | + order_items=[ |
| 22 | + OrderItem( |
| 23 | + quantity=1, |
| 24 | + total_item_price=10.0, |
| 25 | + item_detail=ItemDetail( |
| 26 | + item_detail_sk=ItemDetailLangUnit( |
| 27 | + item_name="Testovací produkt", |
| 28 | + item_description="Popis produktu", |
| 29 | + ), |
| 30 | + item_detail_en=ItemDetailLangUnit( |
| 31 | + item_name="Test Product", |
| 32 | + item_description="Product description", |
| 33 | + ), |
| 34 | + ), |
| 35 | + ) |
| 36 | + ], |
| 37 | + ), |
| 38 | + ), |
| 39 | + card_detail=CardDetail( |
| 40 | + card_holder="Janko Hruška", |
| 41 | + ), |
| 42 | + user_data=UserData( |
| 43 | + first_name="Janko", |
| 44 | + last_name="Hruska", |
| 45 | + email="janko.hruska@example.com", |
| 46 | + ), |
19 | 47 | )
|
20 | 48 |
|
21 |
| -response = client.create_payment(payment_data, "https://your-redirect-uri.com") |
| 49 | +response = client.create_payment(payment_data, "https://your-redirect-uri.com", "127.0.0.1") |
0 commit comments