Skip to main content
Skip to Content
Cresora Commerce
Testing & Sandbox

AVS and CVV

Drive AVS and CVV results in sandbox from the values typed on the hosted page.

On a hosted payment page, the CVV result depends on the security code entered on the page and, when the session sends no billing_address prefill, the AVS result depends on the street address and ZIP entered there. The security code is never sent to the Cresora API. A session can send a billing address prefill (billing_address; see Session parameters). Whether a prefill is shown, can be edited, or is used for AVS is not confirmed, so leave billing_address out and type the address on the page when you test AVS. The values in the tables below are exercised through a hosted page session.

CVV

On the Visa test card, 999 approves and 111 declines; that pair was verified in a round trip on that card. On a hosted page the outcomes read:

CVVOutcomeWhere to read it
999Approved; the transaction reads CAPTUREDThe transaction's state
111Declined; apart from rare anomalies, recorded as a FAILED transaction, and the session stays PENDINGlast_attempt.reason on the session

111 is confirmed as a decline on the Visa test card only. For the other networks the declining value has not been confirmed: ask Cresora before you build a decline test on another card. The approving value belongs to the 99x family and differs per network — always pair a PAN with the code on its own row. Only the Visa row was exercised in a round trip; the others are the gateway's listed values:

NetworkPANApproving CVV
Visa4012000098765439999
MasterCard5146315000000055998
Discover6011000993026909996
Amex3714496353923769997
⚠Warning

CVV triggers fire only on CVV-present flows — that is, the hosted page, where the cardholder types the code. A charge against a stored token does not re-verify CVV and cannot exercise these scenarios at all.

AVS

These values come from the gateway's test sheet for Visa. They were reproduced on a hosted page on a Cresora development gateway, not the sandbox, with the Visa card above and a city and state also typed. Other networks are not confirmed.

The page shows a billing address only when the merchant's page has billingAddress turned on, which it is not by default, or when the merchant's gateway settings require one (provisioning.gateway_required_fields lists billing_address). To turn it on, read the merchant's page configuration with GET /api/v1/config/hpp-page?merchant_id={merchantId}, set billingAddress under appearance.fields.address to true, and send is_active and the whole appearance back with PUT /api/v1/config/hpp-page/merchants/{merchantId}, passing the version you read as expected_version. The PUT requires an Idempotency-Key header. The PUT replaces the whole page. Wait until provisioning.status is PROVISIONED and provisioning.provisioned_version equals the version the PUT returned, reading it again with that GET: until then the saved page is not the live page, and the address fields do not show. If provisioning.provisioned_version stays below that version, or stays null, read provisioning.error: the update did not land, and status can still read PROVISIONED. Once the page is live, type the address line and the ZIP on the hosted page. On the pages tested neither was required, so a row marked omit is run by leaving that field empty. If your merchant's gateway settings require a billing address, the page makes it mandatory; which of its fields must be filled is not confirmed.

The address line and the ZIP each match or do not, independently, and the pair selects the AVS result:

AddressZIPAVSMeaning
832085284Yboth match
8320omitAaddress only
omit85284ZZIP only
832149855Nneither matches
omitomit0no AVS data

The gateway computes these results; a hosted-page payment does not return them to you. 0 is not a pass, it is the absence of a check. Your partner account's AVS policy applies only to cardholder-initiated saved-card charges through the API (use_type: ONE_TIME_FUTURE).

An AVS or CVV mismatch can decline the payment

🔒Compliance

On a cardholder-initiated charge of a saved card through the API — use_type: ONE_TIME_FUTURE — your partner account's AVS policy is applied, and a result the policy rejects declines the transaction with avs_policy_decline. The gateway can also decline on AVS, which reads avs_mismatch. Your integration must handle both.

So do not build on the assumption that a mismatch is advisory. On a cardholder-initiated saved-card charge through the API, the outcome depends on your partner account's AVS policy. There is one policy per partner account, and it covers all of your merchants. It is NEVER_DECLINE by default, which declines nothing, and only Cresora can change it. Even under NEVER_DECLINE, the gateway can still decline on AVS. To have the policy changed, or to learn what a value other than NEVER_DECLINE declines, contact Cresora support.

You can read yours as avs_decline_policy with GET /config/partners/{partnerId}, using your own partner id: the partner_id on every webhook you receive. The key you call it with must hold config:read, which a key holds unless its list of permissions leaves it out. With your own id, a 404 means no configuration has been saved yet, so the policy is NEVER_DECLINE. A merchant id, or another partner's id, also answers 404.

Read the result of each charge at runtime:

  • On a saved-card charge through the API: state reads CAPTURED or FAILED, and decline_code reads avs_policy_decline when your partner account's AVS policy rejected the AVS result, or avs_mismatch when the gateway declined on AVS. avs_response_code carries the AVS result the gateway returned, or null when it returned none; like 0, null is not a pass.
  • On the hosted page: a declined card payment attempt is, apart from rare anomalies, recorded as a FAILED transaction; the session stays PENDING and last_attempt.reason classifies the failure.

Testing checklist

  • One approval: matching address and ZIP, the network's 99x CVV.
  • One CVV decline: 111 on the Visa test card, everything else valid.
  • One AVS mismatch: 8321 with 49855. The hosted page neither returns the AVS result nor applies your partner account's AVS policy. The attempt is either approved (the transaction reads CAPTURED) or declined (apart from rare anomalies, a FAILED transaction is recorded, and the session stays PENDING with last_attempt set); handle both.
  • One no-data case: omit address and ZIP, and handle the same two outcomes.
  • A saved-card charge through the API (use_type: ONE_TIME_FUTURE): handle decline_code avs_mismatch and avs_policy_decline. The hosted-page cases above cannot produce either code. Under NEVER_DECLINE, the default, no charge returns avs_policy_decline. To test avs_policy_decline, contact Cresora support: it takes a changed policy and a saved card whose AVS result that policy rejects. This page gives no way to produce avs_mismatch on a saved card; handle it as you handle any other decline.

Run these through the flow on test cards, and check the required set in certification scenarios.