Technical Description

Payment service short description

The payment service main functionality is to track the payments done for a cart. When a cart has all articles desired by the customer the next stage is to proceed to pay it. For this, the cash register application sends requests to the payment service where it can paid using a series of supported payment methods, these are: cash, pinpad, telecash, sozialschein and loyalty. A cart can be paid with one or many of the supported payment methods, once is paid in full amount a receipt can be created for the purchase transaction. The service also supports refund payments, these are done when processing a payment for a refund cart, the payments are recorded with a negative amount.

The service communicates with the giftcard service when it processes payments with loyalty payment method, it only redeems payments from a giftcard once the cart involved in the transaction is completely paid.

The service exchanges asynchronous messages using Rabbitmq with the cart service, it sends an async message to the cart service when a cart is fully paid to update its status in the cart service. It also receives async messages from the cart service when a cart is discarded, so it can revert the payments done to the discarded cart.

Endpoints

Details of the endpoints provided by this service can be found here.

Dependencies

  • spring-boot-starter-web: Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container.
  • spring-boot-starter-jetty: Starter for using Jetty as the embedded servlet container. An alternative to spring-boot-starter-tomcat.
  • authjwt: OneX dependency to access custom data in JWTs.
  • spring-boot-starter-data-jpa: Starter for using Spring Data JPA with Hibernate.
  • spring-data-commons: Spring Data Core.
  • querydsl-jpa: JPA support for Querydsl.
  • querydsl-apt: Annotation processing tool based source code generation for Querydsl.
  • postgresql: PostgreSQL JDBC Driver Postgresql.
  • liquibase-core: Liquibase is a tool for managing and executing database changes.
  • h2: H2 Database Engine.
  • jdo-api: The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 243 under the auspices of the Java Community Process.
  • validation-api: Bean Validation API.
  • lombok: Spice up your java: Automatic Resource Management, automatic generation of getters, setters, equals, hashCode and toString, and more!
  • spring-cloud-starter-openfeign: A declarative REST client for Spring Boot apps.
  • spring-cloud-starter-netflix-ribbon: Ribbon is a client-side load balancer that gives you a lot of control over the behavior of HTTP and TCP clients.
  • jackson-databind: General data-binding functionality for Jackson: works on core streaming API.
  • springfox-swagger2: JSON API documentation for spring based applications.
  • springfox-swagger-ui: Javascript based user interface for JSON API documentation for spring based applications.
  • adyen-java-api-library: Adyen API Client Library for Java.
  • mapstruct: MapStruct artifact containing annotations to be used with JDK 8 and later.
  • mapstruct-processor: An annotation processor for generating type-safe bean mappers.
  • spring-boot-starter-test: Starter for testing Spring Boot applications with libraries including JUnit Jupiter, Hamcrest and Mockito.
  • spring-boot-starter-amqp: Starter for using Spring AMQP and Rabbit MQ.
  • spring-boot-starter-test: Starter for testing Spring Boot applications with libraries including JUnit Jupiter, Hamcrest and Mockito.