0.1.2 • Published 3 years ago

@la-bete/ccgen v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

CCGen

codecov BuildStatus

A simple credit card generator.

Installation

    $ npm install @la-bete/ccgen

Basic Usage

import { CCGen } from "@la-bete/ccgen";
const ccgen = new CCGen();

const CC = ccgen.generateCC();
/*
    CC => {
        name: [string],
        cvv: [string],
        pan: [string],
        expiryDate: [string],
        brand: [string]
    }
*/

const pan = 12345678934567;
const isPANValid = ccgen.validatePAN(pan);
// isPANValid => false

GenerateCC

The generateCC method takes an optional Options argument. PAN(Primary Account Number) refers to the 16-digit number generated, BIN(Bank Identification Number) is the first 6 digits of a PAN and can be used to identify the PAN's brand and issuer. CC refers to the credit card generated as well as other details, such as name, cvv, expiry date

Available Issuers

For the options.issuer argument, you have to pass one of the keys of the object below. The corresponding bank is also shown below.

{
    "fcmb": "First City Monument Bank",
    "wema": "Wema Bank PLC",
    "union": "Union Bank of Nigeria",
    "access": "Access Bank PLC",
    "zenith": "Zenith Bank PLC",
    "gtb": "Guaranty Trust Bank PLC",
    "ecobank": "Ecobank Nigeria PLC",
    "stanbic": "Stanbic IBTC Bank",
    "uba": "United Bank for Africa PLC",
    "intercontinental": "Intercontinental Bank PLC",
    "polaris": "Polaris Bank PLC",
    "fbn": "First Bank of Nigeria PLC",
    "scbn": "Standard Chartered Bank"
};

ValidatePAN

This method can accept a single PAN or an array of PANs. If a single PAN is passed in, a boolean is returned which tells whether the PAN is Luhn-valid. If an array of PANs is passed in, an object is returned whose keys are the passed-in PANs while the entries are booleans showing the Luhn-validity of each key.

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago