Compare commits

..

3 commits

4 changed files with 28 additions and 22 deletions

View file

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

View file

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

View file

@ -1,19 +0,0 @@
# Architecture Decision Record: Payment Boundary
## Context
In order to manage payment processing effectively, we need to establish clear boundaries between our domain logic and the external payment gateway. This separation will help us maintain a clean architecture and ensure that the domain does not directly depend on external systems, thereby promoting better testability and adaptability.
## Decision
We will use a port and adapter pattern, where the payment gateway will be accessed through a defined interface (port), and the actual implementation will be contained within an adapter. This will allow for easy switching of payment gateways without affecting the domain logic.
## Alternatives
1. **Direct Integration:** Integrating the payment gateway directly into the domain layer.
- **Pros:** Simplicity in initial integration.
- **Cons:** Increases coupling, making it hard to switch gateways in the future.
2. **Adapter Pattern (Chosen):** Implementing a port and adapter structure.
- **Pros:** Low coupling, greater flexibility.
- **Cons:** Additional complexity in setup.
## Consequences
By adopting the port and adapter structure, we will ensure that the payment domain is isolated from external changes, which simplifies testing and reduces the risk of regressions related to payment processing.

View file

@ -0,0 +1,25 @@
sequenceDiagram
participant User
participant Payment Gateway
participant Database
participant Service
User->>Service: Initiate Payment
Service->>Payment Gateway: Send Payment Request
alt Successful Payment
Payment Gateway-->>Service: Confirm Payment
Service->>Database: Record Payment
Database-->>Service: Payment Recorded
Service-->>User: Payment Success
else External Payment Failed
Payment Gateway-->>Service: Payment Failed
Service-->>User: Payment Failed
else Database Failure
Service->>Database: Attempt to Record Payment
Database-->>Service: Database Error
Service-->>User: Unable to process payment
end
Service->>Database: Commit
alt Rollback Required
Database->>Database: Rollback Changes
end