README.md

December 3, 2023 Β· View on GitHub


MockPay Logo
MockPay

forthebadge made with Java MIT License contains cat gifs forthebadge built with love

Quality Gate Status Build Status Release Version Last Commit Contributions Welcome

Mock of a simple Payments Backend πŸš€
🚧 Work in Progress (WIP)

πŸ“œ Table of Contents

🌟 Introduction

Simplify your payment processing with our lightweight and user-friendly payments backend. Crafted to emulate the core functionalities of renowned payment gateways, this backend delivers a straightforward solution for simulating seamless payment transactions.

πŸ› οΈ Architecture

Explore the inner workings: a clear visual breakdown of the system's design and flow, simplifying the complexity behind MockPay's architecture.

System Design and Flow

Mockpay system-design-and-flow

Authentication Flow

Mockpay authentication-flow

CI-CD Pipline

Mockpay ci-cd

πŸ“š API Documentation

  • Identity Service

    • Deployed Base URL: https://identity-service-mockpay-c77097e48e00.herokuapp.com

    • Endpoint: /identity-service/v1/user/create

      • Description: Create a new mockpay user.

      • HTTP Method: POST

      • Payload: JSON

        {
            "name": "userOne",
            "email": "userOne@gmail.com",
            "password": "jfkgdhjsgf",
            "mobile": "+91987654321",
            "age": 25,
            "userType": "CLIENT"
        }
        
        
    • Endpoint: /identity-service/v1/user/fetch

      • Description: Get the current authenticated mockpay user.
      • HTTP Method: GET
      • Header: Authorization Bearer JWT Token
    • Endpoint: /identity-service/v1/user/update

      • Description: Update authenticated mockpay user.

      • Header: Authorization Bearer JWT Token

      • HTTP Method: PATCH

      • Payload: JSON

        {
            // "name": "userOne"
            // "email": "userOne@gmail.com",
            "password": "525gh5h435hr45h6455qwdz"
            // "authorities": "CREATE_USER,UPDATE_USER,DELETE_USER"
        }
        
        
    • Endpoint: /identity-service/v1/user/delete

      • Description: Delete authenticated mockpay user.
      • Header: Authorization Bearer JWT Token
      • HTTP Method: DELETE
    • Endpoint: /identity-service/v1/token/generate

      • Description: Generate JWT access token for a mockpay user.
      • Header: Authorization Basic base64(username:password)
      • HTTP Method: GET
    • Endpoint: /identity-service/v1/token/verify

      • Description: Verify given JWT access token.

      • Header: Authorization Basic base64(serviceUser:serviceUserPassword)

      • HTTP Method: POST

      • Payload: JSON

        {
        "username": "userOne@gmail.com",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
        }
        
        
  • Transaction Service

    • Deployed Base URL: https://transaction-service-mockpay-7d36a97aa9b9.herokuapp.com

    • Endpoint: /transaction-service/v1/transaction/fetch

      • Description: Get all transactions for authenticated mockpay user.
      • Header: Authorization Bearer JWT Token
      • HTTP Method: GET
    • Endpoint: /transaction-service/v1/transaction/transact

      • Description: Create a new transaction.

      • HTTP Method: POST

      • Payload: JSON

        {
            "receiverId": "userTwo@gmail.com",
            "amount": 30,
            "reason": "Dinner"
        }
        
        
  • Wallet Service

    • Deployed Base URL: https://wallet-service-mockpay-0ec11f774315.herokuapp.com
    • Endpoint: /wallet-service/v1/wallet/fetch
      • Description: Get wallet balance of current authenticated mockpay user.
      • Header: Authorization Bearer JWT Token
      • HTTP Method: GET

πŸ” Sonar Cloud Reports

πŸ”© Built With

  • Java - Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
  • Spring Boot - Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
  • MySQL - MySQL is an open-source relational database management system.
  • Apache Kafka - Apache Kafka is a distributed event store and stream-processing platform.
  • Redis - Redis is an open-source in-memory storage, used as a distributed, in-memory key–value database, cache and message broker, with optional durability.