Validating card details

Flow showing how to validate cards

Call ValidateCardDetails service

To validate cards, you need to call ValidateCardDetails, supplying the PAN, CVV, and expiry date. For some cards, such as Switch cards, you also need to supply the issue number and valid from date.

Get validation response

To find out whether the card passed validation, you need to retrieve the validation response.

Are there any errors?

If the card failed validation, card conditions are returned. Therefore to see if there were validation errors, you need to check whether CardCondition contains any information.

If there are errors you need to extract the codes and any returned reasons to determine why the card details failed validation.

Not every code has an associated reason.

Display results and returned data

If the validation was successful or the BIN exists, details about the card are returned. Your business requirements will determine which of these details you need.

Your application should interpret the validation results and display messages suitable for your users. For example, when code 4 is returned with no reason code, your application could display "The Card Number failed validation".