UNPKG

927 BMarkdownView Raw
1# cc_type
2
3```js
4// usage
5chance.cc_type()
6chance.cc_type({raw: true})
7```
8
9Return a random credit card type.
10
11```js
12chance.cc_type();
13=> 'Visa'
14```
15
16Default returns just the name. To return the entire object (consisting of name,
17short name, numeric prefix, and length), specify so with the raw flag.
18
19```js
20chance.cc_type({raw: true});
21=> {name: 'Discover Card', short_name: 'discover', prefix: '6011', length: 16}
22```
23
24The 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*