WooCommerce Plugin
The Open Pay for WooCommerce plugin lets WordPress/WooCommerce stores accept cryptocurrency payments (USDT, USDC, BNB) that settle in LKR. Customers are redirected to a hosted checkout page to complete payment.Requirements
- WordPress 6.0+
- WooCommerce 8.0+
- PHP 8.1+
- An Open Pay merchant account with API credentials
Installation
1
Download the Plugin
Download the plugin from the GitHub repository or clone it:Alternatively, download the
openpay-gateway folder and upload it to wp-content/plugins/.2
Activate the Plugin
In your WordPress admin panel, go to Plugins > Installed Plugins and activate Open Pay for WooCommerce.
3
Configure API Credentials
Navigate to WooCommerce > Settings > Payments > Open Pay and enter your credentials:
The API key field expects both the key ID and secret combined with a dot separator:
ak_live_xxx.sk_live_yyy. Get this from the Merchant Portal under Integrations.4
Configure the Webhook
In the Open Pay Merchant Portal, configure your webhook URL to:Subscribe to these events:
payment.paidpayment.expiredpayment.failed
How It Works
1
Customer Checkout
The customer selects “Pay with Crypto” at checkout and clicks Place Order.
2
Session Creation
The plugin creates a checkout session via the Open Pay API with the order total, currency, line items, and callback URLs. The request is signed with HMAC-SHA256.
3
Redirect
The customer is redirected to the hosted Open Pay checkout page where they can select a cryptocurrency and complete payment.
4
Webhook Confirmation
When payment is confirmed on-chain, Open Pay sends a webhook to your store. The plugin updates the WooCommerce order status automatically.
Checkout Session Payload
The plugin sends this data when creating a checkout session:HMAC-SHA256 Request Signing
Every API request is signed automatically by the plugin:Order Status Mapping
The plugin maps Open Pay webhook events to WooCommerce order statuses:Supported Currencies
The plugin sends the WooCommerce order currency to Open Pay. Supported fiat currencies for pricing:
Customers can pay with any supported cryptocurrency regardless of the store currency:
HPOS Compatibility
The plugin declares compatibility with WooCommerce High-Performance Order Storage (HPOS / Custom Order Tables). It works with both the legacywp_posts storage and the modern wp_wc_orders table.
Troubleshooting
Plugin shows 'WooCommerce required' error
Plugin shows 'WooCommerce required' error
WooCommerce must be installed and activated before the Open Pay plugin. Go to Plugins and ensure WooCommerce is active, then deactivate and reactivate Open Pay.
'API request failed' on checkout
'API request failed' on checkout
Check that your API key is correctly formatted as
ak_live_xxx.sk_live_yyy in the plugin settings. Also verify that the API Base URL is reachable from your server. Test with:Webhooks not updating order status
Webhooks not updating order status
Verify these items:
- Webhook URL is set correctly in the Merchant Portal:
https://yourstore.com/wc-api/openpay_webhook - HTTPS is required — webhooks will not be sent to HTTP endpoints
- Firewall is not blocking incoming POST requests from Open Pay servers
- Check WooCommerce > Status > Logs for any error messages
Order stuck in 'Pending payment' status
Order stuck in 'Pending payment' status
This means the webhook has not been received yet. Possible causes:
- The customer did not complete payment on the checkout page
- The webhook URL is misconfigured
- The checkout session expired (default: 15 minutes)
'Unknown error' from Open Pay API
'Unknown error' from Open Pay API
Enable WordPress debug logging to see the full API response:Check
wp-content/debug.log for detailed error messages from the Open Pay API.