Docs
Testing cookbook
Concrete sandbox test recipes for checkout, webhooks, subscriptions, refunds, tickets, and QR check-in.
Compatible with the closed-beta ATM app APIs and versioned ATM event headers. Check atm-api-version on every webhook or XRPC receiver event.
Setup
- Use the app test environment, not live.
- Configure a test webhook URL or XRPC receiver.
- Send a dashboard test event before real checkout.
- Use service-auth minted for the exact method NSID.
- Store idempotency keys for all mutating test calls.
Starter kit smoke
Use the local starter kit to test the ATM app dashboard before wiring a real app. The goal is to prove secrets, receiver routing, delivery logs, and idempotency first.
| Health | `GET /health` returns `ok: true` from the local starter. |
|---|---|
| Receiver | Dashboard test event reaches `/webhooks/atm` and verifies `Atm-Signature` plus `Atm-Delivery-Id`. |
| Redrive | The same delivery id is accepted as a duplicate and does not fulfill twice. |
| XRPC receiver | If configured, `/xrpc/money.atmosphere.event.receive` accepts the same event envelope behind service-auth. |
| Checkout | `POST /checkout` returns an ATM URL; browser return uses status polling only for UX. |
Checkout paths
| Guest checkout | Buyer pays without a DID. App still fulfills from payment.completed. |
|---|---|
| Signed-in checkout | App passes payer DID hint and buyer assertion when available. |
| Canceled checkout | Buyer uses the checkout back/cancel action and returns to the app context. |
| Processing return | Browser returns before events arrive; app polls status and waits. |
| Unavailable recipient | Payout status blocks payment buttons before checkout starts. |
Webhook replay
Force a failing test receiver, confirm ATM stores the failed delivery, then fix the receiver and redrive the event.
txt
1. Configure webhook URL.
2. Send payment.completed test event.
3. Return 500 from your receiver.
4. Confirm delivery appears failed in ATM.
5. Fix receiver.
6. Redrive delivery.
7. Confirm idempotent fulfillment runs once.Subscriptions
- Create first subscription.
- Attempt duplicate active subscription for the same app/payer/recipient and confirm app policy blocks or updates it.
- Change amount and confirm the subscription relationship remains the same to the user.
- Cancel and confirm renewals stop.
- Confirm renewal payments appear as payment rows when money moves.
Tickets no-oversell
Simulate concurrent hold creation against one capacity group. Only the available quantity should succeed. All failed callers should get a stable unavailable response and refresh availability.
txt
capacity = 10
spawn 20 concurrent createTicketHold(quantity = 1)
expect 10 success
expect 10 TicketHoldUnavailable
expect availability.available = 0Refunds and voids
- Refund a payment and confirm app receives payment.refunded.
- For tickets, confirm ticket.refunded or ticket.voided revokes pass authority.
- For products, confirm app reverses fulfillment only when business rules require it.
- For disputes, confirm app flags fulfillment for review.
QR check-in
- Scan a valid opaque token.
- Scan the same token again and confirm already checked in.
- Scan a voided token and confirm entry is blocked.
- Scan a malformed token and confirm no PII leaks in the error.
- Confirm scanner logs do not expose raw ticket secrets.