Runbook: Payment reconciliation
Overview
Reconciliation compares the orchestrator’s durable view of payment state (per transaction) with the payment provider’s view (when the provider implements get_payment_state). In v0.2.0, the persistent facade keeps payment state across restart for checkout outcomes and lifecycle transitions. Use reconciliation to detect drift (e.g. captured in our store but voided at the provider).
Running reconciliation
- Collect transaction IDs to reconcile (e.g. from your orders or time window).
- Call
facade.run_reconciliation(&transaction_ids).await. - Inspect
report.mismatches: each entry hastransaction_id,our_state, andprovider_state(if the provider returned a state). - If you need to inspect one transaction directly, read the stored state through the facade before or after a restart and compare it with provider telemetry.
Handling mismatches
- Our state differs from provider: Investigate whether the provider was updated outside the orchestrator (e.g. manual void/refund) or a previous call failed after we updated our state. Align data or correct the provider state as per your policy.
- Provider does not support get_payment_state: Default implementation returns
None; reconciliation then never reports a mismatch for that provider. Implementget_payment_stateon your payment provider adapter to enable drift detection.
Scheduling
Run reconciliation periodically (e.g. daily) over recent transaction IDs and alert on non-empty mismatches.