Accept Bitcoin and Lightning
Start accepting Bitcoin, Lightning and Liquid today — Powered by Zaprite.
This plugin allows stores that use Wordpress WooCommerce shopping cart system to accept Bitcoin and Bitcoin through Lightning Network via Zaprite.
In order to use this plugin you have to create an account on https://app.zaprite.com
- Upload the zipped
zaprite-payment-gateway
folder to the/wp-content/plugins/
directory (or in Plugins > Add New > Upload). - Activate the plugin through the 'Plugins' menu in WordPress.
- Go to WooCommerce > Settings > Payments.
- Click on 'Zaprite' to configure the payment gateway settings.
To develop locally, you can run wordpress locally with docker. This will run
wordpress on port 8000 with debugging enabled. It will also mount your local
./plugin
directly in the wordpress plugins
directory so that you can edit
and see the result of your changes directly in wordpress.
First, you'll need to run the docker containers:
cd wordpress-docker
docker-compose up -d
Then you'll need to:
- Make sure you have
zaprite-v2
project running on http://localhost:3000 open http://localhost:8000
- Follow the WordPress installation instructions
- Install and configure the WooCommerce plugin: http://localhost:8000/wp-admin/plugin-install.php?s=woocommerce&tab=search&type=term
- Add a product in woo commerce so that you can test payments
- Activate Zaprite plugin: http://localhost:8000/wp-admin/plugins.php
- Configure zaprite plugin:
http://localhost:8000/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=zaprite
- Check "Enable payments via Zaprite Checkout"
- Enter your Zaprite API key
You can now test the plugin by creating an order in your shop: http://localhost:8000/shop/
If you prefer using another way to run Wordpress locally, like
Local by Flywheel, you can clone this git repo anywhere
you want then just create a symlink to the plugin
directory:
ln -s <path to the cloned repo>/zaprite-for-woocommerce/plugin <path to local wordpress>/wp-content/plugins/zaprite-payment-gateway
Currenly there is no way to manage env variables if you use Locals by Flywheel,
and there appears to be timing issues if you use the wp-config.php file. So to
test locally edit zaprite.php
define('ZAPRITE_APP_URL', getenv('ZAPRITE_APP_URL') ? getenv('ZAPRITE_APP_URL') : 'http://localhost:3000' );
Also make sure you turn on debugging: Edit the wp-config.php
File. Look for
the line that says define('WP_DEBUG', false);
. If it's not there, you'll need
to add it. And change it to true. Then restart your site. This should create a
debug.log file in wp-content
If you want to edit the UI for the Blocks checkout you need to compile the javascript code:
- cd plugin
npm i
npm run build
npm run start
- This will run webpack and generate files to
assets/js/frontend/blocks.js
andassets/js/frontend/blocks_assets.php
. After you see successwebpack 5.89.0 compiled successfully in 27 ms
and can cntl+x - Now you can use the plugin like normal
- If you want to update the javascript/html for the payment checkout UI then
modify
resources/js/frontend/index.js
and runnpm run start
** if you get errors with php composer
you might have to install it via
brew install composer
Docs: https://github.com/woocommerce/woocommerce-gateway-dummy
cd plugin && npm run lint
or
php ./vendor/bin/phpcbf --standard=WordPress --ignore=*.js ./plugin