```mermaid sequenceDiagram participant User participant PaymentGateway participant TransactionDB User->>PaymentGateway: Initiate Payment alt Successful Payment PaymentGateway-->>TransactionDB: Store Transaction TransactionDB-->>PaymentGateway: Confirm Transaction Stored PaymentGateway-->>User: Payment Successful else External Failure PaymentGateway-->>User: Payment Gateway Error else DB Failure PaymentGateway-->>User: Payment Processing Error TransactionDB-->>PaymentGateway: DB Error Occurred end opt Commit Transaction TransactionDB-->>User: Commit Success end opt Rollback Transaction TransactionDB-->>User: Rollback Success end ```