Compare commits

..

11 commits

Author SHA1 Message Date
615d10ff93 Merge pull request '결제 전환 목표 아키텍처 정의 (1/2) (1/2)' (#5) from forge/SPRING-ARC-QUALITY-1783831207-attempt-2 into main 2026-07-12 04:44:43 +00:00
6a5098ebe1 결제 전환 목표 아키텍처 정의 (1/2) (1/2) (SPRING-ARC-QUALITY-1783831207)
All checks were successful
ci / test (pull_request) Successful in 7s
2026-07-12 04:44:23 +00:00
ce291ba9ec Merge pull request '결제 전환 목표 아키텍처 정의 (1/2) (2/2)' (#4) from forge/iss-8fd82b653bff-attempt-1 into main 2026-07-12 04:44:14 +00:00
0541f0a989 결제 전환 목표 아키텍처 정의 (1/2) (2/2) (iss-8fd82b653bff)
All checks were successful
ci / test (pull_request) Successful in 7s
2026-07-12 04:43:52 +00:00
5dd7302aa9 forge: open work branch for iss-8fd82b653bff-attempt-1 2026-07-12 04:42:44 +00:00
64d285762e 결제 전환 목표 아키텍처 정의 (1/2) (SPRING-ARC-QUALITY-1783831207) 2026-07-12 04:42:18 +00:00
4ac5045734 Merge pull request '결제 전환 목표 아키텍처 정의 (2/2)' (#3) from forge/iss-155aa95ea6df-attempt-2 into main 2026-07-12 04:42:07 +00:00
040b29aa5a 결제 전환 목표 아키텍처 정의 (2/2) (iss-155aa95ea6df)
All checks were successful
ci / test (pull_request) Successful in 6s
2026-07-12 04:41:46 +00:00
2bc7c0718b forge: open work branch for iss-155aa95ea6df-attempt-2 2026-07-12 04:41:39 +00:00
73f993754f 결제 전환 목표 아키텍처 정의 (SPRING-ARC-QUALITY-1783831207) 2026-07-12 04:41:00 +00:00
b141cac6bc forge: open work branch for SPRING-ARC-QUALITY-1783831207-attempt-2 2026-07-12 04:40:47 +00:00
7 changed files with 83 additions and 21 deletions

View file

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

View file

@ -1,3 +0,0 @@
# iss-155aa95ea6df-attempt-1
Forge 이슈 작업 브랜치 `forge/iss-155aa95ea6df-attempt-1`.

View file

@ -0,0 +1,3 @@
# iss-155aa95ea6df-attempt-2
Forge 이슈 작업 브랜치 `forge/iss-155aa95ea6df-attempt-2`.

View file

@ -0,0 +1,3 @@
# iss-8fd82b653bff-attempt-1
Forge 이슈 작업 브랜치 `forge/iss-8fd82b653bff-attempt-1`.

View file

@ -0,0 +1,35 @@
# ADR for Payment Boundary Definition
## Context
In the payment processing system, clarity and delineation of boundaries are critical for ensuring security, maintainability, and scalability. Understanding the interactions between different components that handle payment transactions will help manage risks associated with payment data and integrations with external systems.
The current system lacks a well-defined architecture for its payment processing boundaries. This has led to difficulties in isolating payment-related components, enforcing security measures, and integrating with third-party payment providers.
## Decision
1. **Establish Clear Payment Boundaries**:
- Define a dedicated Payment Service responsible for handling all payment transactions.
- Separate the payment logic from other business logic to adhere to the single responsibility principle.
- The Payment Service will interact with external payment gateways, ensuring that sensitive payment data remains secure and encapsulated.
2. **Adopt Event-Driven Architecture**:
- Introduce an event bus for communication between the Payment Service and other components (e.g., Order Service, Notification Service). This will allow for decoupled interactions and better scalability.
- Utilize events such as `PaymentProcessed`, `PaymentFailed`, and `RefundProcessed` to notify other services about payment outcomes.
3. **Implement Strong Authentication and Authorization**:
- All access to the Payment Service must go through an authentication layer, verifying the identity and permissions of the calling service.
- Enforce strict access controls to sensitive payment processing endpoints.
## Alternatives
- **Tightly Coupled Monolithic Approach**: Keeping the payment logic embedded within a monolithic application, which would simplify communications at the cost of flexibility and security. Not recommended due to increased risk and reduced scalability.
- **Using Microservices Without Boundaries**: Deploying multiple microservices interacting directly with each other without a clear Payment Service, leading to potential security vulnerabilities and a tangled codebase. Not recommended due to maintainability concerns.
## Consequences
Implementing these boundaries will lead to:
- Increased security around payment processing, protecting sensitive customer data.
- Improved maintainability, as the payment logic is separate from other business functionalities.
- Greater scalability, with an event-driven model allowing for easier integration of additional services as needed.
- Enhanced resilience through decoupling, allowing individual services to scale and handle failures independently.

View file

@ -0,0 +1,9 @@
# Package Map
| Package | Responsibility | Forbidden Dependencies |
|----------------|----------------------------------------------------|------------------------|
| controller | Handle HTTP requests and responses | domain |
| service | Business logic and transaction management | domain, integration |
| repository | Data access and retrieval | service |
| domain | Core domain logic and entities | controller, service, repository |
| integration | External service communication | service |

View file

@ -1,25 +1,37 @@
```mermaid
sequenceDiagram
participant User
participant PaymentGateway
participant Bank
participant User as User
participant Checkout as Checkout Service
participant Payment as Payment Gateway
participant DB as Database
%% Normal flow
User ->> PaymentGateway: Request Payment
PaymentGateway ->> Bank: Process Payment
Bank -->> PaymentGateway: Payment Approved
PaymentGateway -->> User: Payment Confirmation
User->>Checkout: Initiate Checkout
Checkout->>DB: Save Order
DB-->>Checkout: Order Confirmation
Checkout->>Payment: Process Payment
Payment-->>Checkout: Payment Success
Checkout->>User: Payment Successful
%% External failure branch
User ->> PaymentGateway: Request Payment
PaymentGateway ->> Bank: Process Payment
Bank -->> PaymentGateway: Payment Declined
PaymentGateway -->> User: Payment Declined Message
%% External failure
User->>Checkout: Initiate Checkout
Checkout->>DB: Save Order
DB-->>Checkout: Order Confirmation
Checkout->>Payment: Process Payment
Payment-->>Checkout: Payment Failure
Checkout->>DB: Rollback Order
DB-->>Checkout: Order Rollback
Checkout->>User: Payment Failed
%% DB failure branch
User ->> PaymentGateway: Request Payment
PaymentGateway ->> Bank: Process Payment
Bank -->> PaymentGateway: DB Error
PaymentGateway -->> User: Payment Failed Due to Error
Note over PaymentGateway: Rollback transaction if needed
%% DB failure
User->>Checkout: Initiate Checkout
Checkout->>DB: Save Order
DB-->>Checkout: Order Confirmation
Checkout->>Payment: Process Payment
Payment-->>Checkout: Payment Success
Checkout->>DB: Commit Order
DB-->>Checkout: Error
Checkout->>DB: Rollback Order
DB-->>Checkout: Order Rollback
Checkout->>User: Payment Successful, Order Error
```