Skip to content

Payment#

creditCardType#

Generate a credit card type.

echo $faker->creditCardType();

// 'MasterCard', 'Visa'

creditCardNumber#

Generate a credit card number with a given type. By default, a random type is used. Supported types are 'Visa', ' MasterCard', 'American Express', and 'Discover'.

Optionally, a second and third parameter may be supplied. These define if the credit card number should be formatted, and which separator to use.

echo $faker->creditCardNumber();

// '4556817762319090', '5151791946409422'

echo $faker->creditCardNumber('Visa');

// '4539710900519030', '4929494068680706'

echo $faker->creditCardNumber('Visa', true);

// '4624-6303-5483-5433', '4916-3711-2654-8734'

echo $faker->creditCardNumber('Visa', true, '::');

// '4539::6626::9844::3867', '4916::6161::0683::7022'

creditCardExpirationDate#

Generate a credit card expiration date (DateTime). By default, only valid dates are generated. Potentially invalid dates can be generated by using false as input.

echo $faker->creditCardExpirationDate();

// DateTime: between now and +36 months

echo $faker->creditCardExpirationDate(false);

// DateTime: between -36 months and +36 months

creditCardExpirationDateString#

Generate a credit card expiration date (string). By default, only valid dates are generated. Potentially invalid dates can be generated by using false as input.

The string is formatted using m/y. Optionally, a second parameter can be passed to override this format.

echo $faker->creditCardExpirationDateString();

// '09/23', '06/21'

echo $faker->creditCardExpirationDateString(false);

// '01/18', '09/21'

echo $faker->creditCardExpirationDateString(true, 'm-Y');

// '12-2020', '07-2023'

creditCardDetails#

Generate an array with credit card details. By default, only valid expiration dates will be generated. Potentially invalid expiration dates can be generated by using false as input.

echo $faker->creditCardDetails();

// ['type' => 'Visa', 'number' => '4961616159985979', 'name' => 'Mr. Charley Greenfelder II', 'expirationDate' => '01/23']

echo $faker->creditCardDetails(false);

// ['type' => 'MasterCard', 'number' => '2720381993865020', 'name' => 'Dr. Ivy Gerhold Jr.', 'expirationDate' => '10/18']

iban#

Generate an IBAN string with a given country and bank code. By default, a random country and bank code will be used.

The country code format should be ISO 3166-1 alpha-2.

echo $faker->iban();

// 'LI2690204NV3C0BINN164', 'NL56ETEE3836179630'

echo $faker->iban('NL');

// 'NL95ZOGL3572193597', 'NL76LTTM8016514526'

echo $faker->iban('NL', 'INGB');

// 'NL11INGB2348102199', 'NL87INGB6409935479'

swiftBicNumber#

Generate a random SWIFT/BIC number string.

echo $faker->swiftBicNumber();

// 'OGFCTX2GRGN', 'QFKVLJB7'