Process payment
After completing the operations in the TatraPayPlus service, the user will be redirected to the Redirect URL provided during payment initialization.
Redirect params
Path Parameters for Redirection Without a Technical Error
| Path Parameter | Type | Required/Optional | Description |
|---|---|---|---|
paymentId | string | Required | Identifier of the payment instruction |
paymentMethod | string | Required | Code of the selected payment method |
Path Parameters for Redirection in Case of a Technical Error
| Path Parameter | Type | Required/Optional | Description |
|---|---|---|---|
paymentId | string | Required | Identifier of the payment instruction |
error | string | Required | Error code |
errorId | string | Required | Unique error identifier |
Example
Success ✔️
https://theredirecturl.com/redirect?paymentId=e43f85a2-b21f-4ec2-b0a1-0e449d6972c7&paymentMethod=CARD_PAY
Error ❌️
https://theredirecturl.com/redirect?paymentId=e43f85a2-b21f-4ec2-b0a1-0e449d6972c7&error=FAILED&errorId=43ca30ec-2956-454c-9d1b-4bd2befee7c8
Retrieve payment status
Based on received GET params you should retrieve status of payment as following:
from tatrapayplus.client import TBPlusSDK
client = TBPlusSDK(
"your-client-id",
"your-client-secret",
)
payment_id = "b54afd37-5bb9-4080-9416-5ec450779087" # Retrieved from create payment intent
payment_status = client.get_payment_status(payment_id)
- In sandbox mode, the payment status changes from
PENDINGto the target status after a short delay (usually 2–5 minutes). - In production mode, the payment status is usually already updated to the final status by the time the user is redirected. However, in some cases, it may still be
PENDINGfor a short time due to processing delays.
The result includes a simpleStatus attribute, which simplifies the status of a payment into one of the following four values:
- AUTHORIZED
- CAPTURE
- REJECTED
- PENDING
The simpleStatus is determined according to the table below. If none of the conditions match, the status defaults to PENDING.
| Payment Method | CAPTURE | REJECTED | AUTHORIZED |
|---|---|---|---|
| QR_PAY | ACCC | CANC, RJCT | |
| BANK_TRANSFER | ACSC, ACCC | CANC, RJCT | |
| PAY_LATER | LOAN_APPLICATION_FINISHED, LOAN_DISBURSED | CANCELED, EXPIRED | |
| CARD_PAY | OK, CB | FAIL | PA |
| DIRECT_API | OK, CB | FAIL |
Your implementation should take the appropriate action based on the value of simple_status.
data attribute contains all the information based on structure described in API reference.
The response also includes saved card information (if the customer chooses to save their card details). More details on this feature can be found 💳 here 💳.
Periodical task
Some payments may be processed later.
Therefore, you should periodically check the status of "pending" payments.
We recommend setting up a scheduled task that retrieves all pending payments from your system.
Using the saved payment_id with the get_payment_status method, you can obtain the current status and take the appropriate action in your system.
Recommended pooling rates based on age of orders:
| Time Range | Polling Frequency |
|---|---|
| First hour | Every 5 minutes |
| 1 hour - 24 hours | Every hour |
| After 24 hours | 5 times per day |