Tpay

Tpay integration through the Open API

A Tpay integration from VulCode brings Tpay (a Polish payment operator) payments into stores, apps and platforms with many sellers through the Open API: transfers, BLIK (Poland's mobile payment method) on your own page or without a code, cards and refunds. It costs from PLN 999 (about EUR 220) and usually takes 2-3 days. We verify the JWS signature on every notification, so payment statuses can be trusted.

What a Tpay integration is made of

From the checkout form to booking the payment. Every layer has its job and its test.

  1. 1Checkout and form

    method choiceBLIK code fieldrecurring consent

  2. 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.

  3. 3Tpay

    payment page or BLIK Level 0bank authorisationsettlement

  4. 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.

  5. 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 pageOne Clickan alias instead of a code
Where the code is entered on the Tpay formin your formonly on the first payment
Field in the request groupId 150blikToken with the codethe user alias
Customer stays in the store NoYesYes
Later purchases without a code NoNoYes
Good for the simplest startphone purchasesstores 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.

  1. 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.

  2. 02 partial refund

    The Tpay transaction status does not change, even when partial refunds reach 100%. Your system counts the refunded amount.

  3. 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.

CustomerYour platformTpay
Your platform → Tpay
GET /accounts and /accounts/pos

Seller and point-of-sale ids, stored on the platform side

Customer → Your platform
A cart from several sellers
Your platform → Tpay
POST /marketplace/v1/transaction

A parent transaction with child transactions for sellers

Customer → Tpay
Payment
Tpay → Your platform
Paid notification

With the value the platform gave the transaction, such as the order number

Your platform → Your platform
Totals checked on the platform side

Tpay does not compare child amounts with product prices, so your code does

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.

  1. 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.

  2. 02

    Redirect to transactionPaymentUrl

    The payment address comes back when the transaction is created. We never build it ourselves.

  3. 03

    BLIK after the time runs out

    A code lives 2 minutes. We check the customer message and the retry path.

  4. 04

    The JWS signature on every notification

    With no IP list, the signature is the only proof a notification came from Tpay.

  5. 05

    A repeated notification

    A second notice about the same payment must not activate a service or ship a parcel twice.

  6. 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?
Yes, with Level 0. They type the code in your form and you pass it to Tpay in the blikToken field.
How long does it take?
Usually 2-3 days. The exact dated schedule comes with the free quote, and if anything is going to move, you know in advance.
How much does a Tpay integration cost?
A Tpay integration costs from PLN 999 (about EUR 220) for a payment with a redirect, under our API and integrations service, and usually takes 2-3 days. BLIK Level 0, One Click, refunds from the panel and marketplace raise the price. You pay the transaction commission to Tpay. The quote is free and comes back within an hour.
Can you handle recurring BLIK payments?
Yes, Tpay lets you invite the customer to recurring payments during a Level 0 payment. We cover details and limits on our BLIK page.
Can we build a marketplace with many sellers?
Yes, through the Tpay marketplace. It requires the Partner Programme and a separate agreement with Tpay, which you arrange.
Why not filter notifications by IP?
Because Tpay publishes no address list; the addresses are dynamic. Instead we check the JWS signature of every notification.
Will the Tpay integration code be mine?
Yes. Once the work is accepted and paid in full, the economic copyright in the Tpay integration code passes to you and you get the repository with run instructions. Open source libraries keep their own licences.
How do you check a Tpay integration before launch?
On the Tpay sandbox. We run a payment, an error, a notification with a JWS signature and a full and a partial refund, and only then switch the integration on in production.
What if the Tpay integration stops working?
The integration logs every operation and retries the ones that failed by itself. When the problem does not go away you get a notification, and bugs that come from our work are fixed free of charge within the 90 days of support after launch.
What if Tpay changes its API?
We adjust the integration to Tpay's changes: within the 90 days of support included after launch, later under a maintenance plan or as a separate short order. We follow Tpay's change notices and tell you in advance what needs fixing.

Sources

Technical details come from the Tpay Open API documentation.

Describe your project.

A free quote comes back within an hour during working hours.