결제 전환 목표 아키텍처 정의 (2/2) (iss-5a912ed79baf)
All checks were successful
ci / test (pull_request) Successful in 7s
All checks were successful
ci / test (pull_request) Successful in 7s
This commit is contained in:
parent
b9f10941e2
commit
e06fb95bef
1 changed files with 38 additions and 0 deletions
38
docs/architecture/transaction-sequence.md
Normal file
38
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
```mermaid
|
||||||
|
sequenceDiagram
|
||||||
|
participant User
|
||||||
|
participant PaymentService
|
||||||
|
participant PaymentGateway
|
||||||
|
participant Database
|
||||||
|
|
||||||
|
%% Normal Flow
|
||||||
|
User->>PaymentService: Initiate Payment
|
||||||
|
PaymentService->>Database: Store Transaction
|
||||||
|
Database-->>PaymentService: Transaction Stored
|
||||||
|
PaymentService->>PaymentGateway: Process Payment
|
||||||
|
PaymentGateway-->>PaymentService: Payment Success
|
||||||
|
PaymentService->>Database: Update Transaction Status
|
||||||
|
Database-->>PaymentService: Transaction Updated
|
||||||
|
PaymentService-->>User: Payment Success
|
||||||
|
|
||||||
|
%% External Failure Flow
|
||||||
|
User->>PaymentService: Initiate Payment
|
||||||
|
PaymentService->>Database: Store Transaction
|
||||||
|
Database-->>PaymentService: Transaction Stored
|
||||||
|
PaymentService->>PaymentGateway: Process Payment
|
||||||
|
PaymentGateway-->>PaymentService: Payment Failure
|
||||||
|
PaymentService->>Database: Rollback Transaction
|
||||||
|
Database-->>PaymentService: Transaction Rolled Back
|
||||||
|
PaymentService-->>User: Payment Failure
|
||||||
|
|
||||||
|
%% DB Failure Flow
|
||||||
|
User->>PaymentService: Initiate Payment
|
||||||
|
PaymentService->>Database: Store Transaction
|
||||||
|
Database-->>PaymentService: Transaction Store Failure
|
||||||
|
PaymentService-->>User: Payment Failure
|
||||||
|
|
||||||
|
%% Commit & Rollback
|
||||||
|
Note over User, PaymentService:
|
||||||
|
commit --> PaymentService
|
||||||
|
rollback --> PaymentService
|
||||||
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue