Skip to content

​Before you take real money

  • Use a production RPC provider. Public endpoints are rate-limited and not meant for production traffic. See RPC providers.
  • Swap devnet values for mainnet ones. Set RPC_URL, RPC_SUBSCRIPTIONS_URL and USDC_MINT from the table below. If you also show the Solana Pay QR code from step 2, point its RPC URLs and splToken at mainnet too.
  • Create the store’s USDC account first. The payment goes to the store wallet’s USDC token account. If that account doesn’t exist, the transfer fails. Opening it costs a small refundable deposit (see rent below).
  • Match payments to orders with a reference. Give every order a fresh reference, attach it to the payment as payStore does, and check it, as verifyPayment does. Never match by amount alone: two customers can pay $20 at the same moment.
  • Record each signature once. Enforce it in your database with a unique constraint, so a reused signature can’t confirm a second order.
  • Handle expired and failed transactions. A transaction expires if it isn’t confirmed within 150 blocks of its recent blockhash, about 30 seconds at 200ms slots. Let the customer retry, which builds a new transaction.
  • Fulfill only finalized payments. Never act on processed: its block can still be skipped. Fulfill an order once its payment is finalized. On mainnet that takes roughly 150 milliseconds, and confirmed, which verifyPayment checks, reports the same block, so that check already meets this rule. See settlement and finality.
  • Use notifications instead of polling. See Indexing and webhooks.
  • Decide who pays network fees. See fee sponsorship below.

​Devnet vs mainnet values

SettingDevnet (testing)Mainnet (real money)
RPC_URLhttps://api.devnet.solana.comYour RPC provider’s HTTPS URL
RPC_SUBSCRIPTIONS_URLwss://api.devnet.solana.comYour RPC provider’s WebSocket URL
USDC_MINT4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU (Explorer)EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v (Explorer)
USDC decimals66
MoneyFree test USDC from the Circle faucetReal USDC
Both mint addresses are Circle’s official USDC. Check the mint in verifyPayment, as the example does: anyone can create a token called “USDC”, but only these mints are the real thing.

​Who pays the network fee

In this tutorial the customer’s wallet pays the fee, 5,000 lamports (0.000005 SOL), so the customer needs a little SOL as well as USDC. If your customers only hold dollars, pay the fee for them. To sponsor fees, make your server the transaction’s fee payer. The customer still signs the transfer, and your fee-payer key signs for the fee. Kora runs that fee payer as a service, with validation rules, rate limits, and the option to charge the fee back in USDC. The fee abstraction guide shows both approaches. Rent matters more for refunds and payouts: sending USDC to a customer who has never held it opens a USDC account for them, and the sender pays that deposit.

​You built a working checkout

You paid as a customer, read the payment code your checkout sends, and verified payments from your own server. From here: