Skip to content

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

Notifications You must be signed in to change notification settings

yitzhtal/payment-system-craft-demonstration-intuit-assignment

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published