Documentation

IdentifyCardType

Description and parameters

string
CSaleUserCards::IdentifyCardType(
 string ccNum
);

Method defines type of bank card by its number. Non-static method.

Call parameters

ParameterDescription
ccNum Card number.

Returned values

Method returns card type.

Examples

<?
// Save new card for current user

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);
}
?>

© «Bitrix24», 2001-2024
Up