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.
The API is hosted on Heroku at Validate Card API
S/N | Verb | Endpoint | Description |
---|---|---|---|
1 | Get | / | Home route |
2 | Post | /api/v1/cards/validate | Validate a card |
git clone https://github.com/darasimiolaifa/Pipeline-Assignment.git
- 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
orx-api-key
npm install
npm start
- 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>
MIT