DIBS D2 for WooCommerce
DIBS Gateway is a plugin that extends WooCommerce, allowing you to take payments via DIBS Payment. This plugin supports DIBS D2 FlexWin payment method.
- You need an agreement with DIBS and your acquiring bank to be able to use this plugin.
- A SSL certificate is not necessary but strongly recommended. If your site doesn’t hold a certificate the customer will, after a completed purchase, go from a secure connection to a unsecure one. In that case the customers browser prompts the customer with a question whether to continue or not. Would the customer then click cancel, the process does not continue. This does not occur if your server holds a certificate.
The plugin itself has no limitations regarding currency.
Required WooCommerce settings
Make sure that you have enabled pretty permalinks in your WordPress installation. Otherwise callbacks from DIBS back to your store won’t work and orders will not be updated with the correct order status/information.
- Log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
- In the search field type “DIBS” and click Search Plugins. Once you’ve found the plugin you can install it by simply clicking “Install Now”.
- Activate the plugin.
Configuration: Card payment
- Navigate to WooCommerce –> Settings –> Checkout –> DIBS.
- Enable DIBS card payment by checking the Enable DIBS checkbox.
The Title and Description fields controls what the customer sees during checkout.
- DIBS Merchant ID – Requested from DIBS.
- MD5 k1 &MD5 k2 – can be found in your DIBS account, under –> Integration –> MD5 keys.
- Language – Set the language in which the page will be opened when the customer is redirected to DIBS.
- Alternative payment icon – Specify the URL to an alternative payment icon that the user sees during checkout. Leave blank to use the default image. Alternative payment method logos can be found here.
- Icon width – The width of the Alternative payment icon.
- DIBS transaction capture – Select if you want to capture the card payment from WooCommerce or not. When a purchase is completed the amount is first reserved on the customers card. In the next step you as a merchant need to capture the payment.
– Select On order completion if you want he capture to be triggered from WooCommerce when changing the orderstatus from Processing to Completed.
– Select On purchase if you want the capture to be done directly when the customer finalizes the purchase in DIBS payment screen (this does not work subscription signup payments, use On order completion instead if using WooCommerce Subscriptions).
- Decorator – Specifies which of the pre-built decorators to use. This will override the customer specific decorator, if one has been uploaded. Select Responsive to get a mobile optimized payment window experience.
To be able to process refunds in DIBS directly from WooCommerce you need to create API credentials in the DIBS backoffice.
- Login to your account at DIBS.
- Navigate to → Setup → User Setup.
- Click on the tab API Users.
- Click the button Create new login.
- Enter a username (Login) and password and click the button Create.
- Enter the same credentials in API Username & API Password in the payment gateway settings.
- Save the payment gateway settings and you should now be able to process refunds from WooCommerce.
Test Mode Settings
- Test Mode – Check this box if your DIBS account is set to test mode. Read more about the DIBS test process here.
- Debug – Check this box to log events for debugging. The log can be found by navigating to WooCommerce > System Status > Logs.
DIBS backoffice setup
- Log in to your account at DIBS.
- Navigate to → Integration → md5 keys.
- Generate new md5 keys if none have been created yet.
- Check the box Perform verification of md5key (for security reasons). Make sure to leave the box unchecked if you are using DIBS together with the WooCommerce Subscriptions extension.
- Navigate to → Integration → Return Values and make sure that the following boxes are checked:
– All fields exclusive of card information response
– Transaction status code
- Check the box Skip step 3 – Payment approved under → Integration → FlexWin.
DIBS transaction ID in order emails
In some cases DIBS require that the DIBS Transaction ID is included in the order email sent to the customer. At the moment this isn’t a feature included in the payment gateway. To achieve this you could instead add the following lines to your themes functions.php or in a separate plugin:
Filter the paytype sent to DIBS
Through the parameter paytype that is sent to DIBS when a payment is being made you can control which payment types that you want to show in the DIBS payment window. Standard is that all card types is sent as paytypes. If you want to alter this and add let’s say – Direct bank payment, you can modify this through the filter “woocommerce_dibs_paytypes”.
Here is how you do it:
WooCommerce Subscriptions support
The DIBS payment gateway has support for recurring payments via WooCommerce Subscriptions. To activate this feature you need to:
- Set up an agreement with DIBS about taking subscription payments.
- Purchase and configure the WooCommerce Subscriptions extension.
The Dibs payment gateway ONLY supports card payments through WooCommerce Subscription.
Correct thank you page for DIBS/WPML
From version 2.4.5 of the plugin we have built in support to redirect the customer to the correct language for the thank you page if you are running WPML.
We are using WPML’s filter wpml_permalink to detect the correct url for the thank you page. At the moment (August 2017) there is a known bug in this filter (
https://wpml.org/forums/topic/wpml_permalink-not-returning-correct-url/). To get the redirect to work properly you need to have the permalink naming structure the same for all languages on checkout page. This means that if you have the English version like this:
you must have the Swedish version like this:
not like this:
Q. I get a 404 on the redirect back to the store after completing a purchase in the DIBS payment window.
A. This is probably caused by the fact that pretty permalinks isn’t activated on the site. This module has a redirect to mydomain.com/woocommerce/dibscallback so mod_rewrite must be enabled.
Q. Purchases looks ok in my DIBS backoffice but customers can’t see the Thank you page when redirected back to the store after a purchase and the order status doesn’t change to Processing.
A. This is probably an error because of wrong configuration in the Return values in the merchants DIBS account. Take a closer look at the instructions in the section about DIBS backoffice setup.