Validate_Finance_CreditCard
[ class tree: Validate_Finance_CreditCard ] [ index: Validate_Finance_CreditCard ] [ all elements ]

Class: Validate_Finance_CreditCard

Source Location: /Validate_Finance_CreditCard-0.5.3/Validate/Finance/CreditCard.php

Class Overview


Credit card related information validation class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 Stefan Neufeind

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
Credit card related information validation class

This class provides methods to validate:

  • Credit card number
  • Card security code
  • Card type (i.e. Visa, Mastercard...)
The methods only check the format of the data. For instance the package does NOT check if a card is a legitimate card registered with a card issuer, or if the card is reported stolen, etc...



[ Top ]


Method Detail

cvv   [line 249]

bool cvv( string $cvv, string $cardType)

Validates a card verification value format

This method only checks for the format. It doesn't validate that the value is the one on the card.

CVV is also known as

  • CVV2 Card Validation Value 2 (Visa)
  • CVC Card Validation Code (MasterCard)
  • CID Card Identification (American Express and Discover)
  • CIN Card Identification Number
  • CSC Card Security Code
Important information regarding CVV: If you happen to have to store credit card information, you must NOT retain the CVV after transaction is complete. Usually this means you cannot store it in a database, not even in an encrypted form. See http://www.pcisecuritystandards.org/

This method returns FALSE for card types that don't support CVV.


Parameters:

string   $cvv   —  value to verify
string   $cardType   —  type/brand of card (case insensitive) "MasterCard", "Visa", "AMEX", "AmericanExpress", "American Express", "Discover", "Eurocard/MasterCard", "Eurocard"

[ Top ]

Luhn   [line 66]

bool Luhn( string $number)

Validates a number according to Luhn check algorithm

This function checks given number according Luhn check algorithm. It is published on several places. See links for details.


Parameters:

string   $number   —  number to check

[ Top ]

number   [line 124]

bool number( string $creditCard, [string $cardType = null])

Validates a credit card number

If a type is passed, the card will be checked against it. This method only checks the number locally. No banks or payment gateways are involved. This method doesn't guarantee that the card is legitimate. It merely checks the card number passes a mathematical algorithm.

  • Return: TRUE if number is valid, FALSE otherwise
  • Access: public

Parameters:

string   $creditCard   —  number (spaces and dashes tolerated)
string   $cardType   —  type/brand of card (case insensitive) "MasterCard", "Visa", "AMEX", "AmericanExpress", "American Express", "Diners", "DinersClub", "Diners Club", "CarteBlanche", "Carte Blanche", "Discover", "JCB", "EnRoute", "Eurocard", "Eurocard/MasterCard".

[ Top ]

type   [line 175]

bool type( string $creditCard, string $cardType)

Validates the credit card number against a type

This method only checks for the type marker. It doesn't validate the card number. Some card "brands" share the same numbering system, so checking the card type against any of the sister brand will return the same result.

For instance, if a $card is a MasterCard, type($card, 'EuroCard') will also return true.


Parameters:

string   $creditCard   —  number (spaces and dashes tolerated)
string   $cardType   —  type/brand of card (case insensitive) "MasterCard", "Visa", "AMEX", "AmericanExpress", "American Express", "Diners", "DinersClub", "Diners Club", "CarteBlanche", "Carte Blanche", "Discover", "JCB", "EnRoute", "Eurocard", "Eurocard/MasterCard".

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:25:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.