USDT integration for digital delivery platforms: your own address, on-chain confirmation and reliable callbacks
Seeing a transfer on-chain does not mean an order has reliably received payment; receiving a callback does not authorize repeated code issuance. Separating wallets, transaction evidence, payment states and inventory fulfillment keeps funds under merchant control and digital delivery traceable.
Contents
1. Establish the funds boundary: merchants own addresses; monitoring does not hold assets
Here, a digital delivery platform automatically supplies digital goods, license keys or redemption codes. For USDT integration, customers should pay directly to merchants' own receiving addresses. 稳付pay monitors and identifies transactions, checks receipt status and calls the merchant business system. Funds do not pass through 稳付pay; the platform neither collects nor holds them.
Merchants retain wallet custody and signing authority. A public receiving address is enough for read-only monitoring; do not provide seed phrases, private keys, wallet files or remote-control access. An offer to help configure the service is not a reason to request them. Controlling funds also means merchants handle address backups, payment checks and refund approval.
2. Fix the network, token and confirmation conditions when the order is created
稳付pay currently supports USDT on Tron (TRC20) and Ethereum (ERC20). USDT names the asset; TRC20 and ERC20 describe token standards on different networks. Identically named assets cannot share order and address assumptions. Clearly display the network at checkout and require customer confirmation rather than only showing “Pay USDT.”
| Check | Tron / TRC20 | Ethereum / ERC20 |
|---|---|---|
| On-chain transaction evidence | Verify the target contract's successfully executed transfer event | Verify the target contract's Transfer log in a successful receipt |
| Confirmation basis | Check confirmed, solidified data as agreed | Use the agreed block-confirmation or safe/finalized policy |
| Shared requirements | Verify network, target contract, merchant address, amount and order match | |
TRON transaction documentation distinguishes inclusion from solidification; Ethereum JSON-RPC documentation also distinguishes block states. Agree the confirmation policy during integration rather than replacing it with a fixed number of seconds. 稳付pay's seconds-level callbacks describe notification speed after agreed confirmation conditions, not a promise of seconds-level blockchain confirmation.
3. Matching orders requires more than an equal amount
Two customers may buy equally priced products simultaneously, and one transaction may contain several token transfer events. Bind at least the internal order ID, network identifier (such as Ethereum chainId), target token contract, receiving address, integer amount and expiry. Separately record the transaction hash, event index, block number and block hash as evidence. A customer-submitted hash is not proof of receipt.
Preallocate an independent merchant-controlled address to each order, or define explicit payment sessions and conflict rules for shared addresses. Even differentiated amounts require network, contract, address, active session and ownership checks. Multiple candidate orders require manual reconciliation, never “match the first one.”
An Ethereum log is usually located by network identifier, transaction hash and logIndex; TRON needs a stable mapping using the event index supplied by its interface. Preserve raw events and block hashes and recheck canonical-chain membership after reorganizations. This identifies an event in the current canonical chain, not a logIndex guaranteed permanent across reorganizations. A transaction hash alone also does not replace event-level uniqueness.
4. Use smallest-unit amounts and verify addresses and contracts separately
Do not compare payment amounts as floating-point values. Obtain precision from trusted target-token configuration and store integer smallest units. For example, at precision 6, 12.34 equals 12340000 smallest units. This conversion example does not make every contract named USDT trustworthy. Network, contract address and precision belong in a maintained allowlist, not customer-submitted token metadata.
Validate an address using its network's format, then check it in full on the confirmation page. Distinguish the transfer amount from the wallet's network fee; customer-paid transaction fees do not automatically count toward the product price. Test a small amount on first integration and verify the actual receiving address and event, rather than treating a successful page as on-chain receipt.
5. Keep explicit states between transaction monitoring and code fulfillment
- Create a payment sessionFix order, network, address, amount and expiry
- Discover and verify the transferCheck the target token event executed successfully
- Wait for agreed confirmationRetain block data and recheck transaction ownership
- Persist the payment notificationVerify signatures, deduplicate and update the business order
- Fulfill inventoryRecord code-delivery results and compensating jobs separately
A listener should save its scan cursor, backfill missed ranges after disconnection and permit limited overlapping scans. Uniqueness constraints deduplicate rescans, rather than assuming repeats are impossible. Transfers remain pending until confirmation conditions are met. If node data lags or events are removed, pause progression instead of continuing fulfillment.
For example, create a non-null composite unique key for payment events in the merchant database and a unique fulfillment record per order. PostgreSQL's constraints documentation explains composite uniqueness. Design actual keys for the network's event model rather than copying one key across every chain.
6. Reliable callbacks require source validation, persistence and idempotency
Use HTTPS callbacks and validate signatures, timestamps and event identity under the agreed protocol, then check internal order, currency, network and amount. If a signature covers the raw body, preserve bytes before parsing or reordering JSON. Agree key rotation, clock tolerance and retries during testing. This article does not invent 稳付pay API URLs or signature fields.
You may refer to Stripe's official Webhook guide for duplicate-event and signature-verification principles, but it is not the 稳付pay specification. After verification, reliably save the notification to a database or persistent queue before promptly sending the agreed success acknowledgment. Do not acknowledge before a successful write. Slow code fulfillment belongs in background jobs.
Even if the same callback is sent ten times, payment state should advance once and fulfillment occur once. Write the payment update and pending-fulfillment job in one transaction, then lock the order and inventory in the job. Retry the existing job after failure instead of generating another code. Failed callbacks can be retried and queried; a customer's browser redirect cannot replace backend validation.
7. Two failure scenarios: duplicate notifications and pre-confirmation reorganizations
Scenario one: the code was delivered, but a timed-out callback is sent again
The first request may already have committed, with only its response lost in transit. Deduplicate the next request by event identity, read the order's fulfillment state and return the handled result. Do not allocate another item merely because the HTTP request is new. Compare notification, order-transaction and fulfillment records to distinguish a duplicate from a genuinely missed delivery.
Scenario two: fulfillment starts on transfer discovery, then its block changes
An unconfirmed transaction may be affected by a chain reorganization. The listener should verify block membership. Geth's subscription documentation explains that Ethereum logs may carry a removed flag. On change, revert to pending observation and rescan for verification. If fulfillment happened before confirmation conditions were met, open a manual incident, retain evidence and do not automatically debit the customer's wallet.
8. Set separate rules for expired payments, shortages and refunds
An expired order does not prevent its address from receiving funds. Record late payments as awaiting reconciliation instead of automatically assigning them to new orders. Establish rules for underpayment, overpayment and split payments in advance. If inventory reservations expire before payment confirms, recheck stock and fulfill, or enter a manual refund workflow.
Record payment completion and fulfillment success separately. If a confirmed payment lacks stock, preserve the payment and tell the customer it awaits handling, rather than reverting to unpaid. A refund is a new on-chain transaction initiated by the merchant wallet, requiring separate approval, network and address verification, fees and transaction hash records. Do not refund automatically to the sending address: an exchange's sending address may not accept direct receipt for that customer.
9. Launch checks: validate exceptional paths before increasing volume
- Confirm the merchant controls the receiving wallet and no integration information includes private keys or seed phrases.
- Test TRC20 and ERC20 contracts, precision, addresses and confirmation policies separately.
- Cover equally priced orders, duplicate events, callback timeouts, backfill after disconnection and pre-confirmation reorganizations.
- Practice late, partial and excess payments, shortages, failed fulfillment, reconciliation and manual refunds.
- Ensure logs connect orders to payment events and fulfillment jobs while masking keys and product codes.
稳付pay currently offers monitoring and callbacks on both networks free to small and medium site owners; enterprise services are charged separately. The merchant backend remains under development, so contact us for configuration. Funds remain under the merchant's wallet control. Test and agree confirmation policies, callback protocols and exceptional handling before launch.
References and technical documentation
The official sources below support protocol and implementation checks. Code and scenarios illustrate technical concepts; validate your environment and production integration protocol separately.
- TRON official: transaction lifecycle and solidification
- TRON official: TRC-20 token standard
- Ethereum official: JSON-RPC, logs and block states
- Geth official: subscription logs and the reorganization removed flag
- Stripe official: Webhook signatures, duplicate events and responses
- PostgreSQL official: unique constraints and composite keys
Keep improving your site
Check each step of networking, orders and funds notifications against your business scenario. Discuss payment integration and USDT monitoring through the contact page.
Contact 稳付pay ↗