Skip to main content

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.
WooCommerce must be installed and active before activating the Open Pay plugin. The plugin will show an error notice if WooCommerce is not found.
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.paid
  • payment.expired
  • payment.failed
The webhook URL is displayed in the plugin settings page under the Webhook section for easy copying.

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:
The following headers are sent:

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 legacy wp_posts storage and the modern wp_wc_orders table.

Troubleshooting

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.
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:
Verify these items:
  1. Webhook URL is set correctly in the Merchant Portal: https://yourstore.com/wc-api/openpay_webhook
  2. HTTPS is required — webhooks will not be sent to HTTP endpoints
  3. Firewall is not blocking incoming POST requests from Open Pay servers
  4. Check WooCommerce > Status > Logs for any error messages
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)
Check the webhook delivery history in the Merchant Portal under Integrations > Webhooks.
Enable WordPress debug logging to see the full API response:
Check wp-content/debug.log for detailed error messages from the Open Pay API.