You cannot programmitcally do this as that information is only verifiable from the card issuing bank. So to do this you need to use the Address Verification System (AVS).
To do this you must run either a $0.00 AUTH_ONLY
transaction, or if the processing bank does not support that run a $0.01 AUTH_ONLY
and then a VOID
to undo that transaction. You will then receive an AVS result which you can use to the if the provided value from correct. (You cal also process your AUTH_CAPTURE
transaction normally and then upon a failed response VOID
the transaction).
These are the possible response values:
B Address information was not submitted in the transaction information, so AVS check could not be performed
E The AVS data provided is invalid, or AVS is not allowed for the card type submitted
R AVS was unavailable at the time the transaction was processed. Retry transaction
G The credit card issuing bank is of non-U.S. origin and does not support AVS
U Address information is not available for the customer's credit card
S The U.S. card issuing bank does not support AVS
N Neither the street address nor the 5-digit ZIP code matches the address and ZIP code on file for the card
A The street address matches, but the 5-digit ZIP code does not
Z The first 5 digits of the ZIP code matches, but the street address does not match
W The 9-digit ZIP code matches, but the street address does not match
Y The street address and the first 5 digits of the ZIP code match perfectly
Keep in mind that AVS generally only works in the United States.
Also, a failed AVS response does not mean the credit card is stolen or the transaction is fraudulent. It just means the user entered a different zip code than is on the billing address for that credit card. Many people have a different home address then billing address and commonly enter the zip of their home rather than the billing address of the card. It is not recommended that you reject transactions based on a failed AVS response. It should be one of several tools you use which includes CVV and other tools.