718 B
718 B
sequenceDiagram
participant User
participant PaymentGateway
participant Database
User->>PaymentGateway: Initiate payment
PaymentGateway->>User: Payment status (success)
User->>Database: Save transaction
Database-->>User: Transaction saved
%% External failure scenario
User->>PaymentGateway: Initiate payment
PaymentGateway-->>User: Payment status (failure)
User->>Database: Log failure reason
%% Database failure scenario
User->>PaymentGateway: Initiate payment
PaymentGateway->>User: Payment status (success)
User->>Database: Save transaction
Database-->>User: Transaction failed (DB error)
Note right of User: Rollback transaction