Libraries
WebHub
ZaphodsMap
TPack
NativeXml
ldiRegEx
htCreditCardValid Routine |
Declaration
function htCreditCardValid(Value: string): Boolean;
Unit
Description
True/False: credit card number may be valid
This routine determines whether a card number COULD be valid. This is a good preliminary check, to prevent extreme fraudulant use of a web ordering system. Any card number which fails this test is not worth using for any real transaction.
The types of cards which can be identified by this technique are defined by ThtCCardType.
Typically the next step is to process the card against an ecommerce interface which contacts a bank (merchant account). That step is outside the scope of ccValid.pas.
Example
uses
ccValid;
procedure TForm1.BitBtn1Click(Sender: TObject);
var
a1: string;
function Ok(Value: Boolean): string;
begin
if Value then
Result := 'OK'
else
Result := 'Invalid';
end;
begin
a1 := Edit1.Text; // cc number to check is in this edit box
MessageDlg(a1 +
' -> ' + htCreditCardName(htCreditCardType(a1)) +
' -> ' + Ok(htCreditCardValid(a1)),
mtInformation, [mbOk], 0);
end;
See also htCreditCardDateValid
Copyright © 1995-2012 HREF Tools Corp. All Rights Reserved Worldwide. This page updated: 19-Jun-2009.
Running DynHelp.exe v1.2.0.9 on WebHub-v2.163 built by d16_win32
Calc time: 172 ms
Running DynHelp.exe v1.2.0.9 on WebHub-v2.163 built by d16_win32
Calc time: 172 ms

