Solana Pay for WooCommerce: accept USDC and mark orders paid automatically

WooCommerce has no built-in Solana Pay gateway. You don't need a heavy plugin, though: an offline payment method, a thank-you page hook and a small verifier are enough.

1. How it works

  1. Customer checks out with an offline method renamed "Solana Pay (USDC)". The order goes on hold.
  2. The thank-you page shows a Solana Pay URL: solana:<your address>?amount=<order total>&spl-token=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&reference=<unique key>, as a QR code.
  3. A verifier looks up transactions that include the reference key and checks that your USDC balance rose by at least the order total.
  4. When it confirms, call $order->payment_complete($signature).

2. The thank-you hook

add_action('woocommerce_thankyou', function ($order_id) {
  $order = wc_get_order($order_id);
  if ($order->is_paid()) return;
  // 1) create + store a reference on the order (_solpay_ref)
  // 2) build the solana: URL with the order total
  // 3) render a QR and poll an AJAX endpoint
});

3. Verify on the server, never in the browser

Your AJAX handler should check the order key, call the verifier with the server-side order total, and only then mark the order paid. Use getSignaturesForAddress(reference), then getTransaction with jsonParsed, and compare preTokenBalances with postTokenBalances for your address and the USDC mint.

4. Gotchas

The Pro Kit ships this as a ready PHP plugin file plus the matching /api/ref and /api/verify-amount worker routes.

Skip the wiring: the Drop-In Kit (7 USDC) has the checkout and verifier; the Pro Kit (29 USDC) adds a cart, receipts and a dashboard; or have it installed.

Payments are on-chain and final; if delivery fails, email smallbizaicourses@gmail.com with your order reference. Software provided as is. Not financial advice.