Giter Site home page Giter Site logo

talitz / payment-system-craft-demonstration-intuit-assignment Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 4.0 242 KB

Implementation of a peer to peer distributed payment system that can be integrated to one of the Intuit products.

Java 91.17% Shell 3.47% HTML 4.68% TSQL 0.68%

payment-system-craft-demonstration-intuit-assignment's Introduction

Payment-System-Craft-Demonstration-Intuit-Assignment

Introduction:

Implementation of a peer to peer distributed payment system that can be integrated to one of the Intuit products.

  • REST Payment API - Implemented using Spring Framework in Java, receives the payment requests and publishes to the rabbit-me message queue.
  • RabbitMQ Message Queue - Receives the REST API requests and stores it in it's queue.
  • Risk Engine - consumes messages from the RabbitMQ Message queue, performs risk analysis and store the results in MySQL 5.7 Database.
  • MySQL 5.7 - an open-source relational database management system.

Prerequisites:

  • Docker 19.03.5.
  • Java 1.8.0_221.
  • Maven 3.6.0.
  • The following ports should be open before running the project: 8080, 8087, 5672, 8081.

Running the Project:

Please strictly follow each step of the following:

  1. Clone the project to your local directory:
    git clone https://github.com/talitz/payment-system-craft-demonstration-intuit-assignment.git.

  2. CD into the directory: cd payment-system-craft-demonstration-intuit-assignment.

  3. Provide permissions to the shell running scripts: chmod 755 *.sh.

  4. Run the RabbitMQ Message queue first (provide your root password):
    sudo ./run-rabbitmq-with-mysql.sh.

You can install 'MySQLWorkbench' and verify the database connection with the following details:

  • Hostname: localhost; port 3360.
  • user name and password are talitz;1234.
  1. Run the Risk Engine Service: sudo ./run-risk-engine.sh.

  2. Open a new terminal, and run the Rest Payment Service:

  • cd payment-system-craft-demonstration-intuit-assignment
  • sudo ./run-rest-payment-service.sh.

You are now ready to go.

  • Create payments under 'Create Payment' button here: payment-system-craft-demonstration-intuit-assignment/create_payment.html:

  • A successful payment must be sent with a valid credit card number, you can use "5196081888500645" for your manual testing / any other valid credit card number.

View the results in two ways:

  • All database rows are written into the console log after each payment is processed:


  • In 'MySQLWorkbench' (or any other SQL monitoring tool), after achieving database connection (localhost:3360;talitz;1234):


  1. Terminate the project using: sudo ./terminate.sh.

What's Next?

  • Run the Spring project in a containerized Java & Maven Docker environment.
  • Secure the system - use specific username & password for connecting to RabbitMQ.
  • Design a UI to present the DataBase rows under 'Processed Payments' html tab.
  • Run the 'Risk Engine' process on multiple machines to achieve Horizontal Scalability.


Code Review - Israel

  • Running containers with Docker Compose.
  • Rest API design - query params instead of request body, API naming (create-payment).
  • Usage of "controller" for logging + exposure of info level only (LoggingController).
  • Payment amount received and retained as string, validation on arbitrary hard-coded amount.
  • Info instead of debug logging.
  • Validation in code instead of spring framework.
  • Overriding of IDs in controller (why?).
  • API for returning all payment methods/payees returns hard-coded list of one item instead of accessing the DB.
  • Hard-coded queue instead of using configuration.
  • Risk microservice application class registers a callback for message listening (instead of doing it in a separate class).
  • MQ callback not in its own class.
  • Spring annotations not used (Initializing bean, message listener).

payment-system-craft-demonstration-intuit-assignment's People

Contributors

talyitzhak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.