Official Vipps MobilePay payment plugin for WooCommerce.
Official Vipps MobilePay payment plugin for WooCommerce. Let your Norwegian, Danish, and Finnish customers pay with Vipps and MobilePay for an easy, fast, and familiar shopping experience
Vipps is used by more than 77 % of Norway’s population (4.2 million users).
MobilePay is used by more than 75 % of Denmark’s population (4.4 million users), and more than 36 % of Finland’s population (2 million users).
Vipps and MobilePay are payment methods offered by Vipps MobilePay.
When you enable this plugin, you will choose between offering either Vipps or MobilePay as a payment method for your customers – hence “Vipps/MobilePay” going forward.
This is the official plugin for Vipps/MobilePay Checkout, Vipps/MobilePay ePayments (Vipps Nettbetaling), and Vipps Express Checkout (Vipps Hurtigkasse). Increase your conversion rate by letting your customers choose Vipps/MobilePay directly in the checkout or even do an Express Checkout (Vipps only) from the cart or a product page directly.
You can also do important back office tasks such as capture and refund directly from WooCommerce. Easy for your customer and easy for you.
Read information from Vipps about the plugin.
With Vipps/MobilePay Checkout enabled in the plugin, you will get a complete checkout in your webshop, designed by Vipps MobilePay. It contains regular Vipps/MobilePay payments, a card payment option for those that can’t or won’t use Vipps/MobilePay, as well as the ability to get the shipping address of the customer in an easy way. Read more about Vipps Checkout here
When you enable this plugin, your customers will be able to choose Vipps/MobilePay as a payment method in the checkout. There is no need to go via a third party payment method. If your customer choose Vipps/MobilePay, they fill in their name and address and is then asked to enter their phone number in the Vipps/MobilePay dialogue. They then confirms the payment in the Vipps/MobilePay app. Customer info like name and address is sent to the store from Vipps MobilePay.
When a payment is completed with Vipps Mobilepay, the money will be reserved, but only transferred to the merchant when the order is set to “Complete” or the money is captured manually. For Mobilepay, this reservation period is 14 days, so you will need to ship and fulfill orders before this; or to make an agreement with the customer to capture the money before this period is over. For Vipps, the period is 180 days. For payments made by credit card in Vipps/MobilePay Checkout, the period can again be as short as 7 days.
For details, please read the developer FAQ.
If the order only contains virtual and downloadable products, the plugin will capture the order automatically and set the order to “Completed” as is the standard WooCommerce rule.
When you enable Express Checkout, your customers can choose between the regular checkout or to go directly to Vipps. If they choose Vipps, they just submit their phone number, and the rest of the checkout is done in the Vipps app.
Since Vipps knows who the customers are, they don’t have to enter all their personal information. The customer just choose the shipping method and accepts the payment. Vipps will send all the necessary info back to the store. Easy, fast and secure.
The express checkout can be done in the following ways:
Settings for the cart, category and product pages can be found in the WooCommerce settings for the Vipps payment gateway.
Shareable links and QR codes can be generated from the Vipps tab on the product page.
This project is hosted on Github at: https://github.com/vippsas/vipps-woocommerce
From version 1.10.0, this plugin implements the Vipps Order Management API, sending a receipt to the customers’ app, and sending the order confirmation link as the Order Confirmation link category. You can, using this api, send over an image and a link for the categories receipt (RECEIPT), ticket (TICKET), shipping (DELIVERY), booking (BOOKING) and a general category (GENERAL).
For instance, if you have a page or url for tracking shipping, you can add this to the customers’ app by extending the ‘woo_vipps_add_order_categories’ filter like so:
add_filter('woo_vipps_add_order_categories', function ($categories, $order, $gateway) { $shippingpagedata = array( 'link' => <your shipping URL here>, 'image' => <filename or attachment ID of your illustration for shipping here, if required>, 'imagesize' => <for attachments, the image size to use>); $categories['DELIVERY'] = $shippingpagedata; return $categories; }, 10, 3);
You can similarily send ticket information (with e.g. a QR code) for the TICKET or BOOKING category and so forth.
From version 1.1.13 you can also modify the javascript using the new WP hooks library for javascript:
* ‘vippsBuySingleProduct’ – action which is run whenever a customer tries to buy a single product using express checkout
* ‘vippsBuySingleProductCompatMode’ – filter which should return true or false, if true, the compatibility mode action will be run instead of the standard ajax.
* ‘vippsBuySingleProductCompatModeAction’ – filter which should return a javascript function to run when buying a product and compatibility mode is on. Will normally press the “Buy” button for you.
* ‘vippsRemoveErrorMessages’ – runs when Vipps error messages are to be removed.
* ‘vippsErrorMessage’ – runs for every Vipps error message added with Javascript. Takes the message as an argument
* ‘vippsAddErrorMessage’ – runs when an error message is about to be added. Takes the message as an argument
* ‘vippsInit’ – runs when a page with a Vipps button is initialzed
* ‘vippsStatusCheckErrorHandler’ – A filter that should return function taking a statustext and an error object. It receives the default error handler, and is called when checking the order status with ajax for some reason ends up in an error.
Vipps is currently only available in Norway (77 % user adoption in 2022)
MobilePay is currently only available in Denmark and Finland (75 % and 36 % user adoption in 2022, respectively).
For issues with your WooCommerce installation you should use the support forum here on wordpress.org. For other issues you should contact Vipps MobilePay.
This was the old default of this plugin until version 2.0. The newer default is now ‘processing’, but this also means that orders that are ‘processing’ will have their payment reserved, but not transferred to the merchant. You can still choose the status on-hold in the options screen.
If you choose on-hold, orders with this status will have the payment reserved, but not yet transferred to the merchant. The money must be ‘captured’ before they are actually transferred to the merchant. You are normally only allowed to do this at the same time as the order is shipped. You can ‘capture’ the money explicitly on the order screen; but the money will be captured automatically when the order is set to “Processing” or “Complete”.
If you use the default or choose “processing”, the same applies to this status: The order will be reserved, but not captured. You can do the capture manually, or it will automatically happen when the order is set to “Complete”. Please note that you should ensure that your workflow is then so that the order is captured just before the package is shipped.
There is an exception for orders where all items are both virtual and downloadable: These are not considered to need processing and will be captured automatically (and go directly to the ‘Complete’ status). It is possible to customize this property for your needs using the woocommerce_order_item_needs_processing filter.
Yes, you can do refunds, including partial refunds, using the standard WooCommerce mechanism (https://docs.woocommerce.com/document/woocommerce-refunds/). Additionally, if you cancel an order that was already captured, the money will be refunded for the whole order. If automatic refund through the Vipps API should fail, you will need to refund manually; in this case an error message to this effect will be displayed and the order annotated.
Some plugins add new features to products or entirely new product types to WooCommerce; which the ‘Express Checkout’ function may not be able to handle. It can be possible to fix this using hooks and filters, but if you choose this feature, express checkout will be done in a different manner which is very much more likely to work for a given plugin. The cost is that the process will be slightly less smooth.
It may be that the shipping method you are using some how does not work when calculated from the Vipps app, where the customer is somewhat anonymous. However, since version 1.4.0 this problem ought to be greatly reduced, so if you still have this problem, report this on the forum and we’ll try to fix it.
If you have shipping methods that add additional information on the ‘normal’ checkout page they will not be able to provide that information to Express Checkout plugin, since that page is bypassed. You may be able to add those options on a different page; but you may want to remove those options when using Express Checkout.
Formerly, there was a filter used to work around this, namely ‘woo_vipps_shipping_methods’. This still works, but if you use it, it will disable the ‘new’ shipping method calculation. You may still customize the Express Checkout shipping; the new filter is called ‘woo_vipps_shipping_rates’.
To be sure, you should test your shipping methods in Express Checkout before going live.
Yes, though you need to ensure that the order-id’s you produce like this are unique for your Vipps account, and you currently have to use a filter in your themes’ functions.php file. We recommend using a prefix for your order ids, so a filter that will work with sequential order numbers would look like
add_filter('woo_vipps_orderid', function ($default, $prefix, $order) { return $prefix . $order->get_order_number(); }, 10, 3);
Ensure outgoing traffic to port 443 is open. This is used to communicate with Vipps servers.
Yes, but you will need a separate account, and you will need to install a special test version of the Vipps app, available trough Testflight. For your test account, the keys will be at https://portal-test.vipps.no; you will configure these in the developer mode settings.
Contact Vipps for access to the test app. This app must be installed on a device that does not have the normal Vipps app installed, or there will be conflicts.
To use test mode, switch “Developer mode” on. There you can input the test keys from portal-test.vipps.no and turn test mode on and off.
If this isn’t practical for your usage, we recommend that you “test in production” with a small amount, like 2 NOK. Just refund or cancel the purchase as needed.
There are several filters and hooks you can use to customize the behaviour of this plugin:
* Filter: ‘woo_vipps_is_available’: Takes a boolean availability argument and the gateway and must return true or false
* Filter: ‘woo_vipps_express_checkout_available’: Takes a boolean availability argument and the gateway and must return true or false.
* Filter: ‘woo_vipps_cart_express_checkout_button’: Receives a complete button text and the URL needed to proceed to the express checkout page.
* Filter: ‘woo_vipps_express_checkout_banner’: Receives a message with an express checkout button and an URL for the same, should return a message for the express checkout banner normally shown on the checkout page
* Filter: ‘woo_vipps_buy_now_button’: Takes HTML for the button, and optionally product id, variation id, sku and if the button is to be shown as disabled by default
* Filter: ‘woo_vipps_show_express_checkout’ – Takes a boolean, returns whether or not to show the express checkout button
* Filter: ‘woo_vipps_show_single_product_buy_now’ – Takes a boolean and a product, returns true if the product should show a ‘buy now with vipps’ button
* Filter: ‘woo_vipps_show_single_product_buy_now_in_loop’ – Like above, but especially for products shown in the loop – catalog pages, archives and so forth
* Filter: ‘woo_vipps_spinner’: takes one argument which is a ‘wait’ spinner for certain pages
* Filter ‘woo_vipps_express_checkout_shipping_rates’ which replaces the ‘woo_vipps_shipping_methods’. It takes a list of shipping methods, and order, and a cart. The format of the shipping methods is an array of ‘rate’ which is a WC_Shipping_Rate object, ‘priority’ which is an integer and the sort-order Vipps will use to display the alternatives, and ‘default’, which is a boolean: This will be the default choice
* Filter: ‘woo_vipps_default_shipping_method’ taking the default shipping method ID, a list of the shipping methods available (as a table from method id to WC_Shipping_Rate object) and the order. Return a shipping rate id, like ‘local_pickup:5’
* Filter: ‘woo_vipps_vipps_formatted_shipping_methods’. This will take an array of the methods to be sent to Vipps, formatted as required by Vipps. This is mostly for debugging.
* Filter: ‘woo_vipps_shipping_callback_packages’: Takes the ‘packages’ from the cart used to calculate shipping in the shipping details callback
* Filter ‘woo_vipps_express_checkout_final_shipping_rate’: Takes an WC_Shipping_Rate object, the order, and the shipping info from Vipps. Must return a WC_Shipping_Rate object which will be added to the order.
* Filter: ‘woo_vipps_country_to_code’: Takes a country code and a country name. Should return a two-letter ISO-3166 country code from a given country name
* Filter: ‘woo_vipps_show_capture_button’: Takes a boolean and an order and returns whether or not to show the capture button in the backend
* Filter: ‘woo_vipps_captured_statuses’: Returns a list of the statuses for which Vipps should try a capture when transitioning to them.
* Filter: ‘woo_vipps_transaction_text’: Takes a transaction text and an order object, must return a text to be passed to Vipps and displayed to the user along the lines of “Please confirm your order”
* Filter: ‘woo_vipps_special_page_template’: Takes a (complete) template path as returned by locate_template and the ID of the Vipps special page, should return a new template path (using locate_template or similar).
* Filter: ‘woo_vipps_order_failed_redirect’: Takes an empty string or an url and an order id. If URL is returned, go there on cancelled or failed orders.
* Filter: ‘woo_vipps_product_supports_express_checkout’: Takes a boolean and a product, returns true if the product can be bought with express checkout
* Filter: ‘woo_vipps_cart_supports_express_checkout’: Takes a boolean and a cart, returns true if the cart can be bought with express checkout
* Filter: ‘woo_vipps_express_checkout_supported_product_types’: Returns a list of product types (as strings) that can be bought with express checkout
* Filter: ‘woo_vipps_orderid’: Takes default Vipps orderid, the order prefix, and an order object. Must return an unique (at Vipps) order ID with 30 chars or less. Default is the prefix + orderid, e.g. ‘Woo364’.
* Action: ‘woo_vipps_shipping_details_callback_order’: Takes an order-id and the corresponding vipps order id. Run at the start of the shipping methods callback.
* Action: ‘woo_vipps_restoring_cart’: Takes an order and a saved cart contents array, ran after the order has failed or is aborted
* Action: ‘woo_vipps_cart_restored’: Runs after the cart has been restored after the order has been aborted of failed
‘ Action: ‘woo_vipps_cart_saved’: When redirecting to Vipps, the cart is saved so it can be restored in case the order isn’t completed. This action is ran after this has happened.
* Action: ‘woo_vipps_before_redirect_to_vipps’: Takes an order-id, called at the end of process_payment right before the redirect to Vipps
* Action: ‘woo_vipps_before_create_express_checkout_order’: Takes the cart to do express checkout for, run before the order is created
* Filter : ‘woo_vipps_create_express_checkout_cart_contents’: Takes a cart contents array from which an express checkout order will be created . Should return a like array.
* Action: ‘woo_vipps_express_checkout_order_created’: Takes an order ID, run right after an express checkout order has been created, but before it is processed’
* Action: ‘woo_vipps_before_process_payment’: Takes an order-id, called at the start of process_payment
* Action: ‘woo_vipps_wait_for_payment_page’: Run on the page shown on return from Vipps
* Action: ‘woo_vipps_express_checkout_page’: Run on the express checkout page, before redirect to Vipp
* Action: ‘woo_vipps_set_order_shipping_details’: Takes an order object, shipping details from Vipps and user details from Vipps. Runs after shipping details have been added to the order on return from express checkout.
* Action: ‘woo_vipps_callback’: Runs when Vipps does the callback on a successful payment, takes Vipps’ data as input. Useful for logging/debugging the callback.
* Action: ‘woo_vipps_express_checkout_get_order_status’: Takes the order status returned by Vipps – called when the Vipps callback hasn’t happened and we need the order status. Useful for logging.
* Action: ‘woo_vipps_vipps_callback’: Is ran when the Vipps callback happen, with the decoded and raw POST from Vipps. Useful for logging.
* Action: ‘woo_vipps_shipping_details_callback’: Is ran when Vipps does the shipping details callback on express checkout. Takes decoded and raw POST from Vipps, and the callback args. For debugging.
* Action: ‘woo_vipps_shipping_details_before_cart_creation’: Run after order is updated but before a cart is created to do shipping calculations. Takes an order, The order-id at Vipps and the callback arguments from Vipps
* Filter: ‘woo_vipps_transaction_text_shop_id’: This is used to identify your shop in the transaction texts sent to Vipps (and shown to the user). Default is home_url(), but there is a length limit, so this filter allows you to keep it short.
Fix untranslateable string and a sprintf format string with a bug in it (Thanks Knut Sparhell for reporting)
Fix annoying regression where VippsCheckout would trigger the “Unknown order” branch on the thank you page
Fix issue where session was not active when computing checkout fields
Fix previous fix for older php versions
Bump required php version to 7.0
Removed support for Instabox in Vipps Checkout Shipping
Added support for external payment methods in some markets
Changed gateway registering to use class name instead of instantiated objects to prevent unintended breakage
Fixed some utranslatable strings and changed MobilePay reservation time notices to 14 days
Added nocache-headers for nginx
Fixed an issue that could delay order confirmations in rare situations
Added a failsafe for certain situations that could destroy sessions in shipping computation
Fixed some places where NOK were hard-coded in as currency.
Create a limit of 10 attempts to capture an order; do not call API after this. The order will be uncapturable. It is possible to reset this by pressing “Get complete transaction details” in the Vipps metabox for the order.
Fix in the logic for deleting webhooks
Minor updates and language
Made sure the filters for the_title on the checkout page works even with too few arguments
Added notice and warning for MobilePay that capture must be done within 14 days
Add workaround for Orderline issue with Checkout
Use translate.wp.org for translations
Fix default payment status
More protection against issues where settings are wrong and the plugin tries to instantiate webhooks
Fix bug in uninstall hook and activation hook when settings are wrong in the database
Support MobilePay as a payment method in Finland
Use the Epayment api for all transactions other than Vipps Express Checkout
Disable support for order attribution by default – it can be added in the “Advanced” settings. Some sites got crashes due to memory use.
Minor fix for 8.5.1 and express checkout
Support Order Attribution in Vipps Checkout and Express Checkout
Support for Mailchimp for WooCommerce, fixed regressions
Debugging information added for situations where an order may be spuriously cancelled
Fix regression error in activate/deactivate actions
Fix for issues with stored admin notices in newer woos, small css fix
Minor fixes, refactoring Checkout support for further features
Stop zeroing out addressline 2 in checkout
Fix polling when sessions are very long-lived in woo
Fix sanitizion of output in Buy-Now button code; thanks to Darius Sveikauskas for reporting
Check that images uploaded to receipts are either jpeg or png
Fix edge cases where orders were wrongly cancelled in Vipps Checkout
More filters/hooks:
do_action(‘woo_vipps_before_thankyou’, $orderid, $order);
Runs before the thankyou page is reached, and can be used to finalize orders created using Checkout or Express Checkout, plus
apply_filters(‘woo_vipps_express_checkout_new_username’, ”, $email, $userdata, $order);
Which can be used to customize the username for new users created using express checkout or Vipps Checkout.
Supports MailerLite – WooCommerce integration (woo-mailerlite) in Vipps Checkout
Fix crashing bug interaction with the Add-on WooCommerce – MailPoet plugin
Handle the new Thankyou-page behavious in Vipps Checkout too, by adding a new option to register/log in users
Prepare to handle other Checkout flows
Support Free shipping for Porterbuddy in Vipps Checkout
Fix issue with Woo 5.8.x and above where Express Checkout required email confirmation before the thankyou page was shown.
Fix back button on express checkout
Add protection against caches ignoring nocache-headers and rename the “limited session” parameter to something sane.
Ensured admin notices do not crash newer versions of WooCommerce when Vipps is triggered with no current screen
Changed descriptions on Bring shipping methods for Vipps Checkout
Fixed typo which made the “Confirm terms and conditions” screen always appear if started from the Cart
Apparently some setup got called woocommerce_init_shipping more than once, which crashed on the new Checkout shipping methods.
Bugfix for some shipping methods in Vipps Checkout
Ensures that orders that don’t need shipping do not ask for addresses from customers unless you explicitly want to.
Small bugfixes too.
Set require_userInfo to false per default for Elemenor and other users of pre_handle_404
Bugfixes
Support Vipps Checkout version 3 with extended support for shipping methods in Vipps Checkout, allowing for the selection of pickup points and more.
Remove default title on Vipps Checkout page
Added filter to support for extra consent checkbox in Vipps Checkout
Add failsafe for rare bug affecting some external payment method purchases with Klarna Checkout
Remove lookup of orderid based on Vipps-orderid from database to improve speed and remove issues with transients etc.
Workaround for WooCommerce Smart Coupons bug
Let Vipps Checkout handle the WooCommerce endpoints for thankyou etc, for better Elementor compatibility
Support for Pixel Your Site-like mechanisms for Vipps Checkout
Fix for a php8 issue with unset options for the badge feature
Changes required for newer version of epayment-api
Changes in localization for blocks
Added support for HPOS (https://woocommerce.com/document/high-performance-order-storage/)
Added protection from Vipps being ran while WooCommerce is deactivated
Added support for ecommerce-tracking in GAv4 and AdWords for Monster Insights, plus extra support for Express Checkout for Pixel Your Site.
Added support for Vipps On-Site Messaging badges
Fix issue with duplicate order ID’s, but for real this time
Fix issue with duplicate order ID’s
Reorganization of banner code
New option for turning off receipts, better support for tax-free shipping
initiate_payment
and initiate_checkout
, which allows for more control over the return URL which is especially important for headless themes.Add support for Woocommerce Subscriptions manual renewals using a filter and a developer setting.
Fix issue where customer was assumed to exist even when doing cron jobs for rescuing dead orders
Add support for testing the callback handler remotely
Fix CSS issue caused by previous version
Support a more explicit, multi-step address selection flow in Express checkout, toggleable in the settings
Small CSS fixes for certain themes
Fix various php8-related bugs
Add extra supports for plugins like Yith WooCommerce Name Your Price and move compatibility hacks into a separate file
Support non-standard pretty permalinks by stopping redirect_canonical after a special page has been requested.
Ensure refunds of 0 NOK are not handled by Vipps
The cron job that checks the status of abandoned orders have since 1.7.10 restored these orders’ session to check the status as correctly as possible.
It seems this may ruin the session of other active users however, and we can’t have that, so now the status is checked without restoring the session.
Updating for latest versions of WP and Woo
Added a fail safe for situations where the Vipps callback fails and the customer does not return to the store
Tiny change in “No shipping required” setup
Fix error-handling when creating new customers in express checkout
Fix integration with Klarna Checkout so Vipps can be disabled as external payment method when appropriate
Version bump for new version of WooCommerce and Blocks
Increase priority of handling special pages to avoid 404-handlers in themes and plugins to handle them first
Fix the undismissable banner issue by ensuring browsers won’t have cached the admin javascript
Remainder that the Login with Vipps plugin exists
Fixes javascript problem on express checkout screen that could be caused by plugin interactions
Compatibility with Woo 5.0.0 and WP 5.7.0
Stop using the deprecated payment status interface. This is a quite large rewrite that should be invisible to uses.
Bugfixes for user creation in express checkout
Bugfix for Gutenberg blocks
Bugfix for user login in express checkout
Bugfix for Woo gutenberg blocks (other than all products)
Login and user creation synchronized better with Login with Vipps
Tested on newest versions
More sanitation added
Updated WP/Woo versions
Bugs fixed: undefined variable removed (thanks to kimmenbert @ github for reporting)
Correct version of the plugin reported to the Vipps-api
Ensure all products are in stock when using Express Checkout (thanks to lykkelig @ wp.org for reporting)
Bugs fixed: WPML support reenabled thanks to a bug report by @kodeks, user creation improved thanks to @henmor
Integrate with Login with Vipps and provide again the “create users when using express checkout” checkbox. If you choose too, this will then create (and log in) users when using express checkout.
Only users without privileges will be logged in like that. If you install Login with Vipps, this will be set as the default choice.
Fixed deletion of cancelled orders; thanks to @alarsen2 for reporting
Fixed issue with payment_complete not being called. Thanks to espen @ nhg for reporting and debugging
Added support for WooCommerce Gutenberg Blocks: the Checkout block, the All Products blocks and other product blocks.
Added the WOOCOMMERCE_CHECKOUT constant to create_partial_order, because some plugins act differently on checkout and on normal page views.
Improved compatibility with KCO external payments
Added yet another call to calculate_totals on the cart after the woocommerce_cart_loaded_from_session action
Fixed a bug in the session-restore code for Express Checkout that could affect pricing of shipping
Added a do-action call to ‘woocommerce_cart_loaded_from_session’ in callbacks to allow dynamic pricing plugins to run their code
Initial version – changelog truncated