What a Tpay integration is made of
From the checkout form to booking the payment. Every layer has its job and its test.
-
1Checkout and form
method choiceBLIK code fieldrecurring consent
-
2Your server
OAuth tokenPOST /transactionstransaction stored on the order
The client_id and client_secret live in environment variables, never in code, as the documentation advises.
-
3Tpay
payment page or BLIK Level 0bank authorisationsettlement
-
4Notifications
JWS signature in X-JWS-Signaturecertificate checked against the Tpay root CA
Tpay publishes no IP list, because the addresses are dynamic. The signature is the only safeguard, so checking it is mandatory.
-
5The order
status paidrefundsevent log
Before we start
- You open the Tpay account and sandbox access as the merchant.
- If the store runs on a popular platform, Tpay has a ready plugin for it and we start there.
- Marketplace needs the Tpay Partner Programme and a separate agreement, so we settle that first.
Three ways to take BLIK with Tpay
BLIK can redirect the customer, stay on your page or remember the store for next time.
| With a redirectthe eBLIK form (Tpay's BLIK payment form) | Level 0code on your page | One Clickan alias instead of a code | |
|---|---|---|---|
| Where the code is entered | on the Tpay form | in your form | only on the first payment |
| Field in the request | groupId 150 | blikToken with the code | the user alias |
| Customer stays in the store | No | Yes | Yes |
| Later purchases without a code | No | No | Yes |
| Good for | the simplest start | phone purchases | stores and apps with accounts |
A BLIK code is valid for 2 minutes. We design the messages for a customer who does not confirm in time around that.
Refunds: the status trap
Full and partial refunds behave differently in Tpay. Your panel has to add refunds up itself, not just read the transaction status.
- 01 paid
The transaction is booked, the order is being fulfilled.
- balance too low insufficient funds
A refund only goes through when the account balance covers the amount and fee. The panel shows this up front.
- balance too low insufficient funds
- 02 partial refund
The Tpay transaction status does not change, even when partial refunds reach 100%. Your system counts the refunded amount.
- 03 refund
The status after a full refund. We close the order as refunded.
A payment in the Tpay marketplace
One customer payment for products from several sellers. This is the flow in the marketplace API.
- The precondition
- The marketplace only works within the Tpay Partner Programme and after a separate agreement.
- Identifiers
- Sellers and points of sale have ULID ids encoded in base32. We store them with the seller accounts.
05
Checklist before going live
What we check on the Tpay sandbox before you take the first real payment.
- 01
The payment path
The OAuth token and its renewal
By default a token lives 2 hours. The module renews it before it expires instead of waiting for an error.
- 02
Redirect to transactionPaymentUrl
The payment address comes back when the transaction is created. We never build it ourselves.
- 03
BLIK after the time runs out
A code lives 2 minutes. We check the customer message and the retry path.
- 04
The JWS signature on every notification
With no IP list, the signature is the only proof a notification came from Tpay.
- 05
A repeated notification
A second notice about the same payment must not activate a service or ship a parcel twice.
- 06
The partial refund counter
The Tpay status does not say how much was refunded, so the panel counts it.
Who does what
The Tpay agreement is on your side, the code on ours and settlement on the gateway's.
All items by role
- You The Tpay account, the agreement and sandbox access.
- VulCode Transactions, BLIK, notifications and refunds in your code.
- Tpay Payment methods and settlement.
- You For a marketplace: joining the Partner Programme.
- VulCode JWS verification and handling of repeated notifications.
- Tpay Turning on the marketplace once the agreement is signed.
- You Signing off the payment path on the test version.
- VulCode Payment statuses and history in your panel.
- Tpay The certificates it signs notifications with.
Common questions about Tpay
The main questions about Tpay: BLIK, recurring payments, marketplace, cost and code.
Can a customer pay by BLIK without leaving the store?
How long does it take?
How much does a Tpay integration cost?
Can you handle recurring BLIK payments?
Can we build a marketplace with many sellers?
Why not filter notifications by IP?
Will the Tpay integration code be mine?
How do you check a Tpay integration before launch?
What if the Tpay integration stops working?
What if Tpay changes its API?
Sources
Technical details come from the Tpay Open API documentation.
Describe your project.
A free quote comes back within an hour during working hours.