Home Forums Plugins Offline Credit Card Processing Support [Resolved] Credit Card Verification Fails

Welcome to our community support forums! We're here to help - but if you have an urgent request for a Pro Plugin, you will get a prioritised response through our Premium Support page.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8810
    golewis
    Participant

    American Express cards do not pass verification. It may be due to the fact they have 15 digits and not 16. (xxxx-xxxxxx-xxxxx)

    Neither single field or 4-fields entry will pass the card.

    Please advise, thanks.

    #8812
    golewis
    Participant

    I modified the function that validates card numbers to include an exception for AMEX 15-digit numbers. This is admittedly a hack, but here it is:

    function wpsc_oc_validation_is_valid_card_number( $value ) {

    if( (is_numeric( $value ) && strlen( $value ) == 16) || ( (is_numeric( $value ) && strlen( $value ) == 15) && ( ( substr( $value, 0, 2 ) == '34' ) || ( substr( $value, 0, 2 ) == '37' ) ) ) )
    return true;

    }

    #8813
    Michael Visser
    Keymaster

    Hi golewis, nice spotting. Thanks for the patch, I’ll add that to the next Plugin update as well as drop in some filters for developers to override this for other cards.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Credit Card Verification Fails’ is closed to new replies.