PHP Class Faker\Provider\Payment

Inheritance: extends Faker\Provider\Base
Mostra file Open project: fzaninotto/faker

Public Properties

Property Type Description
$expirationDateFormat

Protected Properties

Property Type Description
$cardParams see http://en.wikipedia.org/wiki/Bank_card_number for a reference of existing prefixes
$cardVendors
$ibanFormats list of IBAN formats, source: @link https://www.swift.com/standards/data-standards/iban

Public Methods

Method Description
creditCardDetails ( boolean $valid = true ) : array
creditCardExpirationDate ( boolean $valid = true ) : Faker\Provider\DateTime
creditCardExpirationDateString ( boolean $valid = true, string $expirationDateFormat = null ) : string
creditCardNumber ( string $type = null, boolean $formatted = false, string $separator = '-' ) : string Returns the String of a credit card number.
creditCardType ( ) : string
iban ( string $countryCode, string $prefix = '', integer $length = null ) : string International Bank Account Number (IBAN)
swiftBicNumber ( ) : string Return the String of a SWIFT/BIC number

Protected Methods

Method Description
addBankCodeChecksum ( string $iban, string $countryCode = '' ) : string Calculates a checksum for the national bank and branch code part in the IBAN.

Method Details

addBankCodeChecksum() protected static method

Calculates a checksum for the national bank and branch code part in the IBAN.
protected static addBankCodeChecksum ( string $iban, string $countryCode = '' ) : string
$iban string randomly generated $iban
$countryCode string ISO 3166-1 alpha-2 country code
return string IBAN with one character altered to a proper checksum

creditCardDetails() public method

public creditCardDetails ( boolean $valid = true ) : array
$valid boolean True (by default) to get a valid expiration date, false to get a maybe valid date
return array

creditCardExpirationDate() public method

public creditCardExpirationDate ( boolean $valid = true ) : Faker\Provider\DateTime
$valid boolean True (by default) to get a valid expiration date, false to get a maybe valid date
return Faker\Provider\DateTime

creditCardExpirationDateString() public method

public creditCardExpirationDateString ( boolean $valid = true, string $expirationDateFormat = null ) : string
$valid boolean True (by default) to get a valid expiration date, false to get a maybe valid date
$expirationDateFormat string
return string

creditCardNumber() public static method

Returns the String of a credit card number.
public static creditCardNumber ( string $type = null, boolean $formatted = false, string $separator = '-' ) : string
$type string Supporting any of 'Visa', 'MasterCard', 'American Express', and 'Discover'
$formatted boolean Set to true if the output string should contain one separator every 4 digits
$separator string Separator string for formatting card number. Defaults to dash (-).
return string

creditCardType() public static method

public static creditCardType ( ) : string
return string Returns a credit card vendor name

iban() public static method

International Bank Account Number (IBAN)
public static iban ( string $countryCode, string $prefix = '', integer $length = null ) : string
$countryCode string ISO 3166-1 alpha-2 country code
$prefix string for generating bank account number of a specific bank
$length integer total length without country code and 2 check digits
return string

swiftBicNumber() public static method

Return the String of a SWIFT/BIC number
public static swiftBicNumber ( ) : string
return string Swift/Bic number

Property Details

$cardParams protected_oe static_oe property

see http://en.wikipedia.org/wiki/Bank_card_number for a reference of existing prefixes
protected static $cardParams

$cardVendors protected_oe static_oe property

protected static $cardVendors

$expirationDateFormat public_oe static_oe property

public static $expirationDateFormat

$ibanFormats protected_oe static_oe property

list of IBAN formats, source: @link https://www.swift.com/standards/data-standards/iban
protected static $ibanFormats