ActiveX: SLCreditCard
(Filename: SLCRCARD.OCX) SLCreditCard is an ActiveX component that can be used to validate credit card numbers and check expiration dates of credit cards. The component can also determine the type of credit card by examining the credit card number. The component recognizes the following four card types: VISA, American Express, MasterCard and Discover. But the component can also make a general credit card number check and check expiration date to other credit card types. Properties
Methods
Example Dim X As Long SLCreditCard1.Number = "4111 1111 1111 1111" SLCreditCard1.ExpirationDate = "01/09" SLCreditCard1.CardType = 1 ' VISA X = CC_OK ' Check credit card number If SLCreditCard1.IsNumberValid() = False Then X = CC_INVALID_NUMBER GoTo ERR_INVALID End If ' Check expiration date If SLCreditCard1.CheckExpirationDate() <> 1 Then If SLCreditCard1.CheckExpirationDate() = 0 Then X = CC_OUTOFDATE Else X = CC_ILLEGAL_DATE End If End If ERR_INVALID: < Go back |