Przelewy24

Przelewy24 is an online payment method used in Poland.

About Przelewy24

Przelewy24 is linked to all major banks in Poland, which lets you accept payments in Polish zloty (PLN).

Your customer selects their bank from a Przelewy24 payment page, and logs in with their online banking credentials.

Accept a Przelewy24 payment

To accept a Przelewy24 payment, follow the steps below.

Przelewy24 test credentials are pre-filled by default. When testing, just select Pay.

Step 1: Create a przelewy24 resource

To accept a Przelewy24 payment, create a przelewy24 resource first.

Make an empty-body POST call to /types/przelewy24:

POST https://api.unzer.com/v1/types/przelewy24/

Body: {}

var unzer= new Unzer('s-pub-xxxxxxxxxx');
var Przelewy24 = heidelpayInstance.Przelewy24()
Przelewy24.createResource()
  .then(function (data) {
    console.log("Przelewy24 Resource: ", data)
    })
{
  "id": "s-p24-mhmiyjdrizge",
  "method": "przelewy24",
  "recurring": false,
  "geoLocation": {
    "clientIp": "115.77.189.143",
    "countryCode": "VN"
  }
}
Property Type Description
id String The ID of the przelewy24 resource that you just created.
method String The payment method.
recurring Boolean Indicates if this is a recurring payment.
clientIp String The IP address of the device used for the payment.
countryCode String The country associated with clientIp, displayed in the ISO 3166-1 alpha-2 format.

Step 2: Make a charges call

To charge the Przelewy24 resource, make a POST call to payments/charges, with the following parameters in the request body:

Parameter Required Type Default Description Example
amount Yes Number / The charged amount. 12.4500
currency Yes String / The transaction currency, in the ISO 4217 alpha-3 format. PLN
returnUrl Yes String / After the customer confirms the payment on the Przelewy24 payment page,
returnUrl is called to redirect customer to your shop’s website.
https://www.unzer.com
typeId Yes String / The newly-created payment type ID that you received
in response to creating an Przelewy24 resource (Step 1).
s-p24-23ashaor54
POST https://api.unzer.com/v1/payments/charges

Body:
{
  "amount": "12.4500",                                    
  "currency": "PLN",
  "returnUrl": "https://www.unzer.com",
  "resources": {
    "typeId": "s-p24-23ashaor54",
  }
}
{
  "id": "s-chg-1",
  "isSuccess": false,
  "isPending": true,
  "isError": false,
  "redirectUrl": "https://payment.unzer.com/przelewy24/3849234023942354935353405234320423",
    ...
}
Property Type Description
id String The transaction’s unique ID.
isSuccess Boolean Set to true if the transaction was successful.
isPending Boolean Set to true if the transaction is pending
(e.g. if a redirect to an external system is required).
isError Boolean Set to true if an error occurs.
redirectUrl String The URL where the customer completes the payment.

Step 3: Forward the customer to redirectURL

After you charge the przelewy24 resource, implement the following flow:

  1. Redirect the customer to the redirectURL.
  2. The customer is forwarded to the przelewy24 payment page.
  3. After a successful payment, the customer is redirected to the returnURL that you specified in the charges call (Step 2).

Step 4: Check the payment status

After the customer is redirected to the returnUrl, check the status of the payment.

Make a GET call with the following parameters in the request path:

Parameter Required Type Description Example
resource_ID Yes String The returned ID of the przelewy24 resource that you created in Step 1. s-p24-mhmiyjdrizge
transaction_ID Yes String The transaction’s unique ID that you received in Step 2. s-chg-1
GET https://api.unzer.com/v1/payments/{resource_ID}>/charges/{transaction_ID}
{
  "id": "s-chg-1",
  "isSuccess": true,
  "isPending": false,
  "isError": false,
     ...
}
Property Type Description
id String The transaction’s unique ID.
isSuccess Boolean Set to true if the transaction was successful.
isPending Boolean Set to true if the transaction is pending
(e.g. if a redirect to an external system is required).
isError Boolean Set to true if an error occurs.