Accept payments
Testing
Test keys give you a full sandbox. Payments behave like live ones, but no money moves and nothing reaches a bank.
| Test mode (sk_test_) | Live mode (sk_live_) | |
|---|---|---|
| Card payments | checkoutUrl opens the Kepper sandbox checkout | checkoutUrl opens the secure card checkout |
| Bank transfers | Returns a sandbox account (Kepper Sandbox Bank). Don't send money to it. | Returns a real one-time account |
| Completing a payment | Sandbox checkout page, or the simulate endpoint | The customer pays |
| Webhooks | Sent to your test webhook URL, with livemode: false | Sent to your live webhook URL |
| Your wallet | Never credited | Credited with the net amount |
Card payments in the sandbox
Open the checkoutUrl and choose Simulate successful payment or Simulate expiry. You're then sent back to your callbackUrl, the same as in live mode.
Simulate a payment from code
This is useful for automated tests and for bank transfers. It works only with test keys.
cURL
curl https://api.kepperhq.com/v2/gateway/payments/order_1001/simulate \
-H "Authorization: Bearer $KEPPER_TEST_KEY" \
-H "Content-Type: application/json" \
-d '{ "status": "successful" }'status is successful or expired. The matching webhook is sent straight away.
Before you go live
- You fulfil orders only from a verified webhook, or from a server-side fetch showing
successful. - Your webhook handler rejects bad signatures and old timestamps, and ignores duplicate
event.ids. - You check that
amountandreferencematch your order before fulfilling it. - You handle
payment.expiredby releasing stock or cancelling the order. - Retrying a create with the same
referencedoesn't create a second order on your side. - Your live key is in a secrets store and restricted to your servers' IP addresses.
When you're ready, contact Kepper support to enable live payments for your business.