#Finance
#cc
Generate a random credit card number. This card number will pass the Luhn algorithm so it looks like a legit card.
Optionally specify a particular type of card to return:
The type can be specified by the long name, or by the short name:
The types are enumerated below.
#cc_type
Return a random credit card type.
Default returns just the name. To return the entire object (consisting of name, short name, numeric prefix, and length), specify so with the raw flag.
The available types are (name - short_name):
- American Express - amex
- Bankcard - bankcard
- China UnionPay - chinaunion
- Diners Club Carte Blanche - dccarte
- Diners Club enRoute - dcenroute
- Diners Club International - dcintl
- Diners Club United States & Canada - dcusc
- Discover Card - discover
- InstaPayment - instapay
- JCB - jcb
- Laser - laser
- Maestro - maestro
- Mastercard - mc
- Solo - solo
- Switch - switch
- Visa - visa
- Visa Electron - electron
#currency
Generate a random currency.
#currency_pair
Generate a currency pair. Handy for simulating currency conversions. Guaranteed to return a unique pair (and not the same currency twice).
#dollar
Return a random dollar amount.
By default returns dollar amount no larger than 10000. Optionally specify the max to make it larger (or smaller).
#euro
Return a random euro amount. Formatting depends on the current locale (samples are displayed with european formatting)
By default returns euro amount no larger than 10000. Optionally specify the max to make it larger (or smaller).
#exp
Generate a random credit card expiration.
Optionally specify that a raw object be returned rather than a string
#exp_month
Generate a random credit card expiration month.
Optionally specify that it must be a later month than the current month.
So if called in June, this would return a random month from July - Dec. If called in October, would return November or December.
This because many credit card sandboxes require an expiration date later than the current date so it's necessary when generating an expiration with the current year to generate a month later than the current month.
#exp_year
Generate a random credit card expiration year.
Returns a random year between today and 10 years in the future.