When is it paid?
A payment on NEAR counts only when the final transaction holds a USDC transfer to the business, for the amount due, with that payment's own memo.


The check
When the payer starts paying, the pay page opens an attempt with its own memo, tegata:pay:<id>. The transfer
carries that memo whichever way it's paid. Then the worker:
- waits until the transaction is final on NEAR;
- reads the USDC contract's own
ft_transferevent from it; - checks the receiver is the business, the amount covers what's due, and the memo is this attempt's;
- only then marks the payment paid, updates the link or invoice, and numbers the receipt.
Nothing the payer's browser says is believed: a NEAR wallet's transaction hash is only a hint of where to look.
What follows
- Part-payments. An invoice that allows them takes any amount up to what's left; a payment above that is refused before anything is sent. INV-0001 ($0.50) was paid $0.20, then refused at $0.40 ("The most left to pay is $0.30"), then paid $0.30.
- Numbers. Receipt numbers come from a per-business counter taken in the same database transaction as the payment; invoice numbers come from one taken when the invoice is sent. Neither can repeat.
- By hand. Money received outside NEAR can be marked paid by hand on the invoice. Its receipt says it isn't on NEAR, and it never counts toward a referral.
- The seal. The business's seal stamps the invoice and the receipt, and the
receivedsound plays once per payment.
| Piece | Code |
|---|---|
| Reading USDC transfers from a final transaction | packages/core/src/near/transfers.ts (readUsdcTransfers, matchingTransfer) |
| Settling a payment | packages/services/src/payments.ts (settlePayment, applyPayment) |
| The worker | apps/worker/src/index.ts: payment-verify for NEAR-wallet payments, relay-send for Tegata-balance ones |
Proof
INV-0001's two parts: 2q3MP2…Wz8cVj and 4DaV5L…FQCquE.
How money moves
Every dollar is USDC on NEAR, every action is signed by its owner and relayed by Tegata, and every payment is checked on NEAR before it counts.
Accounts without gas
Sign in with email for a named NEAR account holding only dollars, or bring your own NEAR wallet; either way Tegata relays every action and pays its fee, exactly once.