Skip to main content

Testing

You have the option to test BLIK payment integration within the sandbox environment. This section offers test authorization codes and UID token prefixes that facilitate the simulation of various payment scenarios, along with examples of transaction requests.

The test requests have been supplemented with sample data, which you can modify using the specifications outlined earlier in this document.

Here is a compilation of BLIK authorization codes that simulate distinct behaviors (latest version):

  • 200201 - positive authorization with token registration,
  • 500500 - negative authorization,
  • 777xxx - positive authorization without token registration,
  • 700701 - BLIK authorization code has expired,
  • 700702 - BLIK authorization code has been cancelled,
  • 700703 - BLIK authorization code has already been used.
Notes

To receive the described responses, the special configuration Transparent payment with a BLIK authorization code or Transparent payment with the UID token described in here must be configured on your POS.

Before sending test request, generate an OAuth token (using https://secure.snd.payu.com/pl/standard/user/oauth/authorize url address) for used point of sale (POS).

Payment with Redirection to the BLIK Payment Page

Example of the Request for the Payment with Redirection to the BLIK Payment Page
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"payMethods": {
"payMethod": {
"type": "PBL",
"value": "blik"
}
}
}'

Payment with a BLIK Authorization Code

Example of the Request for Payment with a BLIK Authorization Code
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "777654"
}
}
}'

The response to your request depends on the BLIK authorization code utilized within the authorizationCode field. Feel free to use any of the previously mentioned test codes for simulation purposes.

UID Token Payment

Example of UID Token Registration Request
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"buyer": {
"extCustomerId": "customer123",
"email": "john.doe@email.com"
},
"payMethods": {
"payMethod": {
"type": "BLIK_AUTHORIZATION_CODE",
"value": "777123",
"blikData": {
"aliasLabelProposal":"token for eshop.pl",
"register": true
}
}
}
}'

The response to your request depends on the BLIK authorization code utilized within the authorizationCode field. Feel free to use any of the previously mentioned test codes for simulation purposes.

Example of UID Token Payment Request
curl -X POST https://secure.snd.payu.com/api/v2_1/orders \
-H "Authorization: Bearer d9a4536e-62ba-4f60-8017-6053211d3f47" \
-H "Content-Type: application/json" \
-d '{
"currencyCode": "PLN",
"totalAmount": "21000",
"description": "Test transaction",
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "300746",
"products": [
{
"name": "Wireless Mouse for Laptop",
"unitPrice": "21000",
"quantity": "1"
}
],
"buyer": {
"extCustomerId": "customer123",
"email": "john.doe@email.com"

},
"payMethods": {
"payMethod": {
"type": "BLIK_TOKEN",
"value": "SIMULATE_ALIAS_AMBIGUITY-5690871207003",
"blikData": {
"appKey": "22222662",
"recommendedAuthLevel": "NO_CONFIRMATION",
}
}
}
}'

For details on parameters, please refer to the Create an Order section in our API Reference.