ADDRESS_VERIFICATION_FAILURE error when create payment

Dear Team,

When create payment with payment API, we got below error

Error [category=PAYMENT_METHOD_ERROR, code=ADDRESS_VERIFICATION_FAILURE, detail=Authorization error: ‘ADDRESS_VERIFICATION_FAILURE’, field=null]

The API doc explain this error as “The card issuer declined the request because the postal code is invalid.”, but in our production environment so far, in most cases the API can create payment successfully without postal code in the request, may i know why this error happened this time? and what our application is supposed to do when this error occurred?

Thanks and Regards

Was the customer prompted to put in their postal code? The Card payment method of the Web Payments SDK automatically infers whether to display the ZIP code, postal code, or postcode based on the issuing country of the buyer’s credit card. Depending on the card that’s used, the SDK automatically removes the postal code if the card’s issuing country doesn’t require the postal code for the payment. If the customer was prompted for the postal code the bank is likely to decline the payment if one isn’t provided. :slightly_smiling_face:

hi Bryan,

Thanks for reply,

Was the customer prompted to put in their postal code? The Card payment method of the Web Payments SDK automatically infers whether to display the ZIP code, postal code, or postcode based on the issuing country of the buyer’s credit card

We didn’t know whether the customer was prompted or not, as we were absent when this error occurred.
We also didn’t know the Web Payment SDK may automatically infer those fields (thanks for pointing this out).

In our application, the payment flow is designed like these:

  1. save the customer’s card on file in square, through Web Payment SDK
  2. make an authorized payment in the way of charging card on file, with a small amount (the purpose is to validate whether it’s a real card or not)
  3. provide our service to customer
  4. make a new payment in the way of charging card on file, with a variable amount according to the service we provided to customer in 3.
  5. cancel the authorized payment which was created in 2.

this time above 1. and 2. succeeded, and this error ADDRESS_VERIFICATION_FAILURE happened at 4., does it mean that the customer might be prompted for inputting postal code, etc. in Web Payment SDK at above step 1.? and if the postal code was not input properly, above 2. and 4. might be declined by bank?

Okay, that makes sense. The bank probably had a higher risk level with the second payment cause you charged the card again for a higher amount. Thats a common risk signal banks look for cause bad actors will often try an authorize a payment for a small amount to check that its a valid card. If the authorization goes through they ofter charge a higher amount. It would be better if you charged the full amount if possible for your use case. :slightly_smiling_face:

ohhh, i see…

so based on the error ‘ADDRESS_VERIFICATION_FAILURE’, it’s still the case that customer might be prompted to input postal code but he didn’t provide a valid one, and then based on the risk signal bank looks for, the payment was declined, is my understanding correct?

Right, however I can’t speak to the banks decline. We just return the error that banks give us. :slightly_smiling_face:

I’m having the same problem, but the Square SDK Payment card form is not asking for the ZIP when saving the card. What do I do?

The Web Payments SDK will automatically infer whether or not it needs to ask for a zip code. What’s the payment_id of the declined payment? :slightly_smiling_face: