Docs

Testing cookbook

Concrete sandbox test recipes for checkout, webhooks, subscriptions, refunds, tickets, and QR check-in.

Closed beta@atmosphere-money/app-nodeSDK beta: 0.0.0-beta.3ATM API beta: 2026-0672 lexicons

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.
ReceiverDashboard test event reaches `/webhooks/atm` and verifies `Atm-Signature` plus `Atm-Delivery-Id`.
RedriveThe same delivery id is accepted as a duplicate and does not fulfill twice.
XRPC receiverIf 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 checkoutBuyer pays without a DID. App still fulfills from payment.completed.
Signed-in checkoutApp passes payer DID hint and buyer assertion when available.
Canceled checkoutBuyer uses the checkout back/cancel action and returns to the app context.
Processing returnBrowser returns before events arrive; app polls status and waits.
Unavailable recipientPayout 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 = 0

Refunds 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.
Testing cookbook - Atmosphere Money Docs