SolanaPayWPDemo.mov
This is a proof of concept for running Solana Pay on Wordpress / WooCommerce.
It is currently in development. NOT ready for production unless you're ready to mess around.
To add the plugin to your WooCommerce store:
- Define your SOL receiver address in your .env file by adding
SHOP_SOL_ADDRESS={YOURADDRESS}andSOL_ENV=to be the SOL environment. SHOP_SOL_ADDRESS is where payment will go. - Browse to the plugins page. Should look like https://{YOUR_STORE}/wp-admin/plugins.php
- Install npm dependencies
- Build the zip:
npm run zip - Upload the zip file as a plugin and activate it.
All of the logic on rendering lies in backend-scripts.tsx. You'll need to customize it to recognize which pages to add the SOL button for.
You can either fire based off a particular DOM element, or look for a product title. We'll have better WooCommerce integration soon.
Next, pass in the payAmount and payCurrency (SOL for now), to show the Pay button.
The Solana Pay Button currently uses @solana/wallet-adapter-react and a basic button. Setting it up takes place in solana-pay-button.tsx.
Why build this plugin for Wordpress instead of Shopify? Well a couple of reasons:
- Wordpress is open-source.
- There's already a Solana Pay shopify integration at https://solanapay.com.
- Shopify Pay required partners to be approved to build payment apps. I believe there's some revenue share with Shopify going on.
If the point of Solana is to reduce payment processing fees, why pay Shopify's revenue share?
Apache License 2.0