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

getCardTypeByPrefix($cc)

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

$isCarteBlanch property

Flag set by 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:

and

Requires the and constants be set in the .config file.