Skip to main content

Magento 2

Official dpay.pl payment module for Magento 2. Enables online payment acceptance in your Magento store without writing any code. The module supports automatic invoice generation, online refunds, and IPN notifications.


Requirements

  • Magento 2.4.x or newer
  • 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 (inline)
  • Google Pay and Apple Pay
  • PayPal
  • Paysafecard
  • Installments

Installation

  1. In the Magento root directory, run:
    composer require dpay/magento2-payment
  2. Enable the module and update the database:
    bin/magento module:enable DPay_Payment
    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento cache:flush

Method 2 - Manual installation

  1. Download the latest module version from dpay.pl or GitHub.
  2. Extract the archive to the app/code/DPay/Payment/ directory.
  3. Enable the module and update the database:
    bin/magento module:enable DPay_Payment
    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento cache:flush

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-store.com/dpay/callback/ipn
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 in Magento

  1. Go to Stores > Configuration > Sales > Payment Methods.
  2. Find the dPay - Payment Gateway section and expand it.
  3. Fill in the configuration form:
FieldDescription
EnabledSelect Yes to activate the payment gateway
TitlePayment method name visible to the customer (default: dPay)
Service NameService name from the dpay.pl Dashboard
Secret Hash KeySecret hash from the dpay.pl Dashboard (stored encrypted)
Enable PayPalEnable PayPal payments
Enable Credit CardEnable credit card payments
Enable PaysafecardEnable Paysafecard payments
Enable InstallmentsEnable installment payments
Disable PayByLink + TransferDisable bank transfers and pay-by-link
BLIK ZeroEnable entering a BLIK code directly in the checkout
Apple PayEnable Apple Pay payments
Google PayEnable Google Pay payments
Credit card (dPay)Enable the inline card form in the checkout
New Order StatusStatus for new orders (default: Pending)
Payment from Applicable CountriesRestrict availability to selected countries
Sort OrderDisplay order for the payment method
  1. Click Save Config.
  2. Clear the cache: System > Cache Management > Flush Magento Cache.

Step 3 - Verification

  1. Place a test order in your store.
  2. Select dPay as the payment method.
  3. Verify that you are correctly redirected to the dpay.pl payment page.
  4. After completing the payment, verify that the order status has changed to Processing and the invoice has been automatically generated.

Refunds

The module supports online refunds directly from the Magento admin panel:

  1. Go to the order in Sales > Orders.
  2. Open the invoice associated with the order.
  3. Click Credit Memo and enter the refund amount.
  4. Confirm the operation.

The refund (full or partial) will be automatically sent to dpay.pl.


Status Mapping

dpay.pl StatusMagento Status
newPending
completedProcessing (invoice generated automatically)
rejectedCanceled

Troubleshooting

Orders do not change status automatically

  • Verify that the IPN URL (https://your-store.com/dpay/callback/ipn) is correctly configured in the dpay.pl Dashboard.
  • Make sure the IPN endpoint is publicly accessible and not blocked by a firewall or WAF.
  • Check the Magento logs: var/log/system.log and var/log/exception.log.

Error "Invalid checksum"

  • Make sure the Secret Hash Key in the module configuration matches the hash in the dpay.pl Dashboard.
  • Check that there are no extra spaces before or after the hash value.

Module does not appear in the configuration

  • Make sure the module is enabled: bin/magento module:status DPay_Payment.
  • Run bin/magento setup:di:compile and bin/magento cache:flush again.

Redirect to the payment page does not work

  • Verify that the Service Name is entered correctly.
  • Make sure the store currency is PLN - the module supports this currency only.

More Information