Skip to Content
RunePayDocs

Testing

Test keys, test cards, and how to make each payment outcome happen.

Test mode is the sandbox. There is no separate environment: the same API, with a test key, on test data.

Test and live

TestLive
Secret keysk_test_…sk_live_…
DataTest objects onlyLive objects only
CardsTest cards, no money movesReal cards
AvailabilityAlwaysAfter your account is approved (403 account_not_live before)

Every object has livemode. Keys, webhook endpoints, events and idempotency keys are all per mode: a test key never sees live objects, and a test endpoint never receives live events. Switch the dashboard between Test and Live in the top bar.

Test cards

The hosted checkout page shows the test cards for the processor behind test mode. Use any future expiry date and any CVC.

RunePay test processor

The default test processor simulates outcomes from the card number:

Card numberResultProcessor token
4242 4242 4242 4242Succeeds: payment.succeeded, then checkout.session.completedtok_success
4000 0027 6000 3184Asks for a bank check (3D Secure). The page shows Approve and Fail buttons for the checktok_3ds
4000 0000 0000 0002Declined with decline_code: "do_not_honor": payment.failedtok_decline
Any other valid numberSucceedstok_success

The test processor also has a tok_pending outcome (a payment that stays pending until settled by hand), used by RunePay's own tests. The hosted checkout does not offer it.

Rebilly sandbox

When test mode runs on the Rebilly sandbox, the page shows Rebilly's cards instead:

Card numberResult
5555 5555 5555 4444Succeeds
4111 1111 1111 1111Asks for a bank check (when 3D Secure is on for the sandbox gateway)
4000 0000 0000 0002Is declined

Test the rest of the flow

  • Refunds: POST /refunds with a succeeded test payment's id. A full refund sends refund.succeeded and payment.refunded; a partial one sends refund.succeeded.
  • Webhooks: point a test endpoint at a tunnel to your machine (for example cloudflared or ngrok); localhost URLs are refused. Use replay to resend an event while you work on your handler.
  • Errors: send a bad request on purpose, such as a string "unit_amount": "19.99" inside line_items[0].price_data, to see the error shape.

Planned

Test helpers to simulate disputes and move the settlement clock (POST /test_helpers/…, test mode only) are planned. Until then, disputes and payouts can't be triggered from the API in test mode.