Version

    Validate credit card

    The Validate credit card step allows you to validate credit card numbers. The step validates the format of the number using the Luhn algorithm. The step can therefore detect card numbers with typos or missing digits, but it does not try to contact any credit card provider to verify that the credit card exists.

    Parameters
    • Input column: required, a string column containing credit card with one card per row.

    • Accept empty values: configure whether an empty value is considered a valid credit card. Empty value is a value that is either null (shown as No value in data preview), zero-length string or a string composed entirely of whitespaces. By default, this is checked (i.e., empty values are considered valid).

    Examples
    Input value Accept empty values Result Description

    3579099126677753

    Any

    Valid

    Credit card written without any delimiters is accepted.

    3579099126677754

    Any

    Invalid

    In this case the checksum digit is not valid (last digit in the number).

    3576-9755-3407-6980

    Any

    Valid

    Cards with dashes are accepted.

    3576—​9—​755-3407-6980

    Any

    Valid

    Position and number of dashes does not impact validity of the card number.

    3576 9755 3407 6980

    Any

    Valid

    Cards with spaces are accepted as well.

    3576*9755*3407*6980

    Any

    Invalid

    Start symbol is not allowed as a delimited and this number is therefore considered invalid.

    No value

    Yes (checked)

    Valid

    This is valid number since Accept empty values is checked.

    No value

    No (unchecked)

    Invalid

    Invalid since empty values are not allowed as per Accept empty setting.

    Error

    Any

    Error

    Calling the step on an Error will not run any validation and return an Error.

    Remarks
    • Only syntax of the credit card number is verified. When checking the syntax, spaces and dashes are ignored. Any other delimiter characters will cause the card number to be considered invalid.

    • The step does not attempt to contact any credit card or payment provider to verify the existence of the credit card number

    • Running validation on an Error value does not try to validate the value and instead produces an Error right away.