Integrating LiqPay payments into a Laravel application
LiqPay is Ukraine's most widely used payment gateway, processing millions of transactions monthly. Integrating it into your Laravel application takes under a day — and eliminates the checkout friction that costs e-commerce stores 15–20% of potential revenue.
Why LiqPay for your Laravel store
LiqPay is operated by PrivatBank and supports card payments, Apple Pay, Google Pay, and instalments. It requires no monthly fee — you pay a percentage per transaction only when a customer completes a purchase. For Ukrainian businesses, it is the default choice: your customers already trust it.
Setting up LiqPay in Laravel
LiqPay communicates via a simple REST API. The integration flow has five steps:
- Register a merchant account at liqpay.ua and obtain your
public_keyandprivate_key. - Install the PHP SDK via Composer:
composer require liqpay/liqpay. - Store keys in
.envand reference them inconfig/services.php. - Build a
LiqPayServiceclass that generates the signeddataandsignatureparameters required by the checkout widget. - On payment callback, verify the signature server-side before marking an order as paid.
A minimal controller action that generates the checkout form builds the params array — including action, amount, currency, order_id, server_url, and result_url — then calls cnb_data() and cnb_signature() from the SDK.
Handling the callback securely
LiqPay posts a signed payload to your server_url after each transaction. Always verify the signature before acting:
- Reconstruct the expected signature:
base64(sha1(private_key + data + private_key)). - Compare with
hash_equals()to prevent timing attacks. - Decode the
datapayload (base64 → JSON) and checkstatus === 'success'before updating the order. - Return HTTP 200 on success; LiqPay retries on any other response code.
What this delivers
- Customers pay with cards, Apple Pay, or Google Pay without leaving your site.
- Refunds and subscription payments are available via the same API.
- Full payment history is visible in the LiqPay merchant dashboard.
- Webhook-driven order status updates keep your Laravel database in sync automatically.
A complete Laravel + LiqPay integration — including order status webhooks and an admin reconciliation view built in Laravel Filament — takes MaxiMoruM three to five working days to deliver.
Ready to accept payments on your Laravel site? Contact MaxiMoruM for a scoped estimate.