RASPAY

Environments and sandbox

Differences between test and live, and how to simulate each scenario.

Test and live

Both environments have the same API and are isolated: balance, charges, keys, webhook endpoints and signing secret are separate.

TestLive
Keysk_test_sk_live_
Approved accountNot neededRequired
PixSimulated QR code, cannot be paid by a bankReal Pix
PayoutsSent without approval, no money leavesBy default, wait for approval
WebhooksReal, with the test secretReal, with the live secret

Simulate payment and refund

Use POST /v1/sandbox/charges/{id}/pay to pay a pending charge and POST /v1/sandbox/charges/{id}/refund to refund a paid one. Both send the same webhooks as live mode. With a live key, they return 403 forbidden.

curl -X POST "https://api.raspay.io/v1/sandbox/charges/7c1e4f2a-3b58-4e0d-9a6c-2f8d1b7e5a10/pay" \
  -H "Authorization: Bearer $GATEWAY_API_KEY"

Simulate a payout failure

Test payouts end as paid within a few seconds. To test the error path, use an amount ending in 99 cents:

amountResult
10000Payout completed, event payout.paid.
10099Payout fails, held amount returned, event payout.failed with failureReason equal to sandbox_simulated_failure.

Going live

  1. 1Submit your company data and documents in the dashboard, under Settings, on the Business screen.
  2. 2Once approved, generate an sk_live_ key.
  3. 3Register the live webhook endpoints and use the live secret.
  4. 4Make a real low-value charge and confirm the webhook.