Appearance
Testing
Use sandbox mode to test your integration without processing real payments. All test transactions are isolated and never charged.
Sandbox vs Live
| Sandbox | Live | |
|---|---|---|
| Real charges | No | Yes |
| VGS environment | sandbox | live |
data-vgs-environment | "sandbox" | "live" |
| Webhook events | Sent to your URL | Sent to your URL |
Set data-vgs-environment="sandbox" on the widget div during development.
Test Cards and Amounts
Use card 4111 1111 1111 1111 with any future expiry date, any 3-digit CVC and ZIP 85284. The sandbox processor picks the outcome from the exact payment amount, not the card number:
| Amount | Result |
|---|---|
$0.04 or $0.23 | Declined (HTTP 402, PAYMENT_DECLINED) |
$0.07 or $0.12 | Processor error (HTTP 502, PROCESSOR_ERROR). This is a terminal processor error, not a transient one, so it is not retried on a secondary processor even when one is configured |
$12.34 or $50.49 | Approved |
Other amounts can also trigger simulated outcomes (for example, $1.23 declines), so use one of the approved amounts above for a normal payment.
Triggering Specific Scenarios
Simulate a decline
Pay $0.04 (amount 4) with the test card. The widget shows a decline message and calls onPaymentError with error_code: "PAYMENT_DECLINED".
Simulate rate limiting
Submit more than 10 payment attempts per minute. The widget shows a 30-second countdown before allowing a retry.
Checking Transaction Results
Test transactions appear in the Transactions view of your merchant portal immediately. Filter by status to find declined or failed attempts.
Promoting to Production
- Change
data-vgs-environmentfrom"sandbox"to"live". - Confirm your webhook URL is HTTPS and publicly reachable.
- Verify your API URL uses HTTPS.
- Generate a production widget token (same endpoint, same flow).