결제 전환 목표 아키텍처 정의 (2/2) (iss-5a912ed79baf)
All checks were successful
ci / test (pull_request) Successful in 6s
All checks were successful
ci / test (pull_request) Successful in 6s
This commit is contained in:
parent
c850d3851c
commit
09dd3b17b5
1 changed files with 40 additions and 0 deletions
40
docs/architecture/transaction-sequence.md
Normal file
40
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant User as 유저
|
||||||
|
participant PaymentService as 결제 서비스
|
||||||
|
participant PaymentGateway as 결제 게이트웨이
|
||||||
|
participant Database as 데이터베이스
|
||||||
|
|
||||||
|
User->>PaymentService: 결제 요청
|
||||||
|
PaymentService->>Database: 결제 정보 저장
|
||||||
|
activate Database
|
||||||
|
Database-->>PaymentService: 저장 완료
|
||||||
|
deactivate Database
|
||||||
|
|
||||||
|
alt 정상 흐름
|
||||||
|
PaymentService->>PaymentGateway: 결제 요청
|
||||||
|
activate PaymentGateway
|
||||||
|
PaymentGateway-->>PaymentService: 결제 성공
|
||||||
|
deactivate PaymentGateway
|
||||||
|
PaymentService->>User: 결제 완료
|
||||||
|
|
||||||
|
else 외부 실패
|
||||||
|
PaymentService->>PaymentGateway: 결제 요청
|
||||||
|
activate PaymentGateway
|
||||||
|
PaymentGateway-->>PaymentService: 결제 실패
|
||||||
|
deactivate PaymentGateway
|
||||||
|
PaymentService->>Database: 롤백
|
||||||
|
activate Database
|
||||||
|
Database-->>PaymentService: 롤백 완료
|
||||||
|
deactivate Database
|
||||||
|
PaymentService->>User: 결제 실패
|
||||||
|
end
|
||||||
|
|
||||||
|
else DB 실패
|
||||||
|
PaymentService->>Database: 결제 정보 저장
|
||||||
|
activate Database
|
||||||
|
Database-->>PaymentService: 저장 실패
|
||||||
|
deactivate Database
|
||||||
|
PaymentService->>User: 저장 실패
|
||||||
|
end
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue