CPPay WordPress Plugin
A WordPress plugin by CPPay to accept crypto payments, enable token-based monetization (x402), and power on-chain commerce.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/springmint/cppay-wordpress-plugin/archive/refs/heads/main.zipCreate and query crypto payments in WordPress via the CPPay API without exposing your API key on the frontend.
Installation
Reference: https://www.cppay.finance/docs/zh/guide/wordpress-plugin.html
Features
- Configure API key from the WooCommerce payment settings via the Manage button
- Register a WooCommerce payment gateway so
CPPayappears at checkout - Create OTT after order placement and redirect to the hosted page:
https://www.cppay.finance/payment/{ott} - Provide a WooCommerce webhook callback endpoint and automatically update order status after payment
- Support shortcode-based payment component insertion
- Support one-time payment "instant" and subscription payment "subscription"
WooCommerce Checkout Flow
After enabling the gateway, CPPay appears as a payment method at checkout.
Settings page URL examples:
wp-admin/admin.php?page=wc-settings&tab=checkout(legacy)wp-admin/admin.php?page=wc-settings&tab=checkout§ion=cppay_gateway(gateway manage page)wp-admin/admin.php?page=wc-settings&tab=payments(new UI)
Checkout behavior:
- Customer selects
CPPay - Plugin calls
POST /api/payment/ott/createwithAuthorization: ApiKey {api_key} - Customer is redirected to
https://www.cppay.finance/payment/{ott} - Thank You page keeps the OTT link as fallback
- On webhook callback, the plugin verifies payment status and updates WooCommerce order to
completedorfailed
Shortcode
[cppay_payment plain="instant" amount="10" order_prefix="blog" title="Pay with Crypto"]
Subscription example:
[cppay_payment plain="subscription" amount="9.99" interval_days="30" order_prefix="sub"]
API Alignment with cppay-sdk
The plugin PHP client aligns with interfaces in cppay-sdk/src/assets/request.ts:
GET /api/payment/tokenPOST /api/payment/createGET /api/payment/queryPOST /api/subscription/createGET /api/subscription/query
It also maps response fields to SDK-style names such as paymentId, subscriptionId, paymentAmount, expireAt, and status.