Accept payments

Matching rules

How SMS, references and claims settle a payment.

Every incoming SMS and every claim runs through the same matching engine inside a serializable database transaction with row locks, so concurrent SMS and claims cannot double-credit.

When an SMS arrives#

  1. The SMS is parsed and stored by (network, Transaction ID). Re-sent SMS are recognised and ignored.
  2. If a payment has claimed this Transaction ID and is waiting, it is settled with this SMS.
  3. Otherwise, if the SMS contains a short reference (the LP marker anywhere in an 8-character token), the payment with that reference is settled — while it is pending, or expired but still inside the claim window.
  4. Otherwise the SMS waits as Unclaimed until a customer claims it or an admin uses it in a review.

Settling a payment#

A payment is verified only if all checks pass; otherwise it goes to review with the reason:

  • The SMS isn’t much older than the payment (oldest claimable SMS).
  • The SMS isn’t ignored.
  • The reference in the SMS, if any, belongs to this payment; a reference typed with the claim agrees with the SMS.
  • The amount satisfies the payment’s amount policy.

Amount policies#

PolicyAcceptsTypical use
AT_LEASTThe amount due or more (default).Orders, invoices, payment links.
EXACTExactly the amount due.Accounting that cannot accept overpayments.
ANYAny amount; you are told what arrived.Wallet top-ups, donations, bare claims.

The SMS amount is always the truth: receivedAmountPesewas on the verified payment is what actually arrived.

Windows#

Setting (Settings → Matching)DefaultMeaning
Reference auto-match60 minHow long a payment stays PENDING. Override per payment with expiresInMinutes.
Wait for SMS after a claim6 hCLAIM_SUBMITTED becomes REVIEW after this.
Customers can claim for72 hAfter this the payment can no longer be claimed.
Oldest claimable SMS72 hAn SMS older than this before the payment was created cannot verify it.

Expiry is not failure

When the reference window ends the payment becomes EXPIRED and you receive payment.expired. A late SMS with its reference, or a claim with the Transaction ID, can still verify it during the claim window — so don’t cancel orders on expiry alone if you want to accept late payers.