> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cryptocheckout.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing

> How to exercise the full flow — including the failure modes worth rehearsing.

Everything runs on testnet today, so the whole product is a test environment. Use real testnet tokens from public faucets.

## Get testnet tokens

<Columns cols={2}>
  <Card title="Native gas" icon="gas-pump">
    You need a little of each chain's native token to deploy your pool and to claim. Chain faucets provide it free.
  </Card>

  <Card title="Test stablecoins" icon="coins">
    Circle runs a public faucet for testnet USDC and EURC across most supported chains.
  </Card>
</Columns>

## The happy path

<Steps>
  <Step title="Deploy a pool" icon="cube">
    Pick a cheap chain — Base Sepolia is a good default.
  </Step>

  <Step title="Open your checkout" icon="cart-shopping">
    Confirm the verified badge appears **before** payment options.
  </Step>

  <Step title="Pay both ways" icon="arrows-split-up-and-left">
    Once with a connected wallet, once by copying the deposit address and sending manually. They behave differently and both need to work.
  </Step>

  <Step title="Watch the webhook" icon="webhook">
    Confirm `payment_confirmed` arrives and your signature verification passes.
  </Step>

  <Step title="Claim" icon="hand-holding-dollar">
    Do a full round trip. Confirm the funds land in your payout wallet and the amount matches 99% of the order.
  </Step>
</Steps>

## The failure paths

More valuable than the happy path, because these are what actually cost you money in production.

<AccordionGroup>
  <Accordion title="Customer closes the tab immediately" icon="xmark" defaultOpen>
    Pay, then close before the success screen.

    **Expect:** no browser callback, but the webhook still arrives and the order still fulfils. If your fulfilment depended on the callback, you've just found it.
  </Accordion>

  <Accordion title="Duplicate webhook delivery" icon="copy" defaultOpen>
    Replay a delivery from your logs, or return a 500 once and let us retry.

    **Expect:** the second delivery is a no-op. If you shipped twice, key on `X-Webhook-Id`.
  </Accordion>

  <Accordion title="Underpayment" icon="circle-half-stroke" defaultOpen>
    Send less than quoted on the deposit rail.

    **Expect:** status `underpaid` with the shortfall shown. Confirm you have a documented response. [Edge cases](/money/edge-cases).
  </Accordion>

  <Accordion title="Overpayment" icon="circle-plus">
    Send more than quoted.

    **Expect:** the full amount arrives. The excess is yours to refund manually.
  </Accordion>

  <Accordion title="Wrong token" icon="shuffle">
    Send a token you haven't enabled.

    **Expect:** `wrong_token`, surfaced rather than silently lost.
  </Accordion>

  <Accordion title="Late payment" icon="clock">
    Let a quote expire, then pay the address anyway.

    **Expect:** funds arrive and are credited as paid late. Decide whether you honour the old price.
  </Accordion>

  <Accordion title="Broken verification" icon="shield-halved">
    Temporarily change `settlementAnchor` to a different address.

    **Expect:** the checkout blocks with a configuration mismatch and hides the payment address. If it lets the customer pay, your anchor isn't wired up. **Change it back afterwards.**
  </Accordion>
</AccordionGroup>

## Testing webhooks locally

Your endpoint needs to be reachable from the internet. A tunnel works:

```bash theme={null}
ngrok http 3000
# then set the https URL in Settings → Webhooks
```

<Warning>
  Localhost, private network ranges, and cloud metadata addresses are rejected as webhook URLs. That's an SSRF protection, not a bug — use a tunnel.
</Warning>

The dashboard has a **Send test event** button that delivers a signed sample to your endpoint, which is the quickest way to check your signature verification without making a payment.

## Before you switch to mainnet

<Card title="Go-live checklist" icon="list-check" href="/get-started/go-live" horizontal>
  Everything to confirm before real money.
</Card>
