Alipay callbacks across multiple sites: ownership, namespaces and isolation checks

Two sites both have order 1001 for the same amount. Searching every site and accepting the first match can credit the wrong customer even after signature verification. This guide concerns authorized multi-site deployments. Confirm with 稳付pay whether sharing a merchant configuration or callback endpoint is permitted; it does not announce a multi-merchant product.

Continue by topic

Establish scope using trusted server configuration

Register each approved site identifier, environment, channel merchant configuration, credential reference and allowed callback route on the server. A supplied site name, query parameter or Host value cannot establish ownership. An unverified identifier may locate a candidate configuration, but the verified merchant identity must still match the registry under the actual protocol.

If sites legitimately share one channel configuration, its signature cannot distinguish those sites. Create an unambiguous payment-to-site mapping when ordering and obey the provider’s real order-number uniqueness rules. Trying every secret until one validates is not a safe ownership decision for an unknown notification.

Fix the mapping and uniqueness scope before payment

Link environment, site, internal purchase reference, approved channel configuration and external merchant order reference. These are suggested internal records, not new API fields. Generate external references within the uniqueness scope required by the actual documentation. Use non-null composite keys for local purchase identity and a separate unique mapping for external payments.

Look up only within the verified configuration and mapping scope. Validate currency, amount and final payment state, then persist payment and delivery work transactionally. Unknown ownership, multiple candidates or amount mismatches enter review instead of triggering a global fallback search. Acknowledge only under the documented protocol after persistence.

Test two equal-number, equal-amount orders

In isolation, give sites A and B the same internal order 1001 and amount. A valid payment for A must advance only A. Alter the unverified site parameter to B, use test-environment credentials, send an unknown merchant and repeat a notification; verify that none grants access across scopes. Use owned simulation data without querying customer transactions or making real payments.

If both sites share an approved channel configuration, their external references must map without collisions. Database constraints prevent duplicate mappings but do not replace identity checks. Apply scope checks to order lookups, manual recovery and queued delivery jobs as well as the public callback handler.

Contain a misallocation without rewriting payment history

Pause affected automatic delivery and preserve verified payment, incorrect allocation, actual delivery and notification evidence. Do not mark a real payment unpaid or deduct another customer’s balance merely to make totals match. An authorized reviewer checks the original purchase and consumed rights before recording an evidenced correction and customer communication.

After repairing routing or constraints, resume the original verified task rather than creating another payment. Keep uncertain ownership under review. Log internal configuration identifiers and redacted reasons, not secrets or replayable signature material. OWASP supports request-level authorization and PostgreSQL documents constraints; the mapping procedure is a merchant design.

Frequently asked questions

Does a valid signature establish the current site as owner?

No. Check verified merchant configuration, environment, unique payment mapping and purchase ownership. Mapping at order creation is essential when sites share a permitted configuration.

Can I use the first matching order across all sites?

No. Search only within the verified mapping scope. Multiple candidates or unknown ownership must stop automatic delivery; matching display numbers do not prove a shared purchase.

References