Przelewy24

Przelewy24 (only for customers in Poland)

Przelewy24 is a secure and fast online bank transfer service linked to all the major banks in Poland. To start using Przelewy24 you must have access to online banking. Przelewy24 Service is an Internet service facilitating transfer of payments between the Customer and the Merchant.

The Customer selects his bank from a list of banks displayed.

How to integrate Przelewy24

d035013-przelewy24.png

Executing a Przelewy24 transaction is a three step process:

  • Step1: Create a new /types/przelewy24 resource. We recommend using the JavaScript SDK, mobile SDK for iOS or mobile SDK for Android.
  • Step 2: Execute a /payments/charges call with the reference to the types resource
  • Step 3: Forward customer to redirectUrl provided within charge response

Step 1: Creating a payment resource

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

Body: {}
// heidelpayUI
var unzer= new Unzer('s-pub-xxxxxxxxxx');

// Przelewy24
var Przelewy24 = heidelpayInstance.Przelewy24()

// Create resource
Przelewy24.createResource()
  .then(function (data) {
    console.log("Przelewy24 Resource: ", data)
    })
// sample successful response

{
  "id": "s-p24-mhmiyjdrizge",
  "method": "przelewy24",
  "recurring": false,
  "geoLocation": {
    "clientIp": "115.77.189.143",
    "countryCode": "VN"
  }
}

By using the request, a resource is created and the resource id (e.g. s-p24-23ashaor54) is returned.

Step 2 - Charging the payment resource

After creating the types resource, it is possible to create a charge request.

Return URL
Return URL is recommended to be provided. After customer finishes payment confirmation on Przelewy24 payment page, return URL will be called to redirect customer to shop webpage.
// UnzerAPI - Przelewy24 charge

POST https://api.unzer.com/v1/payments/charges
   
{
       "amount":       "12.4500",                                    
       "currency":     "PLN",
       "returnUrl":    "https://www.unzer.com",
       "resources": {
           "typeId":   "s-p24-23ashaor54",
       }
}

The result will be a pending charge with a redirectUrl.

// UnzerAPI - response example

{
    "id":               "s-chg-1",
    "isSuccess":        false,
    "isPending":        true,
    "isError":          false,
    "redirectUrl":      "https://payment.unzer.com/przelewy24/3849234023942354935353405234320423",
    ...
}

Step 3 - Forwarding customer to redirectUrl You need to send the customer to the redirectUrl where he will be forwarded to the Przelewy24 payment page. After successfull payment or cancelation, the customer will be redirected back to the returnUrl you specified in the charge call.

After the customer is redirected back to the returnUrl, you should check the status of the payment by getting the payment id.

// UnzerAPI - fetch final result

GET https://api.unzer.com/v1/payments/<id>/charges/<id>

{
    "id":          "s-chg-1",
    "isSuccess":   true,
    "isPending":   false,
    "isError":     false,
     "redirectUrl": "",
     ...
}