PayU integration through the REST API

A PayU integration from VulCode brings PayU payments into your store or app through REST API 2.1, from PLN 999 (about EUR 220), usually in 2-3 days. We build it where a ready plugin cannot handle the sales process. The integration handles orders, notifications with a verified signature, full and partial refunds from your panel, saved cards and BLIK (Poland's mobile payment system) on your own page, with no redirect.

PayU

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.

  1. Your server connects with the point of sale's key creates the order
  2. The order in PayU amount, products, the notification address and the return page the payment link
  3. Payment page the customer picks a method and pays status change
  4. Notification signed, sent to the address given in the order receipt confirmed
  5. 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.

  1. 01 PENDING

    The payment is being processed. The order waits, nothing ships.

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

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

How long PayU keeps resending notifications

When your server does not confirm a notification, PayU sends it again. The schedule spans three days.

JSON application/json
[
                {
                "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."
                }
              ]
The same record in the interface

Attempts 3

  1. 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.
  2. 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.
  3. 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 pageredirectBLIK on your pagecode entered in the shopCard via Secure Formcard fields from PayUSaved cardon the customer's account
Where the customer pays on the PayU pagein your form and the banking appin PayU fields embedded in your pagein one click on the next purchase
Card data bypasses your server YesYesYesYes
Works without extra PayU configuration YesPartlyYesNo
Works without a customer account YesYesYesNo
Good for a quick start and many methods at oncephone purchases without leaving the shopcard payments with no redirectstores 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.

Your systemPayU
order number 10517
the order identifier in PayU

unique, ties notifications to the order

order total 210.00 PLN
an amount of 21000 grosze

PayU counts in grosze

cart lines
products with price and quantity

unit prices in grosze

customer email
buyer email

PayU sends its confirmation there

customer IP
buyer IP

required when creating the order

notification handler address
notification address

can differ for each payment

page after payment
return page

for the customer only, confirms nothing

07

What we watch out for with PayU

Details from the documentation that break integrations in practice.

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

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

  3. 03

    The auto-capture setting

    With capture off, an order nobody acts on is cancelled after the time set for its payment method.

  4. 04

    extRefundId for frequent refunds

    Several simultaneous partial refunds need an id of their own for each refund.

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

  1. Methods on your own page

    A redirect is simplest. BLIK and cards embedded in the shop mean more screens and error scenarios.

  2. Saved cards and customer accounts

    Reusable tokens need linking to customer accounts and handling their removal.

  3. Events after payment

    An invoice, a service activation, a shipment: each is a separate tested path.

  4. 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?
Yes, through the PayU Secure Form embedded in your page. The card number goes straight to PayU, so your system never sees full card data.
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 PayU integration cost?
A PayU integration costs from PLN 999 (about EUR 220) under our API and integrations service, for a payment with a redirect, and the rollout usually takes 2-3 days. BLIK and cards on your own page, saved cards and refunds from the panel raise the price and are quoted separately. You pay the transaction commission directly to PayU. The quote is free and comes back within an hour.
Can a customer save a card for next time?
Yes, the saved card is linked to their account in your store. PayU has to enable it, so we check before quoting.
What if a notification does not arrive?
PayU resends it for three days. Our module also checks unconfirmed orders by fetching the transaction data straight from PayU.
Can you handle recurring BLIK payments?
Yes, once you sign the annex to your PayU agreement that enables recurring BLIK. We cover details and limits on our BLIK page.
Can I take the money only after a stock check?
Yes. We turn automatic capture off, and the payment waits until your system captures or cancels it. Without a decision PayU cancels it after the time set for the payment method, so the panel shows the payments waiting to be captured.
Can I issue refunds from my own panel?
Yes, full and partial, with a history on the order. Several partial refunds at once each get their own reference, and the panel shows how much is still refundable, because refunds cannot add up to more than the order.
Can someone forge a "paid" notification?
It will not get through. We check every notification with your point of sale's second key before doing anything with it. A notification with a mismatched signature or amount is held for checking, and the order keeps its status.
Will the PayU integration code be mine?
Yes. Once the work is accepted and paid in full, the economic copyright in the PayU integration code passes to you and you get the repository with run instructions. Open source libraries keep their own licences.
What if PayU changes its API?
We adjust the integration to PayU's changes: within the 90 days of support included after launch, later under a maintenance plan or as a separate short order. We follow PayU's change notices and tell you in advance what needs fixing.

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.