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
Method 1 - Composer (recommended)
- In the Magento root directory, run:
composer require dpay/magento2-payment - 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
- Download the latest module version from dpay.pl or GitHub.
- Extract the archive to the
app/code/DPay/Payment/directory. - 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
- 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-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
- Go to Stores > Configuration > Sales > Payment Methods.
- Find the dPay - Payment Gateway section and expand it.
- Fill in the configuration form:
| Field | Description |
|---|---|
| Enabled | Select Yes to activate the payment gateway |
| Title | Payment method name visible to the customer (default: dPay) |
| Service Name | Service name from the dpay.pl Dashboard |
| Secret Hash Key | Secret hash from the dpay.pl Dashboard (stored encrypted) |
| Enable PayPal | Enable PayPal payments |
| Enable Credit Card | Enable credit card payments |
| Enable Paysafecard | Enable Paysafecard payments |
| Enable Installments | Enable installment payments |
| Disable PayByLink + Transfer | Disable bank transfers and pay-by-link |
| BLIK Zero | Enable entering a BLIK code directly in the checkout |
| Apple Pay | Enable Apple Pay payments |
| Google Pay | Enable Google Pay payments |
| Credit card (dPay) | Enable the inline card form in the checkout |
| New Order Status | Status for new orders (default: Pending) |
| Payment from Applicable Countries | Restrict availability to selected countries |
| Sort Order | Display order for the payment method |
- Click Save Config.
- Clear the cache: System > Cache Management > Flush Magento Cache.
Step 3 - Verification
- Place a test order in your store.
- Select dPay as the payment method.
- Verify that you are correctly redirected to the dpay.pl payment page.
- 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:
- Go to the order in Sales > Orders.
- Open the invoice associated with the order.
- Click Credit Memo and enter the refund amount.
- Confirm the operation.
The refund (full or partial) will be automatically sent to dpay.pl.
Status Mapping
| dpay.pl Status | Magento Status |
|---|---|
new | Pending |
completed | Processing (invoice generated automatically) |
rejected | Canceled |
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.logandvar/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:compileandbin/magento cache:flushagain.
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.