Bitrix Site Manager

CSaleUserCards::IdentifyCardType

string
CSaleUserCards::IdentifyCardType(
 string ccNum
);

The method IdentifyCardType returns the type of the credit card by its number.

Parameters

ParameterDescription
ccNum The credit card number.

Return Values

Returns the type of the credit card.

Example



<?
// Save the information about the current user's new card

if (CSaleUserCards::CheckPassword())
{
    $arFields = array(
            "USER_ID" => $USER->GetID(),
            "ACTIVE" => "Y",
            "SORT" => "100",
            "PAY_SYSTEM_ACTION_ID" => 11,
            "CURRENCY" => "USD",
            "CARD_TYPE" => CSaleUserCards::IdentifyCardType("4111111111111"),
            "CARD_NUM" => CSaleUserCards::CryptData("4111111111111", "E"),
            "CARD_EXP_MONTH" => 11,
            "CARD_EXP_YEAR" => 2007,
            "DESCRIPTION" => False,
            "CARD_CODE" => "123",
            "SUM_MIN" => False,
            "SUM_MAX" => False,
            "SUM_CURRENCY" => False
        );

    $UserCardID = CSaleUserCards::Add($arFields);
}
?>