Description
SablePay lets your customers pay in stablecoins by scanning a QR code with their phone or clicking to pay on the same device. The plugin handles the whole payment flow for you:
- A payment is created through the SablePay API.
- A payment window opens with the amount, a QR code and an expiry countdown.
- The plugin checks the payment status automatically until it is completed, failed or expired.
- The customer sees a success or failure screen, and your site can react to the result.
Features
- Payment button shortcode: add
[sablepay_button amount="10.50"]to any page or post. No code needed. - Ready-made payment window: QR code, converted stablecoin amount, “click to pay” link and an expiry countdown.
- Live status tracking: checks every 3 seconds for the first minute, then backs off to every 10 seconds.
- Secure by design: your API key is stored on your server and is never sent to visitors’ browsers. Browser requests go through your own site (
/wp-json/sablepay/v1/), protected by a nonce and per-IP rate limits. - Sandbox and live modes: the environment is detected from your API key.
- Connection test: check your credentials from the settings screen.
- Developer SDKs: a JavaScript SDK (
window.SablePay) and a PHP SDK (sablepay()), with the same API as the SablePay Angular, React and Android SDKs. - Hooks for fulfilment:
sablepay_payment_completed,sablepay_payment_created,sablepay_create_payment_requestand more. - No external scripts: the QR code encoder and all assets are included in the plugin.
Shortcode
[sablepay_button amount="10.50" label="Pay with SablePay" item="Coffee" metadata="order_id:123" success_url="/thank-you/"]
amount(required): payment amount, 0.01 to 1,000,000.label: button text.item/quantity: optional line item sent with the payment.metadata: optionalkey:valuepairs, separated by commas.success_url: where to send the customer after payment.?sablepay_payment_id=…is added to the URL.
For developers
// JavaScript (enqueue with sablepay_enqueue() in PHP)
SablePay.initializeFromWordPress();
SablePay.launchPayment(
{ amount: 10.5, metadata: { order_id: '123' } },
{ onSuccess: (r) => console.log(r.transactionHash), onFailure: (e) => console.log(e.message) }
);
// PHP: always verify on the server before fulfilling an order
$status = sablepay()->getPaymentStatus( $payment_id );
if ( \SablePay\PaymentStatus::isCompleted( $status['status'] ) ) { /* fulfil */ }
Hooks and filters: sablepay_payment_created, sablepay_payment_status_checked, sablepay_payment_completed, sablepay_create_payment_request, sablepay_rest_permission, sablepay_rest_require_nonce, sablepay_rate_limits, sablepay_settings, sablepay_client_config.
External services
This plugin connects to the SablePay payment API, operated by SablePay, to create stablecoin payments and check their status. This connection is required: the plugin cannot take payments without it.
When data is sent
- When a visitor clicks a SablePay payment button, or your site calls
SablePay.launchPayment(), the plugin creates a payment. - While the payment window is open, the plugin checks the payment status every few seconds until the payment finishes.
- When an administrator clicks “Test connection” on the settings screen, the plugin fetches the most recent payment.
- When your own code calls the PHP SDK (for example
sablepay()->getPaymentStatus()).
What data is sent
- Your SablePay API key and Merchant ID, sent from your server only and never exposed to visitors.
- The payment amount, any line items (name, quantity, price, SKU) and any metadata you add (for example an order ID).
- Payment IDs, when checking a payment’s status.
The plugin does not send visitors’ names, email addresses or IP addresses to SablePay. Requests go from your web server to:
- Sandbox:
https://sandbox-api.sablepay.io/api/v1/ - Production:
https://api.sablepay.io/api/v1/ - or a custom API base URL that you set on the settings screen.
The customer completes the payment on SablePay’s payment page, which is linked from the QR code, using their own wallet.
- SablePay Terms of Service: https://www.sablepay.io/terms-of-service
- SablePay Privacy Policy: https://www.sablepay.io/privacy-policy
Third-party libraries
- qrcode-generator 1.4.4 by Kazuhiko Arase, MIT License: https://github.com/kazuhikoarase/qrcode-generator
Screenshots


Installation
- In your WordPress admin, go to Plugins Add New Plugin, search for SablePay, then click Install Now and Activate.
- Go to Settings SablePay.
- Enter your API Key (
sable_sk_sand_…for sandbox,sable_sk_live_…for production) and your Merchant ID. You can find both in your SablePay dashboard. - Click Save Changes, then Test connection.
- Add
[sablepay_button amount="10.00"]to any page.
Optional: define the credentials in wp-config.php instead. Values defined there override the settings screen:
define( 'SABLEPAY_API_KEY', 'sable_sk_live_...' );
define( 'SABLEPAY_MERCHANT_ID', 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' );
FAQ
-
Do I need a SablePay account?
-
Yes. Sign up at https://www.sablepay.io to get an API key and Merchant ID. Use a sandbox key (
sable_sk_sand_…) for testing. -
Which coins and networks are supported?
-
That depends on your SablePay account. Customers can pay with the stablecoins and networks enabled for your merchant account. The token and network actually used are shown on the success screen.
-
Is my API key safe?
-
Yes. The key is stored on your server and is only used for server-to-server requests. Visitors’ browsers talk to your own site’s REST endpoint, never directly to SablePay with your key.
-
How do I know a payment was really completed?
-
Don’t rely only on the browser’s success screen. Check the status on the server with
sablepay()->getPaymentStatus( $id ), or use thesablepay_payment_completedaction. The plugin provides both. -
Can I control the amount on the server?
-
Yes. Use the
sablepay_create_payment_requestfilter to recalculate the amount (for example from an order), or return aWP_Errorto reject the request. -
My page cache serves old pages and payments fail with “session has expired”
-
Exclude pages with payment buttons from your page cache, or use the
sablepay_rest_require_noncefilter (rate limiting still applies). -
Does it work with WooCommerce?
-
This version provides a payment button, the payment window and developer SDKs. A WooCommerce payment gateway isn’t included yet. Developers can build one with the PHP and JavaScript SDKs.
Reviews
Contributors & Developers
“SablePay” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “SablePay” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.13
- Fix: use the correct SablePay API endpoints (
https://api.sablepay.io/api/v1/andhttps://sandbox-api.sablepay.io/api/v1/).
1.3.12
- Initial release on WordPress.org.
- Payment window with QR code, live status tracking and expiry countdown.
[sablepay_button]shortcode.- Secure REST proxy, so the API key never reaches the browser.
- JavaScript and PHP SDKs, with the same API as the SablePay Angular SDK.
- Settings screen with connection test, plus
wp-config.phpoverrides.
