-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from T9404/feature/payment-gate-integration
Feature/payment gate integration
- Loading branch information
Showing
168 changed files
with
4,144 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ WORKDIR /api | |
|
||
COPY /build/libs/*.jar api.jar | ||
|
||
EXPOSE ${API_PORT} | ||
|
||
CMD ["java", "-jar", "api.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
server: | ||
port: 8083 | ||
port: ${API_PORT:8083} | ||
|
||
api: | ||
client: | ||
origination: | ||
grpc: | ||
host: ${ORIGINATION_GRPC_HOST} | ||
port: ${ORIGINATION_GRPC_PORT} | ||
host: ${ORIGINATION_GRPC_HOST:localhost} | ||
port: ${ORIGINATION_GRPC_PORT:9094} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM openjdk:17-ea-22-jdk-oracle | ||
|
||
WORKDIR /merchant-provider | ||
|
||
COPY /build/libs/*.jar merchant-provider.jar | ||
|
||
EXPOSE ${MERCHANT_PROVIDER_PORT} | ||
|
||
CMD ["java", "-jar", "merchant-provider.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
plugins { | ||
alias(libs.plugins.spring) | ||
alias(libs.plugins.spring.dependency.management) | ||
alias(libs.plugins.liquibase.gradle) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation libs.spring.web | ||
implementation libs.jdbc | ||
implementation libs.liquibase.core | ||
liquibaseRuntime libs.postgresql | ||
runtimeOnly libs.postgresql | ||
|
||
compileOnly libs.lombok | ||
annotationProcessor libs.lombok | ||
|
||
implementation libs.webflux | ||
|
||
testImplementation libs.jupiter | ||
testImplementation libs.spring.boot.starter.test | ||
testImplementation libs.testcontainers | ||
testImplementation libs.jupiter.testcontainers | ||
testImplementation libs.postgresql.testcontainers | ||
testImplementation libs.rest.assured | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Merchant Provider | ||
|
||
## Overview | ||
|
||
The Merchant Provider (MP) is responsible for managing payment methods. | ||
It is also responsible for the disbursement and receipt of funds for merchant. | ||
The MP is responsible for both sending money to merchants and accepting payments through a Payment Provider. | ||
|
||
MP utilizes gRPC for seamless communication with the Payment Engine. You can find a contract in `src/main/proto` | ||
|
||
## Architecture Overview | ||
|
||
Link to the architecture diagram: [Architecture Diagram](https://miro.com/app/board/uXjVNWFTMec=/?share_link_id=279324309467) | ||
|
||
|
||
## Folder Structure | ||
|
||
Following a [hybrid]((https://priyalwalpita.medium.com/software-architecture-patterns-layered-architecture-a3b89b71a057)) (layered) architecture. | ||
|
||
## Dependencies | ||
|
||
All dependencies used by the project can be found in the `build.gradle` files (both in the root and this module). | ||
|
||
You can find the versions of the dependencies in the `gradle/libs.versions.toml` in the root. |
28 changes: 28 additions & 0 deletions
28
merchant-provider/src/main/java/com/academy/fintech/mp/MerchantProviderApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.academy.fintech.mp; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.websocket.servlet.WebSocketServletAutoConfiguration; | ||
import org.springframework.boot.builder.SpringApplicationBuilder; | ||
import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
|
||
@EnableScheduling | ||
@SpringBootApplication( | ||
exclude = { | ||
GsonAutoConfiguration.class, | ||
MultipartAutoConfiguration.class, | ||
WebSocketServletAutoConfiguration.class, | ||
NettyAutoConfiguration.class, | ||
} | ||
) | ||
public class MerchantProviderApplication { | ||
|
||
public static void main(String[] args) { | ||
new SpringApplicationBuilder(MerchantProviderApplication.class) | ||
.beanNameGenerator(new FullyQualifiedAnnotationBeanNameGenerator()) | ||
.run(args); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
merchant-provider/src/main/java/com/academy/fintech/mp/configuration/WebClientConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.academy.fintech.mp.configuration; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
@Configuration | ||
public class WebClientConfig { | ||
|
||
@Bean | ||
public WebClient webClient() { | ||
return WebClient.builder() | ||
.defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) | ||
.build(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
merchant-provider/src/main/java/com/academy/fintech/mp/core/common/BusinessException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.academy.fintech.mp.core.common; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class BusinessException extends RuntimeException { | ||
private final EventInfo eventInfo; | ||
|
||
public BusinessException(EventInfo eventInfo, String message) { | ||
super(message); | ||
this.eventInfo = eventInfo; | ||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
merchant-provider/src/main/java/com/academy/fintech/mp/core/common/EventInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.academy.fintech.mp.core.common; | ||
|
||
import org.slf4j.event.Level; | ||
import org.springframework.http.HttpStatus; | ||
|
||
public interface EventInfo { | ||
HttpStatus getStatus(); | ||
|
||
Level getLevel(); | ||
} | ||
|
Oops, something went wrong.