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:
| CVV | Outcome | Where to read it |
|---|---|---|
999 | Approved; the transaction reads CAPTURED | The transaction's state |
111 | Declined; apart from rare anomalies, recorded as a FAILED transaction, and the session stays PENDING | last_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:
| Network | PAN | Approving CVV |
|---|---|---|
| Visa | 4012000098765439 | 999 |
| MasterCard | 5146315000000055 | 998 |
| Discover | 6011000993026909 | 996 |
| Amex | 371449635392376 | 9997 |
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:
| Address | ZIP | AVS | Meaning |
|---|---|---|---|
8320 | 85284 | Y | both match |
8320 | omit | A | address only |
| omit | 85284 | Z | ZIP only |
8321 | 49855 | N | neither matches |
| omit | omit | 0 | no 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
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:
statereadsCAPTUREDorFAILED, anddecline_codereadsavs_policy_declinewhen your partner account's AVS policy rejected the AVS result, oravs_mismatchwhen the gateway declined on AVS.avs_response_codecarries the AVS result the gateway returned, or null when it returned none; like0, null is not a pass. - On the hosted page: a declined card payment attempt is, apart from rare anomalies,
recorded as a
FAILEDtransaction; the session staysPENDINGandlast_attempt.reasonclassifies the failure.
Testing checklist
- One approval: matching address and ZIP, the network's
99xCVV. - One CVV decline:
111on the Visa test card, everything else valid. - One AVS mismatch:
8321with49855. The hosted page neither returns the AVS result nor applies your partner account's AVS policy. The attempt is either approved (the transaction readsCAPTURED) or declined (apart from rare anomalies, aFAILEDtransaction is recorded, and the session staysPENDINGwithlast_attemptset); 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): handledecline_codeavs_mismatchandavs_policy_decline. The hosted-page cases above cannot produce either code. UnderNEVER_DECLINE, the default, no charge returnsavs_policy_decline. To testavs_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 produceavs_mismatchon 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.