Nets D2 for WooCommerce
Nets D2, previously DIBS D2, is a plugin that extends WooCommerce, allowing you to take payments via Nets. This plugin supports Nets D2 FlexWin payment method.
- You need an agreement with Nets 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 Nets back to your store won’t work and orders will not be updated with the correct order status/information.
- Login to WordPress Admin. Navigate to Plugins → Add New (in the left column menu).
- In the search field type “Nets D2” 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 > Payments > 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 – Enter your DIBS Merchant ID that you request/recieve from Nets.
- MD5 k1 & MD5 k2 – Tan be found in your DIBS account, under –> Integration –> MD5 keys. Only needed when using FlexWin.
- 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).
- Calcfee - Check this box if you want to automatically calculate and affix the charge from your acquirer
- 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.
- Split card payments - Check this box to enable two additional card payment methods.
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.
Nets backoffice setup
- Log in to your account at Nets.
- 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.
Nets transaction ID in order emails
In some cases Nets require that the Nets 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 Nets
Through the parameter paytype that is sent to Nets when a payment is being made you can control which payment types that you want to show in the Nets 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 Nets 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 Nets/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 Nets 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 Nets 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 Nets backoffice setup.