Skip to main content

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

  1. Download the module files from dpay.pl or GitHub.
  2. Copy the entire dpay/ directory to the Blesta payment gateways directory:
    components/gateways/nonmerchant/dpay/
    The directory structure should look as follows:
    • dpay/dpay.php - main module file
    • dpay/config.json - module configuration
    • dpay/language/ - translation files (pl_pl, en_us)
    • dpay/lib/dpay-sdk/ - dpay.pl SDK library
    • dpay/views/ - settings views and logo
  3. Log in to the Blesta admin panel.
  4. Go to Settings > Payment Gateways > Available.
  5. Find dpay.pl payments on the list and click Install.

Configuration

Step 1 - Prepare credentials in the dpay.pl Dashboard

  1. Log in to the dpay.pl Dashboard.
  2. Go to the Payment Points section.
  3. Create a new Payment Point or select an existing one.
  4. Note down:
    • Service name (service_name) - the unique name of your Payment Point
    • Secret hash (secret_hash) - the key used to sign requests
  5. 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

  1. Go to Settings > Payment Gateways > Installed in the Blesta admin panel.
  2. Click Manage next to the dpay.pl payments module.
  3. Fill in the configuration form:
FieldDescription
Payment Point name (service)Service name from the dpay.pl Dashboard
HASH key (hash)Secret hash from the dpay.pl Dashboard (stored encrypted)
Enable PayPalEnable/disable PayPal payments
Enable credit cardsEnable/disable card payments
Enable PaysafecardEnable/disable Paysafecard payments
Enable installmentsEnable/disable installment payments
Disable transfers/BLIK/PayByLinkHide the bank list on the payment page
Enable BLIK ZeroEnable BLIK Level 0 payments (inline, no redirect)
Enable Apple PayEnable Apple Pay payments
Enable Google PayEnable Google Pay payments
Enable inline cardEnable inline card payments
  1. Click Update Settings.

Step 3 - Verification

  1. Go to a client account or create a test invoice in PLN currency.
  2. Select dpay.pl as the payment method.
  3. Verify that you are correctly redirected to the payment page (or that the BLIK input field is displayed if BLIK Zero is enabled).
  4. 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:

  1. Go to the client's transactions in Clients > [Client] > Transactions.
  2. Select the transaction and click the Refund option.
  3. 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 StatusBlesta Status
New transactionPending
completed (IPN)Approved
refundedRefunded
Signature errorRejected (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.

More Information