Skip to content

Testing ​

Use sandbox mode to test your integration without processing real payments. All test transactions are isolated and never charged.

Sandbox vs Live ​

SandboxLive
Real chargesNoYes
VGS environmentsandboxlive
data-vgs-environment"sandbox""live"
Webhook eventsSent to your URLSent 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:

AmountResult
$0.04 or $0.23Declined (HTTP 402, PAYMENT_DECLINED)
$0.07 or $0.12Processor 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.49Approved

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 ​

  1. Change data-vgs-environment from "sandbox" to "live".
  2. Confirm your webhook URL is HTTPS and publicly reachable.
  3. Verify your API URL uses HTTPS.
  4. Generate a production widget token (same endpoint, same flow).