Getting started
Install by runtime
bash
pnpm add @chinafast/web-wechat-paybash
pnpm add @chinafast/expo-wechat-paybash
pnpm add @chinafast/server-wechat-payPayment flow
- The web or Expo package selects the appropriate one-time payment channel.
- The core client asks your backend to create an order.
- The server package signs a WeChat Pay API v3 request with merchant credentials.
- The client launches WeChat, redirects to H5, invokes JSAPI, or renders a Native Pay QR code.
- Your backend verifies the signed webhook or queries the order before fulfilment.
Requirements
- Node.js 20 or newer for the backend.
- A WeChat Pay merchant account for live mode.
- A WeChat Open Platform mobile app for Expo App Pay.
- Registered H5 and JSAPI domains for those browser channels.
- An Official Account
openIdflow for JSAPI. - An Expo development build or standalone app for native App Pay.
Amounts and products
Amounts are integer fen. For known products, configure the price on the server and send only a product ID from the client. Never trust a client-supplied price.
Mock mode needs no merchant credentials and is the right first integration target.