Recovery
Recovery
Recovery centers on command G, exposed as sendLastResult().
sequenceDiagram
participant App
participant Client
participant POS
App->>Client: pay(1000)
Client->>POS: financial request
POS-->>Client: result may be lost if TCP drops
Client-->>App: exception
App->>Client: sendLastResult()
Client->>POS: command G
POS-->>Client: last transaction result
Client-->>App: PaymentResponse
- Catch the payment exception.
- Mark the order as requiring ECR17 reconciliation.
- Reconnect if needed.
- Call
sendLastResult(). - Compare amount, STAN, auth code, and terminal data to the order.
- Store a single final outcome.
Gotcha
Do not use retry middleware around financial commands unless it is aware of ECR17 money safety. Generic HTTP or queue retry policies can create duplicate charges.