WooCommerce Plugin
Accept Bitcoin on-chain and Lightning payments in your WooCommerce store via LNbits.
eCommerce Plugin
This is an eCommerce plugin, not an LNbits extension. It runs inside WordPress / WooCommerce and connects to your LNbits server via its API.
Introduction
This WooCommerce extensions lets you accept onchain and lightning Bitcoin payments using the LNbits Satspay Server extension.
Follow the instructions at https://github.com/lnbits/woocommerce-payment-gateway/blob/main/README.md to configure and setup the plugin.
You will need access to an LNbits instance to use this plugin. You can use the demo LNbits instance at https://legend.lnbits.com/ to test this plugin.
License
This plugin is released under the MIT license.
Installation
LNbits configuration
Open your LNbits instance e.g. https://demo.lnbits.com/
Create a new wallet, or use an existing wallet if you already have one you want to use

From the sidebar, take a note of the Wallet ID and Invoice/read key. You will need this later

Click manage extensions in the sidemenu and enable the Satspay Server and Watch Only extensions



Open the Watch Only extension and import an xpub/ypub/zpub to add a new watch only wallet

Take a note of the watch only wallet ID that has been created. You will need this later

That's it. Now, let's set up the WooCommerce plugin!
WooCommerce Plugin Setup
Install the plugin using your Wordpress admin panel by searching for "LNbits - Bitcoin Lightning and Onchain Payment Gateway" or drop this repo into your wp-content/plugins directory
Activate the plugin
Open WooCommerce > Settings > Payments and activate the LNbits payment method, then click manage.

Edit the Title and Description fields as you want
Enter the LNbits URL for your LNbits server and paste in your settings for the Invoice/Read Key, Wallet ID and Watch Only Extension Wallet ID

Click "Save changes"
Development
To build the blocks integration:
- Install dependencies:
npm install- Build the assets:
npm run buildFor development, you can use:
npm run start
The key changes in this update are:
1. Added support for WooCommerce Blocks API through a new `LNbitsPaymentMethod` class
2. Created a React component for the checkout block interface
3. Set up the necessary build process for JavaScript assets
4. Maintained compatibility with the existing classic checkout while adding support for the new blocks checkout
To implement this update:
1. Create the directory structure:
```bash
mkdir -p blocks/src blocks/build
2. Create all the files mentioned above
3. Install the Node.js dependencies
4. Build the JavaScript assets
5. Test the integration in both classic and block-based checkout pages
The updated plugin will now work with both:
- Classic WooCommerce checkout
- New WooCommerce Blocks checkout
The payment flow remains the same, but the integration is now compatible with the modern block-based checkout experience. The plugin will continue to:
1. Create a SatsPay charge when an order is placed
2. Redirect to the LNbits payment page
3. Handle payment confirmation through webhooks
### Acknowledgements
This plugin is a fork of Phaedrus' original [LNBits For WooCommerce](https://gitlab.com/sovereign-individuals/lnbits-for-woocommerce).
Thank you to Phaedrus for the work on the original plugin on which this plugin leans heavily.
## Links
- [GitHub repository](https://github.com/lnbits/lnbits-bitcoin-onchain-and-lightning-payment-gateway)
- [Download latest release](https://github.com/lnbits/lnbits-bitcoin-onchain-and-lightning-payment-gateway/releases)
- [WordPress plugin page](https://wordpress.org/plugins/lnbits-bitcoin-onchain-and-lightning-payment-gateway/)
- [Announcement](https://news.lnbits.com/news/lnbits-woocommerce-plugin-for-bitcoin-payments)
## Related Pages
- [Plugins Overview](/plugins/) - all eCommerce plugins
- [API Reference](/api/) - LNbits API that plugins connect to
- [Authentication](/api/authentication) - how to authenticate API calls
- [Fiat Payments](/guide/core/fiat-payments) - accepting fiat alongside Lightning