Test mode
Everything you build against Stack today runs in test mode. Payments go through Paystack’s test environment, so no real money moves, but every step behaves as it will in live mode.
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 Paystack’s test cards in the Stack sheet. This one succeeds without any extra step:
| Card number | CVV | Expiry |
|---|---|---|
4084 0840 8408 4081 |
408 |
Any future date |
Paystack lists more test cards, including ones that ask for an OTP, a card PIN or 3-D Secure, and ones that are declined. They all work in the Stack sheet. See Paystack’s test cards.
Test bank transfers
Section titled “Test bank transfers”When a customer chooses Bank → Bank transfer, the sheet shows a one-time account number. In test mode it also shows a Simulate the transfer button, which completes the payment as if the money had arrived.
Test payouts
Section titled “Test payouts”A payout from your test balance is paid straight away. No money moves and nothing reaches
a bank.
Sign-in codes
Section titled “Sign-in codes”Stack emails the sign-in code to the address the customer enters, in test mode too, so 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.