Test and live modes
Each client has two modes: test for development and checks, and live for real users. The API key sets the mode: aapp_test_… or aapp_live_…. Both use the same API URL.
What each mode has of its own
Section titled “What each mode has of its own”| What | test | live |
|---|---|---|
| API key | aapp_test_… |
aapp_live_… |
| Event signing secret | its own | its own |
| Webhook secret and URL | their own | their own |
| Event dictionary, scenarios, badges | their own | their own |
| Users, events, rewards | their own | their own |
| Discount delay and term | to the minute: handy for quick checks | in whole days |
The modes’ data never mix. An object of the other mode doesn’t exist for you: requests for it get 404.
How to test
Section titled “How to test”- In
testwe can set scenarios up with a short delay and term, for example 5 minutes instead of 14 days, so the whole path from event to redemption fits into one evening. - Use separate
user_refs for tests, for example with atest_prefix. - Go through the end-to-end example in
test: creating a user, events, webhook, coupon, reserve, redeem, refund. - Check the unhappy paths: a repeated event, a wrong signature, 409 on reserve, a timeout on
reserve.
Going live
Section titled “Going live”- We set up the
livedictionary and scenarios according to the plan agreed with you. - You get an
aapp_live_…key, theliveevent signing secret and, when we are ready, thelivewebhook secret and URL. - You switch your server’s configuration. The code doesn’t change: same requests, different keys.
- For the first days we reconcile together: events arrive, progress is counted, webhooks are received.
Keep the keys of different modes in different environment variables, so a test server never writes to live by accident.