question

shazad0304 avatar image
shazad0304 asked sebaxtz commented

getting 402 Payment Required with code 'incorrect_address' while adding card

"message" : "402 Payment Required" , "error" : { "type" : "card_error" , "code" : "incorrect_address" , "message" : "Token verification failed for token clv_***" }


whats the reason ? why am I getting this error

Payments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

You will need to provide details:

1) What environment is this happening in? Sandbox?

2) How are you tokenizing the card?

3) What requests are you making (to tokenize and to pay)? Provide details of the request redacting any access tokens.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shazad0304 avatar image
shazad0304 answered

1) Yes sandbox

2) by using Clover Frontend for Card Form, it returns the token

3) PUT : https://{CloverEcommerceUrl}/v1/customers/{customerCloverId}
Body {
email : appUserEmail,
token: {token}
}

getting response


{ "message" : "402 Payment Required" , "error" : { "type" : "card_error" , "code" : "incorrect_address" , "message" : "Token verification failed for token clv_***" } }
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

What is your merchant id?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shazad0304 avatar image
shazad0304 answered David Marginian Deactivated edited

G0PXF0SMKPZF1

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

I was able to reproduce the issue. I have reported it to the EComm team. If you need to test payment flows you may use the API to tokenize for now.

0 Likes 0 ·
shazad0304 avatar image
shazad0304 answered David Marginian Deactivated commented

@David Marginian Any updates?

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·
This is happening because an invalid zip code is being used when you tokenize the card and we recently released a change where we make sure the AVS zip check matches. I am not certain what card you are using but we are working on updating our test card page with working zip codes.
1 Like 1 ·
mubasharabbas avatar image
mubasharabbas answered David Marginian Deactivated commented

I am getting the same issue.. can you please provide a valid zip code for me to test the tokenization flow.. ?

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·
We are working on documenting the ZIP codes required for test cards. In the meantime you may want to consider tokenizing via the API and not passing address_zip to test the customer update/creation flows
0 Likes 0 ·
shazad0304 avatar image
shazad0304 answered

Hi David,

Any progress on test zip codes?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

Try using this card for now 5204245250003294 (with any 5 digit zip).

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mlyon avatar image
mlyon answered David Marginian Deactivated commented

We just started getting this error in production as well, even though we haven't changed anything on our end, and our web application had previously been working flawlessly. We're generating a token with the hosted iframe, and then attempting to save the card on file when creating a customer with the /v1/customers endpoint, which is now returning the "incorrect_address" error. However it doesn't appear to be an issue with the postal/zip code, because if we change the postal code to the wrong postal code, we get the error "incorrect_zip". When the postal code is correct for the card, we get "incorrect_address". But the thing is, we don't actually send any other address information other than the postal code when generating the token with the iframe, and we don't send any address information when we generate the customer with the token. So why are we getting this error? @davidmarginian, any advice?

8 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·

We are now verifying that the zip entered by the customer matches (the gateway does not return an AVS zip code mismatch). Are you testing this with a personal card? How do you know the zip entered matches?

0 Likes 0 ·
mlyon avatar image mlyon David Marginian ♦♦ commented ·

Yes, I'm testing with my own personal cards on our live system. I tested both a mastercard and a VISA, with different billing addresses. They're both Canadian credit cards, so they're using 6-digit postal codes. I'm 100% entering the correct postal codes. If I enter the wrong postal code, I get a different error ("incorrect_zip"). This "incorrect_address" error is coming back only when we try to save the card on file when creating a customer record on the /v1/customers endpoint. If we charge the token returned from the iframe right away, without creating a customer, the charge is successful.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ mlyon commented ·
Ok, thank you. I have engaged the ecomm team about this and they are looking into it.
2 Likes 2 ·
Show more comments
sebaxtz avatar image
sebaxtz answered David Marginian Deactivated commented

hi, having the same issue with a few foreign customers with Argentinian VISA and Mastercard cards in our live system when saving the customer:


{"message":"402 Payment Required","error":{"type":"card_error","code":"incorrect_zip","message":"Token verification failed for token clv_1*****************"}}

As Mlyon said, works well if we dont save the customer and charge the customer instead.

is it related to this issue ?

thank you so much


1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image David Marginian ♦♦ commented ·
There is no longer an issue here on our end that we are aware of. How do you know for certain the customer is entering their postal code correctly?
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community