CORE POS - IS4C
The CORE POS front end
Public Member Functions | List of all members
COREPOS\pos\plugins\Paycards\card\CardReader Class Reference

Public Member Functions

 cardInfo ($pan)
 
 accepted ($pan)
 
 type ($pan)
 
 issuer ($pan)
 
 magstripe ($data)
 
 maskPAN ($pan, $first, $last)
 

Member Function Documentation

COREPOS\pos\plugins\Paycards\card\CardReader::accepted (   $pan)

Check whether a given card is accepted

Parameters
$panthe card number
Returns
  • 1 if accepted
  • 0 if not accepted
COREPOS\pos\plugins\Paycards\card\CardReader::cardInfo (   $pan)

Identify card based on number

Parameters
$pancard number
Returns
array with keys:
  • 'type' paycard type constant
  • 'issuer' Vista, MasterCard, etc
  • 'accepted' boolean, whether card is accepted
  • 'test' boolean, whether number is a testing card

EBT-Specific Notes: EBT BINs added 20Mar14 by Andy Based on NACHA document; that document claims to be current as of 30Sep10.

Issuer is normally give as EBT (XX) where XX is the two character state postal abbreviation. GUAM is Guam and USVI is US Virgin Islands. A few states list both a state BIN number and a federal BIN number. In these cases there's an asterisk after the postal abbreviation. Maine listed both a state and federal BIN but they're identical so I don't know how to distinguish. The PAN length is not listed for Wyoming. I guessed 16 since that's most common.

COREPOS\pos\plugins\Paycards\card\CardReader::issuer (   $pan)

Get paycard issuer

Parameters
$panthe card number
Returns
string issuer

Issuers include "Visa", "American Express", "MasterCard", and "Discover". Unrecognized cards will return "Unknown".

COREPOS\pos\plugins\Paycards\card\CardReader::magstripe (   $data)

Extract information from a magnetic stripe

Parameters
$datathe stripe data
Returns
An array with keys:
  • 'pan' the card number
  • 'exp' the expiration as MMYY
  • 'name' the cardholder name
  • 'tr1' data from track 1
  • 'tr2' data from track 1
  • 'tr3' data from track 1

Not all values will be found in every track. Keys with no data will be set to False.

If the data is really malformed, the return will be an error code instead of an array.

COREPOS\pos\plugins\Paycards\card\CardReader::type (   $pan)

Determine card type

Parameters
$panthe card number
Returns
a paycard type constant

The documentation for this class was generated from the following file: