Testing

Test mode vs live, store sandbox accounts, seeded data, and a go-live checklist.

CashSDK gives you a full test environment that mirrors production — separate keys, separate data, and the same APIs — so you can validate the entire purchase flow before a single real charge.

Test mode vs live#

Every workspace has parallel key pairs. Test and live data never mix.

EnvironmentPublishable keySecret keyStore
Testpk_test_…csk_sk_… (test)Store sandbox
Livepk_live_…csk_sk_… (live)Production store

Configure the SDK with your test publishable key while developing:

swift
CashSDK.configure(apiKey: "pk_test_...")

Store sandbox accounts#

Native store purchases in test mode require a store sandbox tester:

  • Apple — create a Sandbox Apple Account in App Store Connect (Users and Access → Sandbox) and sign into it on the device under Settings → Developer.
  • Google — add the tester's Google account to your app's license testers in the Play Console, and use an internal testing track.

Sandbox subscriptions renew on an accelerated clock (minutes, not months), so you can watch renewals, expirations, and grace periods play out quickly.

Seeded sandbox data#

Test mode comes pre-populated with real seeded rows — apps, a product catalog, paywalls, customers, and transactions — so the dashboard, APIs, and analytics are fully populated on day one. It's real data in your database, not mocks, so GET /v1/apps/{app}/customers and friends return exactly what production would.

Verify your setup#

1
Run the doctor

The CLI checks keys, store credentials, webhook endpoints, and catalog wiring in one pass.

bash
cashsdk doctor
2
Review the checklist

See exactly what's left before go-live, live-computed from your workspace.

bash
cashsdk checklist

The same data is available at GET /v1/apps/{app}/setup/checklist.

3
Request an Apple test notification

Confirm your App Store Server Notification pipeline end to end with the MCP request_apple_test_notification tool. Apple sends a test notification to your instance, which verifies it and emits the corresponding webhook.

text
request_apple_test_notification(app="my-app")
4
Fire a test webhook

Use send_test_webhook (or the dashboard) to confirm your endpoint verifies the CashSDK-Signature and handles the event. See Webhooks.

Go-live checklist#

1
Swap to live keys

Replace pk_test_… with pk_live_… in your app and csk_sk_… (live) on your backend, sourced from environment variables — never hard-coded.

2
Confirm store credentials

Production App Store Connect and Google Play credentials are connected and validated (cashsdk doctor passes).

3
Point store notifications at production

App Store Server Notifications and Google Play RTDN target your live instance, and your webhook endpoint is registered and verifying signatures.

4
Smoke-test a real purchase

Buy and refund once in production, confirm the entitlement grants and revokes, and check the event lands on your webhook.

Next steps#