GithubHelp home page GithubHelp logo

0xvegeta / payment-service-backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 258 KB

A payment service platform to perform concurrent transaction in isolation

License: MIT License

JavaScript 98.26% Dockerfile 1.74%

payment-service-backend's Introduction

Payment Service

A Payment Gateway build upon NodeJS using ExpressJS. It basically is a backend application to be used by businesses to streamline the incoming payments from their respective customers.

Technology Stack

  • Server Enviornment - NodeJS
  • Framework - ExpressJS
  • Database - MongoDB
  • Cloud database service - MongoDB Atlas
  • Authorizatiion - JWT
  • Backend Deployment -

Installation

  • First, fork this repository and follow the given instructions:
# clone the repository to your local machine
$ git clone `git clone https://github.com/<YOUR-GITHUB-USERNAME>/payment-gateway.git`

# navigate to the project's directory and install all the relevant dev-dependencies as well as dependencies
$ npm i

# create a MongoDB Atlas instance and obtain the MongoDB URI
# choose a random JWT secret
# create a .env file with the following fields according to the knowledge obtained
   REDIS_HOST 
   REDIS_PORT 
   MONGO_URI 
   JWT_SECRET 
   
# Start application
$ npm start

# Make requests on http://localhost:PORT/ from Postman

Happy Flow

A business can login itself by entering email and password or register itself by entering the Organisation Name, email, password and category. A soon as a buisiness gets registered, a wallet is created for them using their credentials.

Basic Database Design diagram

Database design diagram

Payment-session API

Payment-session API

Accept Payment API

Accept-payment

API Reference

Get all items

API Reference

/api/v1/org

REQUEST METHODS ENDPOINTS DESCRIPTION
POST /register Register your organization
POST /login Login from your organization account
GET /profile Get your organization profile
PUT /put Add/update addition profile details

/api/v1/txn

REQUEST METHODS ENDPOINTS DESCRIPTION
POST /payment-session/:walletCode Create a unique payment session
POST /accept-payment/:transactionTraceId Accept payment
POST /transaction Get all transaction details of an organization

/api/v1/wallets

REQUEST METHODS ENDPOINTS DESCRIPTION
POST / Create a wallet within an organization
GET / Get all the wallets of a user

Future Scope

1. A queuing service (probably Kafka/RabbitMQ) to significantly increase throughput of the API and reduce load on the database
2. Add invoicing (and OTP service) via RabbitMQ
3. Add refund/withdraw APIs and handle failure scenarios at each step

payment-service-backend's People

Contributors

0xvegeta avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.