Blesta
Official dpay.pl payment gateway module for the Blesta billing system. Enables online payment acceptance for invoices and services. Supports BLIK Level 0 (inline), credit/debit cards, PayPal, Paysafecard, installments, and online refunds.
Requirements
- Blesta 4.x or 5.x
- PHP 7.4 or newer
- An active account in the dpay.pl Dashboard with a configured Payment Point
Supported Payment Methods
- BLIK (including BLIK Level 0 - inline)
- Bank transfers (pay-by-link)
- Credit/debit cards
- PayPal
- Paysafecard
- Installments
Supported currency: PLN.
Installation
- Download the module files from dpay.pl or GitHub.
- Copy the entire
dpay/directory to the Blesta payment gateways directory:The directory structure should look as follows:components/gateways/nonmerchant/dpay/dpay/dpay.php- main module filedpay/config.json- module configurationdpay/language/- translation files (pl_pl, en_us)dpay/lib/dpay-sdk/- dpay.pl SDK librarydpay/views/- settings views and logo
- Log in to the Blesta admin panel.
- Go to Settings > Payment Gateways > Available.
- Find dpay.pl payments on the list and click Install.
Configuration
Step 1 - Prepare credentials in the dpay.pl Dashboard
- Log in to the dpay.pl Dashboard.
- Go to the Payment Points section.
- Create a new Payment Point or select an existing one.
- Note down:
- Service name (
service_name) - the unique name of your Payment Point - Secret hash (
secret_hash) - the key used to sign requests
- Service name (
- In the Payment Point settings, set the IPN URL to:
https://your-blesta.com/callback/gw/<company_id>/dpay/<client_id>
Important
The secret hash should be treated like a password. Never share it publicly or include it in frontend code.
Step 2 - Configure the module
- Go to Settings > Payment Gateways > Installed in the Blesta admin panel.
- Click Manage next to the dpay.pl payments module.
- Fill in the configuration form:
| Field | Description |
|---|---|
Payment Point name (service) | Service name from the dpay.pl Dashboard |
HASH key (hash) | Secret hash from the dpay.pl Dashboard (stored encrypted) |
| Enable PayPal | Enable/disable PayPal payments |
| Enable credit cards | Enable/disable card payments |
| Enable Paysafecard | Enable/disable Paysafecard payments |
| Enable installments | Enable/disable installment payments |
| Disable transfers/BLIK/PayByLink | Hide the bank list on the payment page |
| Enable BLIK Zero | Enable BLIK Level 0 payments (inline, no redirect) |
| Enable Apple Pay | Enable Apple Pay payments |
| Enable Google Pay | Enable Google Pay payments |
| Enable inline card | Enable inline card payments |
- Click Update Settings.
Step 3 - Verification
- Go to a client account or create a test invoice in PLN currency.
- Select dpay.pl as the payment method.
- Verify that you are correctly redirected to the payment page (or that the BLIK input field is displayed if BLIK Zero is enabled).
- After completing the payment, verify that the invoice in Blesta has changed to paid status.
Refunds
The module supports online refunds directly from the Blesta admin panel:
- Go to the client's transactions in Clients > [Client] > Transactions.
- Select the transaction and click the Refund option.
- Enter the refund amount and confirm.
The refund will be automatically sent to dpay.pl via the API. Both full refunds (without specifying an amount) and partial refunds are supported.
Status Mapping
| dpay.pl Status | Blesta Status |
|---|---|
| New transaction | Pending |
completed (IPN) | Approved |
refunded | Refunded |
| Signature error | Rejected (BAD SIGNATURE) |
Troubleshooting
Invoices do not change status after payment
- Verify that the IPN URL is correctly configured in the dpay.pl Dashboard.
- Make sure the Blesta callback URL is publicly accessible and not blocked by a firewall.
- Check the payment gateway logs in the Blesta admin panel: Tools > Logs > Gateway Logs.
Currency error
- The module supports PLN currency only. Make sure the invoice currency is set to PLN. A different currency will display an unsupported currency message.
Error "Payment Point name cannot be empty"
- Make sure the service field in the module configuration contains a valid Payment Point name from the dpay.pl Dashboard.
BLIK payment does not work
- Verify that the BLIK Zero option is checked in the module settings.
- Make sure the customer enters a valid 6-digit BLIK code.
- The BLIK code is valid for a short period - the customer should complete the payment immediately after generating the code in their banking app.