Alipay callback signatures fail despite matching-looking parameters: encoding, empty values and canonical input

Fields that look identical in logs need not produce identical signing bytes. Chinese text, plus signs, empty strings, integer-to-decimal conversion or double decoding can change the input. This guide explains diagnosis, not a replacement WenFuPay contract. Alipay’s direct-integration verification rules must not be assumed to apply to an aggregated channel notice.

Continue by topic

Identify JSON versus form transport first

Check method, Content-Type, encoding and the application parsing chain. Process JSON under its confirmed field contract; do not invent a signature over the entire JSON text or URL-decode again merely because a value contains a percent sign.

In application/x-www-form-urlencoded, a plus can represent a space and %2B a literal plus; that rule does not apply directly to JSON strings. Pass separate redacted values such as “Chinese A+B” and “Chinese A B” through the full test chain to locate repeated conversion.

Compare fields, types and canonicalization step by step

Confirm included and excluded fields, empty-value rules, sorting, joining and digest formatting against the current formal documentation. Missing, null, empty string and numeric zero are not inherently equivalent. Confirm permitted types rather than silently changing 1000 to 1000.0.

With isolated test material, compare field names, types, characters and encoded lengths. Do not trim, change case or normalize Unicode just to make verification pass. Handle duplicate fields and unsupported nested structures under the protocol or escalate; do not silently overwrite and try again.

Separate input differences from credential mistakes

Once parameter handling matches, check merchant ownership, configuration references, key scope and rotation arrangements. Signature failure proves neither that the customer did not pay nor that the message is genuine. Retain minimal isolated clues and confirm the original order through authorized queries or technical review.

Routine logs should contain outcomes, redacted references, configuration versions and error categories. Never share secret-bearing canonical strings, production keys, complete valid signatures or sensitive raw messages in groups or public articles. Support needs no login codes; technical reproduction uses separately agreed redacted test material.

Regress one-variable cases before accepting a fix

Test Chinese characters, spaces and pluses, percent signs, empty values, zero, field order and unsupported types one factor at a time. Valid examples pass; altered amounts, wrong merchants and invalid signatures fail. Successful handling still needs one-time order crediting.

Test creation, queries, notice verification and acknowledgments with WenFuPay’s formal documentation. After fixing parsing, query original outcomes for unresolved orders rather than marking every old failed notice successful. The public signing guide is a learning entry; the technical team confirms actual channel and version differences.

Frequently asked questions

Can a failed signature be credited first and checked later?

Do not credit from an unverified notice. Isolate necessary clues and establish payment through authorized queries or technical review; confirmed delivery must remain tied to the original order.

Does decoding everything twice improve compatibility?

No. Double decoding can alter values. Follow the real transport and signing contract, using explicit test cases instead of transforming until a signature happens to match.

References