Payment order IDs that differ only by case: exact matching and one-time credit
A valid signature does not guarantee that a database lookup selected the right order. DEMO-Ab and DEMO-ab may compare equal in a case-insensitive column. These are merchant implementation examples, not new platform fields.
Continue by topic
Confirm the commercial and reference contract
WeChat Pay, Alipay and UnionPay depend on approved configuration. Confirm fee basis, transaction and cumulative limits, and the permitted reference alphabet, length, case and whitespace rules. Merchant USDT settlement of CNY collections currently uses TRON/TRC20 only; confirm conversion, costs, triggers and timing separately. Fast lookup does not promise fast settlement.
Complete onboarding and obtain credentials privately. Read the signing, callback and query guides. Keep the external reference and internal primary key with merchant and environment scope. Record payment, credit or delivery, and merchant settlement separately. TRC20/ERC20 monitoring of an owned wallet is a separate direct-receipt service.
Inspect comparison rules before adding uniqueness
Trace input validation, serialization, application lookup, column type and index comparison. PostgreSQL citext compares without case distinction; inspect the actual collation on other databases too. Two visibly different strings do not prove two database identities.
For fictional references DEMO-Ab and DEMO-ab, store and match them separately only if the integration contract permits distinct values. Otherwise reject the collision before creation. Apply the agreed whitespace policy to a trailing-space variant; never trim it and guess the owner.
Use the original identity through verification and credit
Parse and verify according to the formal contract, then check original order, merchant, amount, currency and success state. Signature construction and reference comparison are separate boundaries. Do not rewrite signed values to make a lookup work or assume an insensitive result proves ownership.
Use non-null uniqueness on the agreed merchant/reference identity, with the same comparison semantics for insert, lookup and idempotency. Claim the payment and post credit once in a transaction. Zero or multiple matches require investigation, not selection of the newest row. Return the acknowledgement required by the actual contract.
Migrate with evidence and test boundary pairs
Before changing types or collations, scan historical collisions offline and map payments and deliveries. A collision may already involve wrong credit. Preserve backups and mappings; authorize individual corrections rather than merging rows or redelivering everything. Keep old-order contract rules traceable.
Test case pairs, surrounding spaces, same-merchant duplicates, cross-merchant reuse, concurrent creation and repeated callbacks in isolation. Lookup and uniqueness must agree, invalid inputs must fail before payment, and duplicates must add no credit. Reconcile original references, payment evidence, delivery and settlement ownership using redacted logs.
Frequently asked questions
May every order ID be lowercased?
Only if the formal contract specifies it and historical collisions have been assessed. Opaque existing references must not be silently transformed.
Is one matching row enough after signature verification?
No. Check exact identity, merchant, amount, currency and state; insensitive lookup may return the wrong original order.