Zum Inhalt springen
← Back to Docs

Reconciliation

How matching works

Every inbound Wise credit goes through a 3-stage cascade:

  1. Reference from webhook payload — Wise includes the payment reference directly in the event body when available.
  2. Reference from Wise transactions API — If the payload has no reference, the plugin fetches the last 50 transactions and looks for one within the last 5 minutes matching the exact amount. This works around a Wise limitation where the memo field is absent from webhook payloads.
  3. Amount + currency fallback — If still no match, the plugin scans all pending WooCommerce orders for one whose expected amount matches (within the configured tolerance). If exactly one candidate is found it is auto-matched. Zero or multiple candidates go to the review queue.

Polling fallback

When enabled, WP-Cron runs the same reconciliation logic on a schedule (15/30/60 min) by fetching the last 24h of CREDIT transactions from the Wise balance statement. Each transaction uses source=statement_poll as an idempotency namespace, independent from webhook events — so a payment can never be double-credited even if both the webhook and the poller pick it up.

Review queue

Every unmatched or ambiguous event is stored in the wp_kairos_wise_events table and visible under WooCommerce → Wise Payments. From there you can:

  • Match — manually link the event to any WooCommerce order. The order is immediately marked paid.
  • Retry — re-run the automatic matching logic (useful after creating a missing order).
  • Reject — mark the event as not belonging to this store.