1 | # cc_type
|
2 |
|
3 | ```js
|
4 | // usage
|
5 | chance.cc_type()
|
6 | chance.cc_type({raw: true})
|
7 | ```
|
8 |
|
9 | Return a random credit card type.
|
10 |
|
11 | ```js
|
12 | chance.cc_type();
|
13 | => 'Visa'
|
14 | ```
|
15 |
|
16 | Default returns just the name. To return the entire object (consisting of name,
|
17 | short name, numeric prefix, and length), specify so with the raw flag.
|
18 |
|
19 | ```js
|
20 | chance.cc_type({raw: true});
|
21 | => {name: 'Discover Card', short_name: 'discover', prefix: '6011', length: 16}
|
22 | ```
|
23 |
|
24 | The available types are (name - *short_name*):
|
25 |
|
26 | * American Express - *amex*
|
27 | * Bankcard - *bankcard*
|
28 | * China UnionPay - *chinaunion*
|
29 | * Diners Club Carte Blanche - *dccarte*
|
30 | * Diners Club enRoute - *dcenroute*
|
31 | * Diners Club International - *dcintl*
|
32 | * Diners Club United States & Canada - *dcusc*
|
33 | * Discover Card - *discover*
|
34 | * InstaPayment - *instapay*
|
35 | * JCB - *jcb*
|
36 | * Laser - *laser*
|
37 | * Maestro - *maestro*
|
38 | * Mastercard - *mc*
|
39 | * Solo - *solo*
|
40 | * Switch - *switch*
|
41 | * Visa - *visa*
|
42 | * Visa Electron - *electron*
|