Skip to content

How a payment is reconciled

Reconciliation lives in the central platform. It compares an event (a Yape notification) with the open orders of the same customer.

From the event From the order
Exact amount Amount in PEN
Arrival time Creation and expiry time
Sender (sometimes masked) — (the buyer’s name is not shared)

The amount is the key; time narrows it down; sender and code only break ties.

stateDiagram-v2
    [*] --> DETECTED
    DETECTED --> RECONCILED: 1 candidate order
    DETECTED --> SUSPICIOUS: no order after deadline, or ambiguous
    DETECTED --> CONFLICT: second event for an already reconciled order
    SUSPICIOUS --> RECONCILED: a person assigns the order
    CONFLICT --> RECONCILED: a person resolves it
  1. Candidates: same customer, environment and website, Yape method, open, PEN, same amount, within the deadline (15 min).
  2. 0 candidates: the event waits (the order may arrive in the next sync).
  3. 1 candidate: RECONCILED.
  4. Several: break the tie with “name on your Yape” if present; otherwise SUSPICIOUS and a person chooses.
  5. Repeated event for an already reconciled order: CONFLICT.
Case What happens
Two orders with the same amount SUSPICIOUS; unique amount almost always prevents it
Buyer pays without the cents adjustment SUSPICIOUS; a person can assign it
Payment arrives after the order expired and was cancelled SUSPICIOUS with reason LATE_PAYMENT; a person decides
Payment before the order exists Waits and reconciles on sync
Offline phone with a backlog Reconciled on arrival, ordered by occurred_at
Magento connector down Deliveries wait in PENDING_APPLY; alert raised
test event Never counts in live