Open-Source PHP Framework - Designed for rapid development of performance-oriented scalable applications

Credit card component

API >> mvc >> components >> cc
Credit card and payment-processing related functions.

$ccTestNumbers property

Array of commonly used test credit card numbers, these will always pass Mod10 validation but their accounts will respond declined.

$cardTypes property

Credit 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


Determines credit card type by the credit card number. You can pass to the $cc argument only the first four digits of the credit card number, the entire number or anything in between.

$isCarteBlanch property

Flag set by getCardTypeByPrefix() if a Diners Club card is a CarteBlanch version


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->authnetApprovalCode and $this->authnetTransactionId
Requires the AUTHNET_LOGIN and AUTHNET_PASSWORD constants be set in the .config file.