Payments & Platform Access · Practical News

Alipay Mini Program Payments: Product Signing and Parameters

Source: Paddy Dance teamKeywords: Alipay mini program payment integration

Confirm the signing first

In the Alipay open platform, the application must have the mini program payment capability signed. Without it, calls return a permission error that is often vague.

The application type matters: mini program applications and web or mobile applications are different entry points. Using a web application appid to launch mini program payment fails.

Key order parameters

out_trade_no is generated by the merchant and must be globally unique. total_amount is a string in yuan with two decimals. buyer_id normally comes from the login state; omitting it can leave the trade unattributed.

product_code must match the signed product. A wrong value produces the confusing case where the order is created but cannot be paid.

Client-side notes

my.tradePay only works inside the Alipay client. Testing in a browser always fails; use a device or the mini program simulator.

Treat the asynchronous notification as authoritative. The client callback is for navigation only and must not trigger fulfilment.

FAQ

Can mini program and mobile web payments share code?

The endpoints differ. Mini programs use trade.create plus my.tradePay; mobile web uses trade.wap.pay and returns a payment URL.

Can total_amount be numeric?

It must be a string with two decimals. Numeric values can serialise to scientific notation and break the order.

Payment succeeded but no notification arrived. What now?

Query the trade status and process if successful. Also check that notify_url is publicly reachable and returns success.

Related questions

how to use my.tradePayAlipay mini program payment signingwhere to get tradeNOAlipay mini program payment errors

Further reading

Sources & References

The following are public sources. Always check the latest requirements on the official authority or platform page.

Explain your case first, then confirm the scope

Tell us your entity, business model and current progress. We will confirm what we can assist with and what you need to do before discussing fees.