Skip to main content

WordPress (WooCommerce)

The WooCommerce gateway uses bnbpay-api to create invoices and confirm stablecoin payments.

Flow overview

  1. Customer selects BNBPay (Stablecoins) at checkout.
  2. Plugin calls POST /invoices to create an invoice.
  3. Customer pays using Permit2/EIP-2612/EIP-3009 via /payments/build-intent + /relay/payment.
  4. Plugin listens to GET /invoices/:invoiceId/stream-sse and updates WooCommerce order status.

Notes:

  • EIP-3009 authorizations use an intent-derived authNonce; custom clients should derive it from the intent hash + router + chainId.

Required settings

  • BNBPay API base URL
  • Relay API key (if relay auth enforced)
  • Stablecoin allowlist per network

Stablecoin enforcement

  • Reject native BNB (0x000...000).
  • Allowlist stablecoins per network (USDT/USDC/USD1/WUSD/XUSD as configured).

Admin tools

  • Create invoice from an order if not already linked.
  • View invoice status + transaction hash.
  • Update order status when paid, expired, or cancelled.

Endpoints used

  • POST /invoices
  • GET /invoices/:invoiceId
  • GET /invoices/:invoiceId/status
  • GET /invoices/:invoiceId/stream-sse
  • POST /payments/build-intent
  • POST /relay/payment
  • GET /networks