Micro Payment Service

github.com

This application serves as a proof of concept for splitting the payment gateway into several microservices. In developing these microservices, I have employed Hexagonal Architecture and Domain Driven Development principles to facilitate testing, maintenance, and scaling.

In this project, I utilize several key technologies, including:

  1. gRPC for communication between microservices.
  2. Chi as an HTTP server adapter.
  3. Paseto as a JWT generator.
  4. Redis as a session storage.
  5. PostgreSQL for transactional data storage.
  6. MongoDB for log storage.
  7. RabbitMQ/Kafka as a message broker.
  8. Docker is used to containerize the application and serve as the development environment.
admin-page

Microservices

In this project, I created several microservices according to the domain as shown above.

Gateway Microservice (Broker)

github.com

This microservice serves as a gateway for requests from frontend applications such as web, mobile, or desktop applications. Broker is a microservice that forwards requests from clients to other microservices according to the endpoint.

For example, when there is a request to make a payment, the broker validates the token to the Session Service and then makes a payment request to the Payment Service.

Session Microservice

github.com

This microservice serves to create and delete sessions. In addition, Session Microservice has functions to create and validate tokens.

Auth Microservice

github.com

This microservice functions as a service for user authentification. This microservice also has a function to create new users.

Payment Service

github.com

This microservice is the core of the application. Payment microservice is in charge of making Inquiry, and Payment to the biller service according to the product code sent from the frontend.

This microservice also stores outlet data such as balances. Each user has its own outlet. Currently, one user can only have one outlet. However, in the production application, each user can have more than one outlet.

Biller Service

github.com

This application is actually outside of the payment microservice because in practice, this application is maintained by other providers such as the regional revenue office, and other regional companies.