the-Jinxist / Pipeline-Assignment

A credit-card validation API built as a solution to the TalentQL Pipeline program technical assessment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pipeline-Assignment

A credit-card validation API built as a solution to the TalentQL Pipeline program technical assessment.

How the API was Implemented.


The API was built using barebones NodeJs without installing any framework or package, although it borrows from some of the semantics of popular NodeJs frameworks, especially ExpressJs.

Concepts like Routing, Middleware, and Response methods were implemented to make the API development easier and more organized.

Hosting

The API is hosted on Heroku at Validate Card API

API Endpoints

S/N Verb Endpoint Description
1 Get / Home route
2 Post /api/v1/cards/validate Validate a card

To clone

git clone https://github.com/darasimiolaifa/Pipeline-Assignment.git

Setup

  • Check the .env.example file in root directory and create a .env file copy of it.
  • Fill the empty properties with the appropriate values
  • Ensure that your request is sent with the API key in your .env file. The header key should be X-API-Key or x-api-key

To install

npm install

To start

npm start

To test

  • Request
    {
        "cardNumber": "6771335956445856",
        "expirationDate": "2021-11-31",
        "email": "darasimiolaifa@gmail.com",
        "cvv2": "123",
        "phoneNumber": "+2348133034408",
        "mobile": "+2348133034408"
    }
  • Response (json)
{
    "status": 200,
    "data": {
        "valid": true,
        "cardIssuer": "Maestro"
    }
}
  • Response (xml)
    <Response>
        <Status>200</Status>
        <Data>
            <valid>true</valid>
            <cardIssuer>Maestro</cardIssuer>
        </Data>
    </Response>

License

MIT

About

A credit-card validation API built as a solution to the TalentQL Pipeline program technical assessment.

License:MIT License


Languages

Language:JavaScript 99.9%Language:Shell 0.1%