CVV Test Environment Tool: A Developer's Sandbox Guide
A CVV test environment tool checks your checkout form with fake sandbox numbers. See how test cards work, what to test, and why real cards never belong there.
Redeem your gift cards at any of our Merchants
Onyx Gift Cards is a Grenadian company designed to introduce, market and manage gift cards systems in Grenada for retailers and corporations. We are enthusiastic about the effect and influence we will have on the local market. We intend to expand our systems regionally with a range of product offerings and services.
Gift cards are the preferred way of giving and receiving gifts. They carry a monetary value that can be redeemed for gifts at your favorite store.
Onyx GiftCards are “Open Gift Cards” which means that they can be redeemed at multiple merchant locations. They are standard credit card size, can fit into the average wallet and made of PVC plastic. Onyx GiftCards are Barcoded for security and safety for the consumer and bear a disclaimer at the back.
Onyx Giftcards can be bought with a branded Card backer which is black in colour and is designed to fit the card. There is an area to write a brief message to the recipient as well.
A CVV test environment configuration is a sandbox setup in your payment gateway where you send published test card numbers and fake security codes through your own checkout to confirm the CVV field validates, declines, and routes as expected. It uses no live card data, so nothing you type there can charge a real cardholder. The goal is a repeatable test suite that proves your form and your server handle every CVC response the gateway can return.
Three pieces: a sandbox account from your processor, the list of test card numbers that processor publishes, and a checkout build pointed at sandbox API keys instead of live ones. Miss any one of them and your tests either fail for the wrong reason or run against production.
Test numbers are issued by the gateway. They pass the Luhn check and behave like real numbers inside the sandbox, but no issuer is ever contacted and no funds move. Sending a real card number into a sandbox does nothing useful and can put you in breach of your processor agreement.
gateway.test.env and gateway.live.env.Most gateways ignore the three digits you type and key the result off the test card number itself. Stripe documents a set of test cards where one specific number returns a CVC mismatch, another returns a successful charge, and another returns a processing error, so the digits in the CVC box rarely change the outcome.
Read your own gateway's test documentation before you write fixtures. The card-to-outcome mapping changes between providers and between API versions.
Failure tests matter more than the happy path, because a mismatched CVC is where real buyers get stuck. Build cases for an empty field, letters typed into a numeric field, a two-digit entry, a four-digit entry on a card that expects three, and a valid entry that the gateway still declines.
For each case, confirm two things: your client-side validation blocks the bad input before a network call, and your server-side validation rejects it again if the client check is bypassed. The second check is the one that catches real bugs.
PCI DSS Requirement 3 forbids storing the card verification value after authorization, and that rule applies to sandbox data too. Test CVCs look harmless, but the habit of logging them carries into production code. OWASP guidance on sensitive data handling points the same way: keep card fields out of logs, error trackers, and analytics events.
Tokenize at the edge. Let the gateway's hosted field or SDK capture the CVC, return a token, and keep the raw digits out of your server entirely. Your test environment then mirrors production, and your fixtures never contain anything that resembles a real security code.
For most card brands, yes. American Express uses four digits, so include a four-digit case in your fixture set if you accept Amex. Some gateways accept any value in sandbox mode, which is why you should test the length rules in your own form.
You can test your form's format rules with a stub, but you cannot test the decline behavior. The gateway decides whether a CVC matches, so the sandbox is the only place to prove that branch works.
Published test numbers are safe to commit. Keep sandbox API keys in environment variables anyway, so the same code path works for live keys without edits and nobody gets tempted to hardcode a secret.
Run it on every change to checkout code and once per gateway API version bump. Gateways retire test card numbers and change response codes, so a suite that passed last quarter can fail for reasons outside your code.