Skip to content
Documentation

Integration patterns

Payment reconciliation

Model a confirmed payment and a retryable CRM update as separate, independently inspectable steps.

On this pageThe workflowPut the retry boundary around the failed operationGive support the right contextTest recovery before enabling mutationsOperate the workflow

Use this design when a payment can succeed while a later CRM update fails. The target outcome is one confirmed wallet credit and a separately recoverable profile update—not a second payment attempt.

This pattern requires a provider integration and ledger that handle validation, crediting and reconciliation. Test with sandbox services before using live payments.

The workflow

Implement and register these handlers using the .NET recipes or Java recipes:

StageHandler responsibilityResult to retain
Validate eventValidate the provider event and stable referenceAccepted reference, or terminal validation failure
Confirm paymentRead the existing payment; do not initiate anotherConfirmed, pending or rejected provider outcome
Credit walletApply the confirmed credit once in your ledgerExisting or newly recorded transaction reference
Sync CRMUpdate the profile with a stable action keySynchronized, or a classified transient error
Send receiptDeliver a deduplicated notificationDelivery reference

Create the pipeline with an application-scoped idempotency key derived from the provider event. Persist a separate stable key for each side effect: wallet credit, CRM update and receipt. The creation key deduplicates a run, not all business actions inside it.

Put the retry boundary around the failed operation

  1. Return terminal validation or business-rejection results when the event must not be processed. Do not retry a rejected payment as a transient outage.
  2. In each side-effecting handler, check for a previously committed result before issuing another command. If the previous call timed out, query the receiving system using the existing reference.
  3. Configure bounded retries on the CRM stage for transient errors. A timeout can occur after a remote commit; do not use a changing execution ID as the external deduplication key.
  4. If CRM fails after the wallet credit, keep the completed stages intact. Let its configured automatic retry run, or use the failed-stage recovery procedure after resolving the cause.

Checkpoint: a CRM retry changes the CRM attempt history while the ledger still contains exactly one credit for the business operation. Pipeline status alone does not establish this invariant; inspect the sandbox ledger too. See retry and recovery semantics.

Give support the right context

Record the operation ID, provider reference, last confirmed outcome and next action. Keep card numbers, access tokens, full identity documents and raw financial payloads out of general support context.

An operator should be able to distinguish “payment confirmed; wallet credited; profile update delayed” from “payment outcome unknown.” Only expose the first statement after your own integrations have confirmed it.

The dashboard displays recorded stage results and context. Build customer-facing explanations from outcomes confirmed by your integrations.

Test recovery before enabling mutations

Run against a provider fake and sandbox ledger, with a fresh business ID for each independent scenario:

ScenarioRequired assertion
All operations succeedPipeline Completed; expected ledger, CRM and receipt records exist
CRM fails once with a transient errorCRM retries and succeeds; ledger contains one credit
Provider rejects the eventRejection is recorded; no wallet credit occurs
The same event is submitted twiceEquivalent creation intent returns the same pipeline
Ledger commits but its response is lostReconciliation finds the existing transaction; no second credit

Handler unit tests establish business behavior. Add a real server round trip to verify dispatch and scheduled retries; the installation smoke test checks infrastructure but does not validate your provider or ledger integration.

Operate the workflow

A Viewer can inspect assigned runs. An Operator can use the actual recovery controls on a Failed stage; a RetryScheduled stage is waiting for its automatic attempt. Before a manual rerun, inspect output and the external outcome. Escalate when credentials, handler code or an unknown external result cannot be resolved safely through those controls.

Use the dashboard procedure and access rules. Do not replay the payment merely to repair a later profile update.

Start here, or search all 43 pages

↑ ↓ to select · Enter to open · Esc to close