Backend Developer Assignment
you need to have the following installed on your machine
node v11.3.0 or <=
Clone the Repository
git clone https://github.com/raphealolams/waffle.git
Install Dependency
npm install
npm run dev
npm start
npm run test
- Handles card validation
-
This method send's card details after the card reader captures the account information stored on the magnetic stripe
URL :
/api/verifyCard
Method :
POST
Auth required :
NO
Body:
{ "pin": "", "bank": "", "accountNumber": "", "cardType": "", "cardNumber": "" }
Success Response
Description :
Response Object
Code :
200 OK
Content
{ "status": true, "message": "", "token": "" }
Error Responses
Description :
Return a error object.
Code : ``
Content :
{ "status": false, "message": "invalid credentials", "pinLimitReached": false, "retainCard": false }
- Handles Balance Inquiry
-
Get's Account Balance
URL :
/api/getBalance
Method :
GET
Auth required :
YES
Auth Header:
{ "USER-KEY": "bearer " }
Body:
Success Response
Description :
Response Object
Code :
200 OK
Content
{ "status": true, "message": "", "balance": { "availableBalance": "NGN10,000.00", "ledgerBalance": "NGN10,000.00" } }
Error Responses
Description :
Return a error object.
Code : ``
Content :
{ "status": false, "message": "Financial Institution Not Available", "balance": null }
- Handles Services Available
-
Get
URL :
/api/getAvailableServices
Method :
GET
Auth required :
YES
Auth Header:
{ "USER-KEY": "bearer " }
Body:
Success Response
Description :
Response Object
Code :
200 OK
Content
{ "status": true, "message": "Here are the available services", "services": [ "Cash Withdrawal", "Balance Inquiry", "Bills Payment", "Quick Teller", "Change Pin" ] }
Error Responses
Description :
Return a error object.
Code : ``
Content :
{ "status": false, "message": "Financial Institution Not Available", }
- Handles Withdrawal
-
Withdraw Funds
URL :
/api/withdrawFunds
Method :
POST
Auth required :
YES
Auth Header:
{ "USER-KEY": "bearer " }
Body:
{ "amount": "500", "accountType": "savings" }
Success Response
Description :
Response Object
Code :
200 OK
Content
{ "status": true, "message": "Withdrawal Successful", "receiptPath": "path to receipt" }
Error Responses
Description :
Return a error object.
Code : ``
Content :
{ "status": false, "message": "Insufficient Funds" || "Enter Amount Greater than or equal to 500" || "Enter Amount in multiples of 500 or 1000", "receiptPath": null }
- Ajilore Raphael Olamide - All works - github
- eat
- code
- sleep
- repeat