BlockchainAppMaker Get a quote

DeFi

Crypto payment gateway development for e-commerce: stablecoin checkout, refunds and treasury

Crypto payment gateway development means building the software that lets an online store accept crypto, usually stablecoins, and match each payment to an order. This guide explains how such a gateway works, when a store should build one instead of using a processor, and what refunds, treasury and compliance require.

For most online stores, DeFi tools help with payments in three places: a store can accept stablecoins at checkout, receive funds within minutes without card chargebacks, and hold or convert the balance afterward. Loyalty tokens and on-chain merchant loans are optional extras.

Where crypto payments fit in an online store

An online sale has four stages: the customer pays, the merchant receives the funds, the merchant holds a balance, and the merchant spends or converts it. The table shows the crypto option for each stage.

StageCrypto optionWhat it replacesRisk or limit
CheckoutStablecoin payment, such as USDC or USDT, from the customer's walletCard paymentWallet steps confuse some customers, and some send funds on the wrong network
SettlementDirect on-chain transfer or a payment contractCard settlement over several daysNo built-in refund or dispute process
HoldingStablecoin treasury, optionally in a lending market or a tokenized treasury fundBank operating accountSmart contract risk and issuer risk
SpendingSupplier payments or conversion to a bank accountWire transfers and currency exchangeConversion fees and tax records

How a crypto payment gateway works

Volatile coins such as BTC and ETH are awkward for retail sales, because the price moves between the quote and the payment and the merchant carries that risk. Stablecoins pegged to the dollar or the euro avoid most of this problem. A typical stablecoin checkout runs in five steps:

  1. The store's back end creates a payment request with an amount, a token, a chain and an expiry time.
  2. The checkout page shows the request as a wallet link or a QR code.
  3. The customer pays from a wallet.
  4. The gateway watches the chain for the transfer and waits for enough confirmations.
  5. The gateway marks the order as paid and notifies the store through a webhook.

The main components of a gateway are a payment API for the store, a hosted checkout page, a chain watcher, a database that matches payments to orders, a merchant dashboard and, optionally, a conversion service that turns stablecoins into bank money.

Non-custodial or custodial crypto payment gateway

Non-custodial gatewayCustodial gateway
Where funds goStraight to a wallet the merchant controlsTo wallets the gateway operator controls
Payment matchingA payment contract, a small smart contract that forwards funds to the merchant, records the order ID. Or the gateway creates a new address for each order from the merchant's public key.The operator assigns a deposit address per order
Conversion to bank moneyThe merchant arranges it separatelyThe operator converts and pays out
Risk if the operator failsMerchant funds are not at riskMerchant funds can be lost or frozen
LicensingUsually a lighter burden, because the operator never holds fundsUsually needs a license, such as money transmission in the US or crypto-asset service provider (CASP) status in the EU

A non-custodial crypto payment gateway suits merchants who can manage their own wallet keys. A custodial gateway suits merchants who want to receive bank money and never touch crypto.

Design details for stablecoin checkout

  • Choose low-fee chains, such as a major Ethereum layer 2, Solana or Polygon. A $20 purchase should not carry a large gas fee. The layer 2 scaling article compares the options.
  • Match payments to orders reliably. Use a unique deposit address per order, or a payment contract that records the order ID.
  • Support signed transfers. USDC implements EIP-3009, whose transferWithAuthorization function lets a customer sign a transfer while a relayer, a service run by the merchant or gateway, pays the network fee (gas). Uniswap's Permit2 contract offers signed transfers for other tokens, so customers do not need to hold the chain's native token.
  • Set rules for wrong amounts and late payments. Show the rules for overpayment, underpayment and expired requests before the customer pays.
  • Plan for wrong-network transfers. State clearly which chain the request uses, and decide in advance whether the store will try to recover funds that arrive on another chain.
  • Screen addresses. Check paying addresses against sanctions lists, because a merchant must not accept funds from sanctioned parties.

Crypto payment gateway development or a processor

Large payment processors now accept stablecoins. Stripe, for example, accepts USDC on Ethereum, Solana, Polygon, Base and Tempo. Stripe settles the payment in the merchant's local currency, returns refunds as stablecoins to the customer's wallet and limits each stablecoin transaction to $10,000. Businesses in the US can use the feature, and businesses in the EU and several other regions can join a private preview.

