Get started
Sandbox testing
Use a wgp_test_… key to run real checkout flows with synthetic cards, or simulate outcomes without a device. No money moves in sandbox.
Test cards
Create a payment with a sandbox key, open its checkout, and choose Pay by card. The checkout shows a sandbox notice; only use these cards when you see it.
| Scenario | Card number | What happens |
|---|---|---|
| Successful payment | 4242 4242 4242 4242 | No customer challenge. The payment becomes paid. |
| 3D Secure challenge | 4000 0025 0000 3155 | Complete the challenge in the browser, then verify the payment. |
| Successful payment (alternative) | 4111 1111 1111 1111 | No customer challenge. |
For every card, use card holder TEST TEST, any future expiry such as 12/2030, and CVV 123. Use a new payment for each scenario.
Never mix test and real data
Verify the result
After checkout, read the payment and confirm status: "paid", environment: "sandbox", and the expected amount, currency and reference. Check that your webhook endpoint received and accepted the signed event.
Device-free simulations
Simulations let you test your webhook handling and order states without a card, wallet device or provider. Run them in Dashboard → Test checkout → Device-free sandbox scenarios, or from your server:
Scenarios are paid, declined, requiresAction and expired, for card or wallet. Finish a requiresAction simulation with POST /v1/sandbox/simulations/{id}/complete and {"outcome":"paid"} or {"outcome":"declined"}. Live keys cannot use simulations.
Simulations are not payments
simulation: true. Its webhooks use sandbox.simulation.* event types. It never changes real payments or totals. Never fulfill an order from a simulated event.What sandbox does not prove
Sandbox cannot show production approval rates, issuer or risk decisions, real-device wallet behaviour, production 3D Secure, or settlement. There is no API to force a real payment’s status. To test checkout expiry, leave a sandbox checkout unused until its expiresAt. This tests session expiry, not a decline.
Acceptance checks before going live
Run these against the deployed sandbox and record payment IDs, event IDs and results. Do not record secrets or card data. Wegopay signs off this list with you before issuing a live key.
| Scenario | Expected result |
|---|---|
| Hosted checkout, with and without 3D Secure | Verified paid payment, signed event accepted, order fulfilled once |
| Decline, abandonment, expiry | No premature fulfillment; the pending order is reconciled |
| Same create request retried, or sent twice at once | One payment ID; no second charge |
| Wrong environment on create, cross-environment read | Request rejected; a sandbox key cannot read live payments |
| Tampered or stale webhook, wrong environment secret | Your receiver rejects it, with no side effects |
| Duplicate or out-of-order webhooks | Deduplicated by event ID; current state read; fulfilled once |
| Your receiver returns 500, then recovers | Delivery retries and is accepted |
| Signing secret rotation, API key revocation | Old secret accepted while draining; revoked key rejected |
Next: configure hosted checkout.