Create and query crypto payments in WordPress via the CPPay API without exposing your API key on the frontend.
Reference: https://www.cppay.finance/docs/zh/guide/wordpress-plugin.html
- 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"
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
[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"]
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.