How we build a PayU integration
A new PayU integration always means REST API 2.1 and OAuth tokens. The older Classic protocol is no longer open to new integrations.
Every request to PayU carries an OAuth token issued for a point of sale. The token type depends on the scenario: client_credentials for a plain payment, trusted_merchant for a signed-in customer with saved cards, partner for companies in the partner programme.
If you sell on a platform PayU has a plugin for, start there. Your own integration makes sense in a panel, app or booking system, or where you want BLIK or a card on your own page with no redirect. The wider gateway comparison is on our online payments page.
- A token with a lifetime
- The OAuth response gives a lifetime in seconds. We cache the token and renew it before it expires.
- A separate sandbox
- The test environment needs its own sign-up. A public test point of sale covers the first tries.
- Amounts in grosze (1/100 PLN)
- Amounts are sent in grosze (1/100 PLN): 1000 means PLN 10.00. For HUF, amounts are sent in whole forints.
From the cart to a paid order
The simplest flow, with a redirect to the PayU payment page.
- Your server connects with the point of sale's key creates the order
- The order in PayU amount, products, the notification address and the return page the payment link
- Payment page the customer picks a method and pays status change
- Notification signed, sent to the address given in the order receipt confirmed
- Status in your system after checking the signature and amount
- When it works
- COMPLETED: fulfil the order
- When it fails
- CANCELED: the customer was not charged
- Confirmed or resent
- PayU waits for your server to confirm it got the notification. Without that it sends it again on its schedule, so no payment is lost.
- Paid stays paid
- Once a payment is accepted (COMPLETED), further notifications about the same order no longer change its state.
PayU payment statuses
The four PayU statuses from the documentation and what your system does with each.
- 01 PENDING
The payment is being processed. The order waits, nothing ships.
- 02 WAITING_FOR_CONFIRMATION
Appears when auto-capture is off. Your system has to capture or cancel the payment.
- DELETE, or not captured in time CANCELED
Cancelled, the buyer was not charged. The order goes back to payment or expires.
- DELETE, or not captured in time CANCELED
- 03 COMPLETED
Payment accepted. We start fulfilment and ignore further notices about this order.
- POST .../refunds refund
A full or partial refund from your panel. Refunds cannot add up to more than the order.
- POST .../refunds refund
How long PayU keeps resending notifications
When your server does not confirm a notification, PayU sends it again. The schedule spans three days.
[
{
"Attempts": "1 to 6","Resent after": "immediately, 1, 2, 5, 10 and 30 minutes","What our module does": "A short server outage loses no payment; the queue takes the notice on the next attempt."
},
{
"Attempts": "7 to 12","Resent after": "1, 2, 3, 6, 9 and 12 hours","What our module does": "Monitoring flags the unresponsive notification address before a customer notices."
},
{
"Attempts": "13 to 20","Resent after": "15, 18, 21, 24, 36, 48, 60 and 72 hours","What our module does": "Orders without confirmation go on a list, and we check them by fetching the transaction data straight from PayU."
}
] Attempts 3
- 1 to 6 Resent after immediately, 1, 2, 5, 10 and 30 minutes What our module does A short server outage loses no payment; the queue takes the notice on the next attempt.
- 7 to 12 Resent after 1, 2, 3, 6, 9 and 12 hours What our module does Monitoring flags the unresponsive notification address before a customer notices.
- 13 to 20 Resent after 15, 18, 21, 24, 36, 48, 60 and 72 hours What our module does Orders without confirmation go on a list, and we check them by fetching the transaction data straight from PayU.
Four ways to take payment through PayU
From a redirect to a card saved on the customer's account. We roll out each of them and match them to how much should happen on your own page.
| PayU payment pageredirect | BLIK on your pagecode entered in the shop | Card via Secure Formcard fields from PayU | Saved cardon the customer's account | |
|---|---|---|---|---|
| Where the customer pays | on the PayU page | in your form and the banking app | in PayU fields embedded in your page | in one click on the next purchase |
| Card data bypasses your server | Yes | Yes | Yes | Yes |
| Works without extra PayU configuration | Yes | Partly | Yes | No |
| Works without a customer account | Yes | Yes | Yes | No |
| Good for | a quick start and many methods at once | phone purchases without leaving the shop | card payments with no redirect | stores with returning customers |
PayU has to enable saved cards, and some older points of sale do not have them. We check before quoting.
Your order, the PayU order
This is how we join the data so every notification reaches the right order.
order number 10517 the order identifier in PayUunique, ties notifications to the order
order total 210.00 PLN an amount of 21000 groszePayU counts in grosze
cart lines products with price and quantityunit prices in grosze
customer email buyer emailPayU sends its confirmation there
customer IP buyer IPrequired when creating the order
notification handler address notification addresscan differ for each payment
page after payment return pagefor the customer only, confirms nothing
07
What we watch out for with PayU
Details from the documentation that break integrations in practice.
- 01
Authentication and environments
The header when requesting a token
Without Content-Type application/x-www-form-urlencoded PayU returns 401 even with correct credentials.
- 02
The sandbox is not for load testing
Under heavy traffic the sandbox temporarily blocks access with 429. We load-test on our side, against stubs.
- 03
The auto-capture setting
With capture off, an order nobody acts on is cancelled after the time set for its payment method.
- 04
extRefundId for frequent refunds
Several simultaneous partial refunds need an id of their own for each refund.
- 05
The refund total
Refunds cannot exceed the order amount, so your panel shows how much is still refundable.
What the quote is made of
Four things raise the price, described below.
A PayU integration costs from PLN 999 (about EUR 220) under our API and integrations service, for a payment with a redirect. We give the figure after a call about the payment methods and post-payment events you need.
Methods on your own page
A redirect is simplest. BLIK and cards embedded in the shop mean more screens and error scenarios.
Saved cards and customer accounts
Reusable tokens need linking to customer accounts and handling their removal.
Events after payment
An invoice, a service activation, a shipment: each is a separate tested path.
Refunds from your panel
Full and partial refunds with a history in your panel.
Included in the price:
- sandbox and scenario tests
- notification signature checks
- a payment event log
- a repository with instructions
Not included, quoted separately:
- the PayU agreement and fees
- hosting with monitoring
- maintenance after the warranty
Common questions about PayU
The main questions about PayU: cards, BLIK, notifications, refunds, cost and code.
Can I take cards without a redirect?
How long does it take?
How much does a PayU integration cost?
Can a customer save a card for next time?
What if a notification does not arrive?
Can you handle recurring BLIK payments?
Can I take the money only after a stock check?
Can I issue refunds from my own panel?
Can someone forge a "paid" notification?
Will the PayU integration code be mine?
What if PayU changes its API?
Sources
Technical details come from the PayU Europe documentation and the official SDK.
Describe your project.
A free quote comes back within an hour during working hours.