A processor is the faster route for most merchants. Custom crypto payment gateway development makes sense in three cases:

  • The business needs a custom payment flow, such as on-chain escrow or split payments in a marketplace.
  • The business processes enough volume that processor fees exceed the cost of running its own gateway.
  • The business wants a non-custodial setup in which funds go straight to its own wallets.

Escrow, refunds and disputes

On-chain payments are final, which merchants like and some customers do not. A store that sells to consumers must still give refunds under consumer law.

An escrow contract can hold funds until the buyer confirms delivery or a time limit passes, and a named arbiter decides disputes. For marketplaces with independent sellers, escrow is often the most useful on-chain feature: the marketplace does not hold the funds itself, and buyers and sellers can both read the escrow rules in the contract.

Merchant treasury and financing

A merchant with a stablecoin balance can try to earn yield on it. Options range from supplying to an established lending market to holding tokenized money-market or treasury funds. Each option adds risk, such as smart contract exploits, oracle failures, and issuer or custodian failure. Keep operating balances simple, and put only surplus funds to work, within strict limits.

The US GENIUS Act, signed in July 2025, bars issuers of payment stablecoins from paying interest to holders, so any yield comes from a separate product with its own risks. The DeFi lending guide explains how lending markets produce yield and where they can fail.

On-chain receivables financing also exists: a merchant turns expected future sales into tokens and sells them to lenders. It is young and mostly serves merchants who already take large volumes of on-chain payments.

Loyalty tokens

A store can issue loyalty points as tokens that customers can transfer, trade and use at partner stores. Tradable points also create risk: a tradable token with a market price may count as a financial instrument, and speculation can distort the program. Points that cannot be transferred, or NFTs used as receipts and membership passes, carry less risk. The NFTs in e-commerce guide covers those uses.

Compliance

  • Accepting payment for your own goods usually needs no special license in most countries.
  • Holding or transferring funds for others often does, and a marketplace or a custodial gateway may be a money transmitter in the US. In the EU, custody and transfer of crypto-assets for clients are CASP services under the Markets in Crypto-Assets Regulation (MiCA).
  • Payer and payee data. EU crypto-asset service providers must send payer and payee details with each transfer under the EU Transfer of Funds Regulation, in force since 30 December 2024.
  • Tax records. For tax, each receipt and each conversion needs a fiat value at the time of the transaction.
This page is general information, not legal, tax or financial advice. Payment, money transmission and tax rules differ by country. Ask a lawyer before you launch a gateway that holds funds for others.

Steps to add crypto payments to an online store

  1. Decide whether to use a processor. Compare fees, supported chains, conversion to fiat and settlement times.
  2. If you build, start small. Support one stablecoin on one low-fee chain, with a back end that tracks confirmations and reconciles orders.
  3. Add refunds and escrow before you promote the payment option widely.
  4. Set treasury rules. Decide how much to hold on-chain, where to hold it, and who controls the keys. A multisig wallet, or an MPC wallet that splits the key into shares, is the usual choice. The DeFi wallet development guide compares wallet types.
  5. Connect the payments to accounting. Record the fiat value of every receipt and conversion for tax.

Frequently asked questions

What is a crypto payment gateway?

A crypto payment gateway is software that lets a merchant accept crypto payments. It creates payment requests, watches the blockchain for each transfer, confirms the order and, in some designs, converts the crypto into bank money.

What is a non-custodial crypto payment gateway?

In a non-custodial gateway, payments go straight to wallets the merchant controls, and the gateway operator never holds the funds. The merchant manages the keys and arranges any conversion to bank money.

Do customers pay with stablecoins?

A minority of customers do, mostly cross-border buyers and people who already use crypto. Offer stablecoins as an extra option next to cards, not as a replacement.

Are crypto payments for e-commerce cheaper than cards?

On low-fee chains the transfer itself costs little, but conversion fees, processor fees and support for failed payments add to the total. Compare the full cost, not only the network fee.

Can a merchant avoid chargebacks completely?

A payer cannot reverse an on-chain transfer, but consumer protection rules still require fair refunds, and fraudulent orders still happen.