this is a simple node.js project that provides information about credit cards through API calls. the application retrieves details about credit cards, including validity, scheme (VISA, MASTERCARD, AMEX), and, when available, the bank.
the goal is to retrieve a series of information on credit cards through API calls. the application should provide its consumers with the details about credit cards:
- valid/not valid;
- the scheme (i.e VISA, MASTERCARD or AMEX);
- the bank when it is available.
create a REST API service that will reply to a GET call. The endpoint should look like this: this:
GET <web-server-address>/api/card-scheme/verify/<card-number>
in case of successful response, the returned object should look like this:
{
"success": true
"payload" : {
"scheme": "visa",
"type" : "debit",
"bank" : "UBS"
}
}
to obtain this information, you should use a 3rd party service, such as BinList.
create a REST API service that will reply to a GET call. The endpoint should look like this:
GET <web-server-address>/api/card-scheme/stats?start=1&limit=3
in case of successful response, the returned object should look like this:
{
"success": true
"start": 1,
"limit": 3,
"size": 133,
"payload": {
"<card-xyz>": 5,
"<card-jkl>": 4,
"<card-bnm>": 1
}
}
where size
represents the byte of the payload. Inside the payload, provide the list of cards that were checked in the step 1 alongside the number of requests made for each card. You can store this information in memory or on a file.
- you should have Node.js installed.
clone the repository:
git clone https://github.com/your-username/node-project_credit-card.git
- navigate to the project folder:
cd step1_verify
- install dependencies:
npm install express npm install axios
- run the project
- Navigate to the project folder:
cd step2_card-scheme
- Install dependencies:
npm install express
- run the project
This project is licensed under the MIT License.
if you have any further questions: