# Underpaid, overpaid or late: how OpenReceive confirms crypto payments

OpenReceive marks an order paid only when your own wallet says the money has
arrived. Bitcoin over Lightning is strict: the customer can't send the wrong
amount. Stablecoin payments go through a swap provider. If the customer sends
too little, too much or too late, OpenReceive shows them a refund screen.
[Accept crypto with OpenReceive](/#frameworks): free and open source, paid to
your own wallet.

## Paid means your wallet says so

1. The customer pays.
2. Your wallet receives the payment and settles it.
3. OpenReceive marks the order paid, once.

- Not when the customer clicks "I paid".
- Not when a swap provider says the swap is done. The Bitcoin has to reach your
  wallet too.
- OpenReceive keeps checking your wallet in the background. A customer who
  closes the tab right after paying still gets their order.

## Bitcoin over Lightning: strict by design

| | What happens |
|---|---|
| Underpaid | Can't happen. The amount is written into the invoice, so the customer's wallet pays exactly that. |
| Overpaid | Can't happen, for the same reason. |
| Late | An expired invoice can't be paid. The customer taps **Start over** and gets a new one at the current price. |
| Refunds | None needed. |

OpenReceive keeps checking for a few minutes after the countdown ends, so a
payment sent just before the end still counts.

## Stablecoins through a swap provider: a refund screen when something goes wrong

The customer pays in USDT, USDC, ETH or SOL. A
[swap provider you choose](/set_up_swap_provider) converts it into the same
Lightning payment. The provider gives the deposit an amount and a time limit.

| | What happens |
|---|---|
| Slightly overpaid | Most providers accept it and the swap goes through as normal. |
| Underpaid | The swap stops. The customer gets a refund screen. |
| Overpaid by more than the provider allows | The swap stops. The customer gets a refund screen. |
| Late (after the deposit window) | The swap stops. The customer gets a refund screen. |

## The refund screen

1. **The refund screen replaces the payment screen.** The QR code and amount
   are gone, so the customer can't send the deposit a second time by mistake.
2. **The customer gets a refund address.** It has to be on the coin's own
   network, which usually means another wallet app. The refund stays on the
   order's page while they get one.
3. **The customer confirms it twice.** They enter the address, check it, and
   confirm. Nothing is sent before the second step.
4. **The provider sends back the whole deposit.** The order stays unpaid, and
   the customer can pay again.

You don't do anything. The money never reached your wallet, so you have
nothing to send back. Developers: see [Swap refunds](/guides/swap-refunds).

## Questions

### What if the customer closes the tab after paying?

The order is still marked paid. OpenReceive checks your wallet in the
background, not just while the checkout is open.

### How long does a customer have to pay?

The checkout shows a countdown. When it runs out, the customer taps
**Start over** and gets a new invoice at the current price.

### Why does an overpayment get the whole deposit back, not just the extra?

The swap was for a fixed Lightning payment. The provider has nothing to
convert the surplus into, so it refunds the whole deposit and the customer
pays again.

### Can I refund a Lightning payment?

Not through OpenReceive. Its wallet code is receive-only, so it can't send
money. Send a refund from your wallet's own app.

### What if a customer pays the same order twice?

OpenReceive fulfills each order once. A second stablecoin deposit onto an order
that is already paid is flagged for a person. The checkout shows the
transaction IDs to give the swap provider's support.

### Do I have to set any of this up?

No. It is built into every OpenReceive plugin and package. For your own checkout
screens, read [Checkout UX](/guides/checkout-ux).

[Get started with OpenReceive](/#frameworks): free, open source, and paid straight
to your own wallet.
