Compare commits

..

2 commits

6 changed files with 25 additions and 46 deletions

View file

@ -0,0 +1,3 @@
# SPRING-ARC-RUN-1783834407-attempt-2-run-ecf6215222a4
Forge 이슈 작업 브랜치 `forge/SPRING-ARC-RUN-1783834407-attempt-2-run-ecf6215222a4`.

View file

@ -1,3 +0,0 @@
# iss-478981daa4be-attempt-1-run-c0b7e9d69a7a
Forge 이슈 작업 브랜치 `forge/iss-478981daa4be-attempt-1-run-c0b7e9d69a7a`.

View file

@ -1,3 +0,0 @@
# iss-e2325889b406-attempt-1-run-0207d2e91028
Forge 이슈 작업 브랜치 `forge/iss-e2325889b406-attempt-1-run-0207d2e91028`.

View file

@ -0,0 +1,22 @@
# ADR: Payment Boundary
## Context
In order to integrate a payment gateway effectively, we need to ensure a clear boundary between the domain logic and external payment processes. This boundary helps maintain system integrity and promotes loose coupling, facilitating easier updates and replacements of payment systems in the future.
## Decision
We will implement an adapter pattern for the payment integration. The payment gateway will be accessed through a port interface from the domain services, ensuring the domain does not directly reference the gateway implementation.
The key points are:
- Use of port interfaces to access payment services.
- Define specific adapters for each payment gateway.
- Ensure that the domain logic is independent of external payment systems.
## Alternatives
- **Direct Integration:** Directly calling payment gateway APIs from domain services.
- **Consequences:** Tight coupling between domain and payment systems, leading to harder maintenance and updates.
- **Service Layer Approach:** Introduce a service layer without adapters.
- **Consequences:** This could increase complexity without achieving the decoupling we desire, as the service layer would still need to know about the payment gateway details.
## Consequences
By implementing the proposed decision:
- We achieve a clear separation of concerns, improving maintainability.
- The domain layer remains clean and focused on its core business logic without knowledge of payment gateway specifics.

View file

@ -1,9 +0,0 @@
# Package Map
| Package | Responsibility | Forbidden Dependencies |
|----------------|---------------------------------------------------------|-----------------------|
| controller | Handle incoming requests, validate input | service |
| service | Business logic, coordination between layers | repository |
| repository | Data access and persistence | domain |
| domain | Core business models and logic | integration |
| integration | Interact with external systems, including payment gateways | domain |

View file

@ -1,31 +0,0 @@
```mermaid
sequenceDiagram
participant User
participant PaymentGateway
participant Database
%% 정상 흐름 %%
User->>PaymentGateway: 결제 요청
PaymentGateway->>User: 결제 승인
User->>Database: 거래 기록 저장
Database-->>User: 거래 성공
%% 커밋 %%
User->>Database: 커밋
Database-->>User: 커밋 완료
%% 외부 실패 %%
User->>PaymentGateway: 결제 요청
PaymentGateway-->>User: 결제 실패
%% 롤백 %%
User->>Database: 롤백
Database-->>User: 롤백 완료
%% DB 실패 %%
User->>PaymentGateway: 결제 요청
PaymentGateway->>User: 결제 승인
User->>Database: 거래 기록 저장
Database-->>User: DB 오류
%% 롤백 %%
User->>Database: 롤백
Database-->>User: 롤백 완료
```