Pay with bunq for WooCommerce
Accept iDEAL | Wero, card, Bancontact and bunq payments in your WooCommerce shop with just your bunq account.
Install in
Your customers pay through a bunq.me payment request on your own bunq account. There is no payment service provider in between: the money lands on the bunq account you choose.
- iDEAL | Wero, credit and debit cards, Bancontact and bunq-to-bunq transfers through a bunq.me payment request.
- Optionally let customers pick the payment method at checkout; methods whose bunq limits do not fit the order total are hidden.
- The iDEAL | Wero, card and Bancontact logos at checkout, and optionally each of them as a payment option of its own.
- Orders are confirmed by bunq’s callback, again when the customer returns to the shop, and by background checks (WooCommerce’s Action Scheduler) in case the callback never arrives.
- Payment requests that bunq reports as expired or cancelled cancel the order; cancelling an order cancels its payment request at bunq.
- Send an unpaid order’s bunq.me payment link to the customer by email from the order screen, for orders taken by phone or sent as an invoice.
- Refunds from the WooCommerce order screen, created as a bunq draft payment back to the IBAN the payment came from and approved in the bunq app.
- A bunq payment box on the order screen (also with High-Performance Order Storage) shows the payer’s name and IBAN, the payment method and a link to the bunq.me payment request.
- An hourly check of the connection with bunq warns on every admin page when bunq stops accepting it, before checkouts fail. The outcome is in WooCommerce > Status.
- Works with the classic checkout and the block checkout, and with High-Performance Order Storage.
- Translatable through translate.wordpress.org.
The payment method logos are from Pronamic’s wp-pay-logos (GPL-2.0-or-later).
The source code, including the development tools, is on GitHub.
Requirements
- A bunq account.
- WooCommerce.
- HTTPS, so bunq can reach the shop’s callback URL.
- The PHP extensions openssl, curl, json and mbstring.
The plugin is developed by Patrick Kivits and is the WooCommerce integration bunq presents to its business customers, see WooCommerce on bunq.com and the bunq Help article.
External services
This plugin connects your shop to bunq, the bank that holds the merchant’s account and processes the payments. Without bunq the plugin has no function. Depending on the “Test mode” setting it talks to bunq’s production environment or to bunq’s sandbox.
OAuth authorization (oauth.bunq.com, api.oauth.bunq.com; sandbox: oauth.sandbox.bunq.com, api-oauth.sandbox.bunq.com)
When the shop administrator clicks “Connect to bunq” on the settings page, the browser is sent to bunq with the OAuth client ID and the settings page URL. When bunq sends the administrator back, the plugin sends the OAuth client ID, client secret, the authorization code and the settings page URL to bunq to obtain the API key.
bunq API (api.bunq.com; sandbox: public-api.sandbox.bunq.com)
With the API key the plugin registers the shop’s server with bunq (a generated public key; bunq sees the server’s IP address) and then:
- lists the merchant’s bank accounts on the settings page;
- registers the shop’s callback URL for payment request notifications;
- creates a bunq.me payment request when a customer places an order, or when the merchant sends a payment link for an order, with the order total, the currency, the order number and the URL of the order confirmation page;
- reads the payment request and the payments made through it when bunq calls the callback URL, when the customer returns to the shop and in background checks for up to two days, and stores the payer’s name, IBAN and payment method on the order (for older orders, once when the order is opened in the admin);
- cancels the payment request when the order is cancelled in WooCommerce;
- reads the payment and creates a draft payment back to the customer’s IBAN when the merchant refunds an order, with the refund amount, the customer’s IBAN and name as bunq reported them, and a description with the order number, the shop name and the refund reason.
bunq.me (bunq.me)
To pay, the customer is sent to the bunq.me page of the payment request, where they choose a payment method and enter their payment details at bunq.
bunq’s terms and privacy policy apply to this data:
Written by Joobi from the project's own listing. See the source page
2.3.0
- A payment request for a chosen payment method now offers only that method on bunq.me. A customer who comes back and picks another method gets a new payment request for it, and a payment link sent from the order screen still offers every method.
- New banner and icon for the plugin page on wordpress.org.
2.2.0
- The plugin talks to bunq through the WordPress HTTP API and no longer bundles Guzzle or league/oauth2-client; it has no third-party libraries left. Production calls still pin the public key of api.bunq.com, now on WordPress’ cURL transport.
2.1.2
- Fixed: on multisite, a network-activated WooCommerce was treated as missing, so the plugin deactivated itself.
- Translations now come from translate.wordpress.org as language packs; the plugin no longer bundles its own translation files.
2.1.1
- Fixed: since 2.0.1 every call to bunq’s production environment failed with “Passing CURLOPT_PINNEDPUBLICKEY (10230) in the “curl” request option is not supported”, so payments could not be created. Guzzle 8 no longer allows the pinned public key of api.bunq.com, so the plugin is back on Guzzle 7. The sandbox was not affected.
2.1.0
- Renamed to Pay with bunq for WooCommerce, with the plugin folder and text domain pay-with-bunq-for-woocommerce, ahead of the listing on wordpress.org. Settings and the bunq connection are kept.
- When the plugin is installed twice (the old bunq-for-woocommerce folder next to the new one), the second copy only shows a notice to delete the older one instead of loading again.
2.0.1
- Updated the bundled libraries: Guzzle 8 for the connection with bunq. No change in behavior.
2.0.0
- Requires PHP 8.1 and WordPress 5.9 or newer. Shops on older versions stay on 1.11.0, which has the same features and fixes.
- The code uses PHP 8.1: typed properties, native parameter and return types and newer syntax. No change in behavior.
1.11.0
- New order action Send bunq payment link to customer: emails the customer a bunq.me link for an unpaid order, for example one taken by phone or sent as an invoice.
- The order screen shows who paid with bunq and how: the payer’s name and IBAN, the payment method and a link to the payment request.
- Warns in the admin when the connection with bunq stops working, with the details in WooCommerce > Status.
- Fix: payments are confirmed automatically again after selecting another bank account in the settings.
- Fix: pending orders are still confirmed after the bank account setting changes.
- Fix: a customer who places the order again no longer gets a second payment request; the open one is reused.
- Fix: a payment that comes in just before WooCommerce cancels the unpaid order is recorded on the order, so it can be refunded.
1.10.0
- The iDEAL | Wero, card and Bancontact logos are shown at checkout, in the classic and the block checkout.
- New setting Show payment methods separately: iDEAL | Wero, card and Bancontact each appear as a payment option of their own at checkout, with their own logo, and take the customer straight to that method on bunq.me. Off by default.
- iDEAL is shown as “iDEAL | Wero” for the move of iDEAL to Wero. Saved settings and existing orders keep working.
- bunq is no longer offered at checkout when the cart or order is not in euros; bunq.me payment requests are in euros only.
1.9.2
- New filter
bunq_for_woocommerce_permitted_ipsto register the IP addresses bunq accepts the shop’s API key from. Shops on hosts that send outgoing requests from several addresses (load balanced or serverless hosting) can list all of them, so bunq no longer rejects the connection with “Incorrect API key or IP address” when a request comes from another address of the host. Click Connect again after setting the list.
1.9.1
- When bunq’s callback and the customer’s return to the shop checked the same order at the same moment, both could record the payment: the bunq payment id and account were stored twice on the order, the “bunq payment received” note was added twice and the payment completion (status change, emails) ran twice. Only one check of an order runs at a time now, and a check that finds the payment already recorded leaves the order alone.
1.9.0
- The plugin talks to the bunq API with its own client instead of the bunq PHP SDK. The plugin zip is about 98,000 lines of code smaller, PHP 8.4 and newer no longer report deprecations from it, and
opcache.save_comments=0no longer breaks the connection with bunq. - Fewer calls to bunq: loading the connection no longer lists the bank accounts on every request, and the default bank account is only looked up when no bank account is selected.
- When bunq ends a session early, the plugin opens a new one and repeats the rejected call. When bunq refuses a new session as well (for example after the server’s IP address changed), it reconnects with the saved access before any call went through, and not again for five minutes after a failed attempt.
- Connecting keeps the callback URLs other integrations registered on the bank account; before, they were replaced.
- The bank account select lists up to 200 accounts per type instead of 10.
- Existing connections keep working without connecting again.
1.8.1
- Servers whose PHP OPcache removes code comments (
opcache.save_comments=0) could not connect to bunq: the bunq SDK needs those comments to read bunq’s responses, and connecting failed with “Installation::getToken(): Return value must be of type bunq\Model\Core\Token, array returned”. The settings page now explains that the hosting provider has to setopcache.save_comments=1, before sending you to bunq and in the bank account select. opcache.save_comments=1is listed in the requirements.- Updated Dutch, French and German translations.
1.8.0
- Redesigned settings page: a Connection row shows whether the shop is connected to bunq and to which account, the redirect URL to register in the bunq app has a Copy button, and the fields are grouped into bunq account, Receiving payments and Checkout.
- “Connect to bunq” saves the settings and opens bunq’s QR code in one step; it replaces the “OAuth Authorization Request” button.
- New: Disconnect, which forgets the shop’s access to bunq and keeps the OAuth client so connecting again takes one click.
- The test mode checkbox switches the OAuth client and connection on the settings page right away, without saving first.
- The OAuth redirect URL is always the plugin settings page URL (
/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=bunq), however the page was opened. Before, extra parameters on the page URL could make bunq reject the authorization. - The browser no longer fills in the WordPress login password in the Client Secret field.
- Errors from bunq during the authorization show bunq’s error descriptions instead of the raw response, and the bank account select says when bunq rejected the saved connection.
- The payment method select of the direct gateway in the block checkout looks like the other checkout fields in every theme and has a “Payment method” label.
- Updated Dutch, French and German translations.
1.7.0
- Security: only an administrator returning from bunq to the plugin settings page can complete the bunq authorization, and only with the state of the authorization they started. Before, the authorization could be completed by requests from anyone.
- Security: the OAuth client secret, the client ID, the authorization code and the API key are kept out of the WooCommerce log, the PHP error log and the error shown on the settings page, also when bunq repeats them in an error.
- Security: the API key and the API context (which holds the private key) are no longer settings fields. They are not shown on the settings page or in the WooCommerce REST API, cannot be changed through either, and are stored apart from the settings without being loaded on every request. The OAuth client secret is no longer put in the settings page; leave the field empty to keep it.
- Security: callbacks arriving in quick succession for the same payment request make one request to bunq and queue a single follow-up check.
- Restructured the plugin into autoloaded, namespaced classes following the WordPress coding standards. Code that refers to the WC_Bunq_Gateway or WC_Bunq_WooCommerce_Block_Checkout classes keeps working.
- Requires WordPress 4.7 or newer and declares WooCommerce as a required plugin.
- Fix: the block checkout no longer fails with a fatal error on servers that do not meet the plugin’s requirements.
- Tested up to WordPress 7.1 and WooCommerce 11.2.
1.6.4
- Fix: no warning about the other mode’s OAuth client on the first save of the settings.
1.6.3
- Refunds are created as bunq draft payments that you approve in the bunq app.
1.6.2
- Fix: strip characters bunq rejects from the refund description.
1.6.1
- Fix: the payment method chosen at checkout opens directly on bunq.me again.
1.6.0
- Payments are confirmed when the customer returns to the shop and by background checks.
- Expired or cancelled payment requests cancel the order, and cancelled orders cancel their payment request.
- Refunds from the WooCommerce order screen.
- Dutch, French and German translations.
1.5.10
- Fix: order lookup and amount check of bunq’s callback, and registration of the callback URL.
1.5.9
- Fix: the settings fields are defined outside the admin as well.
1.5.8
- Supports PHP 7.3 up to 8.5.
1.5.7
- Updated Guzzle and the OAuth client library.
1.5.6
- Errors from bunq during the OAuth setup are shown instead of silently ignored.
Follow this listing's changes (Atom feed)