Payments & Platform Access · Practical News

WeChat Pay Native QR Payments: Setup and Expiring Codes

Source: Paddy Dance teamKeywords: WeChat Pay Native QR integration

Order and display

The server calls the unified order endpoint with merchant number, appid, merchant order number, amount and description, setting trade_type to NATIVE. The returned code_url is a weixin:// string, not an image URL.

The front end turns code_url into a QR image and polls your own order status. Never rely on the browser to decide that payment succeeded.

Expiry and duplicate orders

code_url has a limited lifetime. The page needs a refresh action that places a new order, using a new merchant order number or closing the previous one first, otherwise you hit a duplicate order number error.

The amount must be decided server-side. Accepting an amount from the client means someone can pay one cent for a large order.

Callbacks and reconciliation

On success WeChat calls notify_url. Verify the signature, apply idempotent processing, update the order, then return success. If the callback is missing, query the order instead of leaving it pending forever.

Run a daily reconciliation against the platform bill. The differences are the only items that need human attention.

FAQ

Does Native payment work in a mobile browser?

It can display a QR code, but users cannot scan their own screen. Use H5 or JSAPI on mobile.

Can code_url be stored and reused?

No. After expiry the scan fails, so a fresh order is required.

What if the customer never pays?

The order stays open. Implement a timeout that calls the close-order endpoint so inventory and order numbers are released.

Related questions

how to use code_urlQR code expired handlingaccept WeChat Pay on desktop siteNative payment callback

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.