How to accept crypto payments on your website

A guide for a shop, a SaaS or a service that wants to take USDT, USDC, Bitcoin and other coins: the ways to do it, the wallet to start with, connecting your site, and what to check before the first real payment.

Three ways to take crypto

Whatever you choose, the buyer sends coins from their wallet or an exchange to an address. What differs is whose address it is, and who matches the payment to the order.

WayWhere the money landsWhat you runFee
A processor that holds the funds (NOWPayments, CoinGate, BitPay…)The processor’s wallet; it pays you out, often converted to dollars or eurosNothing: an account and their plugin or APIA share of each payment, and payout costs: five compared
Your own server (BTCPay Server)Your walletA server and, for Bitcoin, a node: updates, backups, uptimeNo processing fee; hosting and your time
A non-custodial gateway (Orboni and others)Your wallet, directlyNothing: an account and a plugin, a link or the API0.5% per completed payment (Orboni)

A processor that holds the money is the shortest way to dollars in your bank account, and the one where someone else can freeze it. Your own server keeps everything in your hands and costs time every month. A non-custodial gateway sits between: the coins reach your wallet as they are paid, and the gateway only tells your site which order they paid. How that works on each network.

Before you start: a wallet and the coins

  • Use a wallet you hold the keys of: a hardware wallet, or an app such as Trust Wallet, MetaMask, Phantom, Tonkeeper or Exodus. Write its recovery phrase down on paper; nobody, Orboni included, can bring it back.
  • Never give an exchange’s deposit address as your receiving address. Exchanges tell their customers apart in their own way, and a payment that does not carry their reference may never be credited to you.
  • Start with stablecoins. USDT and USDC are worth a dollar, so the price you show is the price you keep. On Orboni they are taken on Solana, TRON, Ethereum, BNB Chain, Base, Polygon, Arbitrum, Optimism, Avalanche, TON, and Stellar.
  • Look at what the buyer pays to send. For a stablecoin it is lowest on Solana (about $0.001), Stellar (about $0.001), and Base (about $0.01). The full list is on the networks page.
  • Add Bitcoin and other coins later, if your buyers ask for them: every coin you add is one more balance to watch.

On Solana a payment must come from a wallet, not from an exchange: the page tells the buyer so before they pay.

Connect your site

Pick by what your site is built on. All three end the same way: the buyer pays on a hosted payment page, and your site learns that the order is paid.

  1. 1A plugin, if your site runs on a platform that has one. No code: install it, paste a key, done. WooCommerce, Easy Digital Downloads, GiveWP, Magento 2, PrestaShop, OpenCart, Odoo, Blesta, FOSSBilling, Paymenter, XenForo.
  2. 2A payment link, if you sell a few things or send invoices by hand. Make the link in the dashboard and put it on a button, in an email or in a chat. Payment links.
  3. 3The API, if you write your own checkout. Two calls are enough: create a session, and read a webhook. Below.

With the API: create a session

When the buyer presses Pay, your server creates a checkout session with your secret key and sends the buyer to its url. Amounts are in cents. The official libraries retry a failed call without ever making a second session for the same order.

import Orboni from 'orboni';

const orboni = new Orboni(process.env.ORBONI_SECRET_KEY);

const session = await orboni.checkout.sessions.create(
  {
    amount: 2490, // $24.90
    currency: 'usd',
    client_reference_id: 'order_1042',
    success_url: 'https://shop.example/thanks',
    cancel_url: 'https://shop.example/cart',
  },
  { idempotencyKey: 'order_1042' },
);

res.redirect(session.url);

The buyer picks a coin and a network on the page and sees the amount at a rate held for 15 minutes.

With the API: mark the order paid

Do not mark an order paid because the buyer came back to your success page: they may close the tab first, or come back without paying. Wait for the signed checkout.session.completed webhook, check its signature, and fulfil the order once, by its client_reference_id.

app.post('/webhooks/orboni', express.raw({ type: 'application/json' }), async (req, res) => {
  let event;
  try {
    event = await orboni.webhooks.constructEvent(
      req.body,
      req.headers['webhook-signature'],
      process.env.ORBONI_WEBHOOK_SECRET,
    );
  } catch (error) {
    return res.status(400).send(error.message);
  }
  if (event.type === 'checkout.session.completed') {
    // fulfil event.data.object.client_reference_id, once
  }
  res.sendStatus(200);
});

More in the docs: the libraries and webhooks.

Test without real money

Everything above works with a test key first. A test payment goes over a coin’s test network, or, where there is none, through a button that simulates the payment. Your site gets the same webhooks as from a real one. Testing without real money.

Before the first real payment

  • Confirm your email address and switch the project to live mode; create a live key and a live webhook endpoint.
  • Check the receiving address once more, on the wallet itself. A payment sent to a wrong address cannot be called back.
  • Set the support email buyers see on the payment page: they write there when a payment went wrong.
  • Decide what a short payment is worth: by default a payment up to 1% short counts as paid, and the page asks for the rest of a larger gap.
  • Decide what to do with a late one: a payment that arrives after the page closed is still seen for 24 hours, then accepted or held for you.
  • Refunds in crypto are a transfer you send from your wallet: ask the buyer for their address in writing.
  • Make one real payment to yourself, a dollar or two, before you announce it.

What it costs

  • Orboni: 0.5% of each completed live payment, invoiced once a month once it reaches $1. Nothing is taken out of the payment on its way to you.
  • The buyer pays the network’s fee of their own transfer; an exchange may add its own withdrawal fee.
  • On some networks the payment waits for you in a contract of its own, and you pay a small network fee to take it out; the networks page lists which, and what it costs now.
  • Test payments cost nothing.

Ready to try it? Open an account — setup takes four steps, all in test mode.