Skip to content

lin-nova/payment_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Service

Payment Store is a Java-based application designed to manage client's payments and contracts. It provides a RESTful API for creating, retrieving, and managing payments and clients. The application uses Spring Boot for its backend framework and integrates with H2 for data persistence.

Application support the following features:

  • JWT-based authentication for secure access.
  • RESTful endpoints for managing payments.
  • Possibility to upload payments via CSV file in batch.
  • Exception handling and validation for uploaded files.
  • Database initialization with sample data for testing.

Prerequisites

Before running the application, ensure you have the following installed:

  • Docker
  • Docker Compose

Running the Application

  1. Clone the repository:

    git clone https://github.com/lin-nova/payment_service.git
    cd payment_service
  2. Build and run the application using Docker Compose:

    docker-compose up --build
  3. The application will be accessible at http://localhost:8080.

API Documentation

The application includes an OpenAPI (Swagger) specification for exploring and testing the API endpoints. Once the application is running, navigate to:

http://localhost:8080/swagger-ui/index.html

Testing

The project includes unit and integration tests. To run the tests, use the following command:

./mvnw test

For Local live testing with JWT tokens, you can use the following example tokens:

  • client1: eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJleGFtcGxlLmNvbSIsInN1YiI6ImNsaWVudDEiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NTY2NjczMDUsImV4cCI6MTc4ODIwMzMwNX0.aTYUxww1CfLYNMNO8wbsQ97HxLVkYc4_QXIHFcV7IWg
  • client2: eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJleGFtcGxlLmNvbSIsInN1YiI6ImNsaWVudDIiLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE3NTY2NjczMDUsImV4cCI6MTc4ODIwMzMwNX0.QIlBmsGTLNc8_TAxQeUjdlTpNZH6pvfO1bm53rVQ0cc Token was generated by using JwtGenerator.class.

Improvements and TODOs

  • Integration tests from PaymentController to PaymentRepository
  • Add proper Client registration and authentication with JWT tokens. (If required by the business logic)
  • Improve test coverage.

Questions to consider depending on service usage:

  • Should the payment be updated via a POST call to the DTO or a CSV file upload?
  • What 'relevant details' should the payment contain?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published