Credit card component
Credit card and payment-processing related functions.
$ccTestNumbers propertyArray of commonly used test credit card numbers, these will always pass Mod10 validation but their accounts will respond declined.
$cardTypes propertyCredit card types; keys mapped to the AuthorizeNet card type response
isValidCcLength($cc, $cardType)Validates the length of credit card number is correct for the card type
getCardTypeByPrefix($cc)Determines credit card type by the credit card number. You can pass to the
$ccargument only the first four digits of the credit card number, the entire number or anything in between.
$isCarteBlanch propertyFlag set by
getCardTypeByPrefix()if a Diners Club card is a CarteBlanch version
isMod10Valid($cc)Verifies if a credit card number passes the Mod 10 algorithm (the Luhn formula) that is used as a prerequisite to credit card processing. If a card fails Mod10 it will always be invalid.
chargeAuthNet($amount, $cc, $exp)Charges a credit card through AuthorizeNet and records meta data in properties:
$this->authnetResponse, $this->authnetResponseText, $this->authnetApprovalCodeand
AUTHNET_PASSWORDconstants be set in the .config file.