BLIK
Accept BLIK payments in your online store.
BLIK is a payment service in Poland that allows your customers to make quick and secure online transactions by confirming payments through your online banking app, providing a convenient and efficient payment solution. Use the emerchantpay API to accept BLIK as a payment method across the supported emerchantpay’s payment integrations.
Payment method | Countries |
---|---|
Bank transfer | Poland |
Prerequisites
To proceed with this solution, you must have an emerchantpay merchant account. Apply for a merchant account by filling out and submitting this contact form.
You will be assigned an emerchantpay Account Manager, who will provide you with credentials and assist you with any of emerchantpay’s payment solutions.To integrate with BLIK, connect to the emerchantpay Genesis gateway using the emerchantpay API. You should have a working knowledge of web programming languages, HTTP methods in XML and JSON formats, and UTF8 encoding. Use the Genesis SDK libraries with code samples to integrate with the gateway in a range of languages.
For a solution that requires less development overhead, accept BLIK payments through the emerchantpay Web Payment Form (WPF). Contact your Account Manager and tell them you want to accept BLIK through the WPF, and refer to the WPF API.
1. Create a BLIK payment request
To submit a payment using BLIK, create a payment request to the emerchantpay Genesis payment gateway. Specify online_banking as the transaction_type
and BLK as bank_code
.
Example of passing a BLIK transaction request:
<payment_transaction>
<transaction_type>online_banking</transaction_type>
<transaction_id>119643250547501c79d8295</transaction_id>
<remote_ip>245.253.2.12</remote_ip>
<amount>35000</amount>
<currency>PLN</currency>
<notification_url>https://www.example.com/notification</notification_url</notification_url>
<customer_email>travis@example.com</customer_email>
<consumer_reference>Consumer Reference</consumer_reference>
<customer_phone>+48178564927</customer_phone>
<return_failure_url>http://www.example.com/failure</return_failure_url>
<return_success_url>http://www.example.com/success</return_success_url>
<usage>40208 concert tickets</usage>
<bank_code>BLK</bank_code>
<auth_code>777123</auth_code>
<billing_address>
<first_name>Travis</first_name>
<last_name>Pastrana</last_name>
<address1> Test Str. 15</address1>
<address2/>
<zip_code>35114</zip_code>
<city> Rzeszów </city>
<state>Podkarpackie</state>
<country>PL</country>
</billing_address>
</payment_transaction>
2. Receive a response
You will receive a Success or Error response to your payment request.
Example of a Success response:
<payment_response>
<transaction_type>online_banking</transaction_type>
<status>pending_async</status>
<unique_id> 75199a21208427eb95554a6d7e5d5d48 </unique_id>
<transaction_id>119643250547501c79d8295</transaction_id>
<funds_status>NOT_EXPECTED</funds_status>
<redirect_url>https://staging.gate.emerchantpay.net/redirect/to_acquirer/75199a21208427eb95554a6d7e5d5d48 </redirect_url>
<mode>live</mode>
<timestamp>2023-08-09T07:53:02Z</timestamp>
<descriptor>Descriptor one</descriptor>
<amount>35000</amount>
<currency>PLN</currency>
<sent_to_acquirer>true</sent_to_acquirer>
<bank_code>BLK</bank_code>
<payment_type>online_banking</payment_type>
</payment_response>
redirect_url
to redirect your customer to authorise the payment with BLIK. See the emerchantpay API for the complete list of BLIK response parameters and code samples.
Asynchronous notification
Because the BLIK payment transaction is asynchronous, the result of your customer’s payment is sent as a separate HTTP POST notification from the gateway to the notification_url that you supplied with the transaction request. Example of a notification for a BLIK transaction:“transaction_id”: ”119643250547501c79d8…”,
“terminal_token”: ”f6a34b886c07f409a8f6f0899e834b5…”,
“unique_id”: ”75199a21208427eb95554a6d7e5d5…”,
“transaction_type”: ”online_banking”,
“status”: ”approved”,
“signature”: ”8d895b2d231f86ee85cdff64dbfecec1931…”,
“amount”: 35000,
“authorization_code”: “777123”,
“funds_status”: “WAITING”
status
field provides you with information on the outcome of the transaction. See Transaction States for more information about transaction statuses.
Verify the funds_status
parameter to confirm the money is settled. To ensure successful delivery of goods and services, emerchantpay recommends setting the funds_status
to received.
Use the signature
field to verify that the notification has been sent by the Genesis gateway. Each session signature is generated by combining the unique_id
of the transaction and your API password, and generating a SHA-1 hash function of the combined string.
signature
= SHA-1 hash value of <unique_id><API password>
unique_id | API password | signature |
---|---|---|
26aa150ee68b1b2d6758a0e6c44fce4c | 50fd87e65eb415f42fb5af4c9cf497662e00b785 | c5219b3d385e74496b2b48a549 |
3f760162ef57a829011e5e2379b3fa17 | 50fd87e65eb415f42fb5af4c9cf497662e00b785 | 14519d0db2f7f8f407efccc9b099 |
After you have verified the notification state and validity, render an XML page containing the transaction’s unique id to acknowledge that you have received the notification.
Example of a notification reply you use to confirm a notification:<?xml version=”1.0″ encoding=”UTF-8″?>
<notification_echo>
<unique_id>3f760162ef57a829011e5e2379b3fa17</unique_id>
</notification_echo>
3. Test your integration
Before you can accept live payments, you must test your integration in the emerchantpay staging environment.
- Add an item to your cart in your online store.
- Proceed to the checkout page and check out using BLIK.
- Follow the redirect link in the response.
- In the payment simulator, follow the instructions to simulate a transaction. Use a 6-digit authorisation code starting with 777.
- Complete the order and verify that you are redirected to the order confirmation page.
- Log in to Genesis.
- In the navigation menu, go to Payment transactions.
- Verify that the transaction appears at the top of the list and is successful.
4. Accept live payments
After you have successfully tested your BLIK integration, you are ready to move to the production environment and accept live payments. Contact your emerchantpay Account Manager to get your login credentials for the Genesis production environment.