Test mode
Everything you build against Stack today runs in test mode. Provider test credentials handle card and transfer payments, so no real money moves.
One API, two modes
Section titled “One API, two modes”Test and live mode use the same API address, https://api.usestack.cc, and the SDKs’
defaults. Your key decides which mode a request is in: …_test_ keys are test mode,
…_live_ keys live mode. The two are kept completely apart:
- A payment made with a test key can only be seen, paid and refunded with test keys.
- Your test balance and live balance are separate, and so are your customers’ test and live balances and saved cards.
- Payment intents, refunds and webhook events carry
livemode,falsein test mode.
Live mode needs your business verified first (see Going live). Everything you build in test mode carries over unchanged. A payment sheet running with a test key shows a Test mode badge.
Test keys
Section titled “Test keys”Your project’s keys start with pk_test_ (publishable) and sk_test_ (secret). Find them
in the dashboard under API keys.
| Key | Where it goes | Starts with |
|---|---|---|
| Publishable key | Your app or website | pk_test_ |
| Secret key | Your server only, never in an app | sk_test_ |
The secret key is shown once, when you create it. If you lose it, create a new one with Roll key, which turns off the old key immediately.
Test cards
Section titled “Test cards”Use the test card details provided for your provider account. Required card challenges are completed in the Stack sheet before payment succeeds.
Test bank transfers
Section titled “Test bank transfers”When a customer chooses Bank transfer, the sheet shows one-time account details for the payment amount. The transfer is completed using the provider’s test environment.
Test payouts
Section titled “Test payouts”A payout from your test balance is paid straight away. No money moves and nothing reaches
a bank.
Receipts and identity setup
Section titled “Receipts and identity setup”Guests can test card and bank transfer checkout without signing in. Stack emails the receipt to the checkout address after payment succeeds. If you choose Set up Stack afterward, Stack sends the identity verification code to that address too. Use an inbox you can open.
Test webhooks
Section titled “Test webhooks”In the dashboard under Webhooks, Send test event delivers a signed
payment_intent.succeeded to your endpoint. Its data is
{ "test": true, "note": "Sent from the Stack dashboard." } rather than a real payment, so
your handler should ignore events with data.test. The same page lists every delivery,
with the response your server gave, and lets you retry one.