8000 GitHub - raphealolams/waffle
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

raphealolams/waffle

Repository files navigation

Getting Started

Backend Developer Assignment

Table of Contents

Prerequisites

you need to have the following installed on your machine

    node v11.3.0 or <=

Installing

Clone the Repository

    git clone https://github.com/raphealolams/waffle.git

Install Dependency

    npm install

Runnning The App

Development Mode

    npm run dev

Production Mode

    npm start

Test Cases

    npm run test

API Endpoint

Validate Card

  • Handles card validation

Verify Card

  • 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
    }

Balance

  • Handles Balance Inquiry

Get Balance

  • 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
    }

Services

  • Handles Services Available

Get Services

  • 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",
    }

Withdrawal

  • Handles Withdrawal

Withdraw Funds

  • 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
    }

Author

  • Ajilore Raphael Olamide - All works - github

What I Do

  • eat
  • code
  • sleep
  • repeat

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published