WeChat H5 payment integration: browser launch, order checks and balance credits
WeChat H5 payment starts on a website in a mobile browser and opens WeChat checkout. A complete integration connects navigation to server-side payment confirmation and the website balance ledger. This guide explains the official flow. For 稳付pay integration, technical support must confirm H5 availability, merchant permissions and the actual interface.
Continue by topic
1. Distinguish H5, pages inside WeChat and APP payment
Official H5 payment is for mobile web pages outside WeChat’s own browser. Pages inside WeChat generally use JSAPI payment, while native apps use APP payment. Embedding a web page in an app does not make it an eligible official H5 scenario. The second supplied reference is an APP guide: OpenSDK, sendReq and onResp belong to that separate integration.
An ordinary merchant connecting directly needs the relevant eligibility, H5 permission, merchant-to-APPID binding and configured H5 payment domain. Check the current official prerequisites. For a 稳付pay channel, provide your domain, business description and opening environment, then confirm whether the assigned channel supports H5. Publishing this guide does not enable H5 for every merchant.
Do not choose a protocol from the browser name alone or assume every native WeChat channel has identical H5 capabilities. Confirm the environment, permission and channel before implementing navigation and the backend protocol.
2. Integrate with 稳付pay: from channel setup to launch
Step 1: contact 稳付pay at @tonyyyds with your domain, business type, browser or app environment, top-up or subscription workflow, expected order volume and USDT settlement needs. Technical support confirms H5 availability, channels, fees, settlement rules and testing. A channel name alone does not establish activation.
Step 2: obtain the actual gateway, merchant mchId, authorized wayCode and server-side secret. Prepare a public notifyUrl and a local order table. Keep secrets on the backend. Example aggregation codes are 90001 for WeChat and 80001 for Alipay; they require merchant authorization, and a specific channel code may be assigned instead.
Step 3: persist a unique outTradeNo and a trusted price, then send JSON from the backend to POST /api/pay/collect/create. amount uses integer CNY fen: 1000 means CNY 10. reqTime must be the current Unix time in milliseconds as an integer; generate sign using the documented MD5 rules. The example contains placeholders for this payment method: replace them and sign on the server.
{
"mchId": "YOUR_MERCHANT_ID",
"wayCode": "90001",
"outTradeNo": "YOUR_UNIQUE_ORDER_NO",
"amount": 1000,
"currencyCode": "CNY",
"notifyUrl": "https://merchant.example.com/pay/notify",
"subject": "WENFUPAY_H5_DEMO",
"reqTime": "CURRENT_UNIX_MILLISECONDS",
"sign": "GENERATE_MD5_ON_SERVER"
}Step 4: retain the platform order reference and use a valid returned payUrl according to the agreed integration. Do not invent checkout URLs. code=0 means request acceptance, not payment, so it must not trigger a credit. Actual channel and browser testing determines whether checkout opens the client directly.
Step 5: receive 稳付pay’s normalized JSON notification. Verify its signature and match merchant, order, amount and currency before recording payment once. After durable acceptance, respond with HTTP 200 and plain-text OK. For a missing callback or an uncertain creation result, query the original order through GET /api/pay/collect/query from the backend. Confirm query amount units during onboarding.
Step 6: use the technical team’s testing arrangement to verify payment, cancellation, timeouts, repeated notifications and balance updates. Reconcile the first production orders before gradually increasing traffic. The links below provide onboarding and full documentation.
Contact 稳付pay · Integration workflow · Create and query orders · Signature rules · Payment callbacks
3. Why use 稳付pay: channel and service advantages
Payment choices: current channels include WeChat personal-code collection, native WeChat collection and native Alipay collection, with aggregation integration. Configure the methods appropriate to your business and reduce separate channel integrations. H5 availability still depends on the enabled channel. Current channel performance is stable, but results depend on orders, user environments and channel conditions; no fixed success percentage is promised.
Consistent orders and notifications: use the returned checkout entry and one creation, query and JSON notification workflow to connect website top-ups, subscriptions, card delivery or TG bot orders to your own system. The platform reports payment status; the merchant updates balances and entitlements from verified results. Receiving a callback does not automatically fulfill every business operation.
T0 real-time USDT settlement: after customer payment is confirmed, USDT can be settled to the merchant under the agreed arrangement. Confirm eligible amounts, fees, conversion rules, network and address during onboarding. Processing and blockchain arrival remain subject to conditions and confirmations; this does not mean zero fees, zero confirmations or unconditional instant arrival.
Technical assistance: the team helps confirm merchant settings, channel selection, signatures, queries and notification issues. WeChat or Alipay collection settled in USDT is distinct from USDT monitoring of a merchant-owned address. In the latter, the customer pays the merchant wallet directly and 稳付pay monitors confirmation and sends a callback. Do not describe both as the same funds flow.
4. Separate official H5 parameters from 稳付pay checkout
The backend creates a local order tied to the signed-in user, product or top-up option, expected amount and currency. Read prices from server-side configuration, not untrusted browser input. In direct API v3 integration, the backend calls POST /v3/pay/transactions/h5 with a unique out_trade_no and required notify_url, amount and scene_info fields. amount.total is an integer in CNY fen: CNY 10 is 1000. Signing and private keys stay on the server. A 稳付pay channel uses its actual documented fields, units and signature rules, rather than a copy of the official protocol.
Navigate to the returned h5_url from a page on the configured H5 domain. To choose a return page, append redirect_url as a query parameter while preserving the existing payment parameters. URL-encode the return address once; its domain must also be a configured H5 payment domain. Avoid double encoding with URL-building libraries. redirect_url brings the browser back; notify_url receives server notifications. They are not interchangeable.
The official H5 development guide gives h5_url a five-minute lifetime, separate from the order payment deadline. Check the order before refreshing an expired link; if still payable, obtain a fresh link with the original order parameters as documented. When the business deadline passes, query first and follow the close-or-recreate rules. A browser countdown cannot prove payment failure.
5. Verify payment before callbacks and balance credits
Both completion and cancellation may return the customer to the merchant page. Reaching redirect_url, a success message or a screenshot is insufficient evidence for a credit. Offer a status button that asks the backend to query an order the current user is authorized to view. Show the verified result or pending confirmation. Never credit from an amount or success flag in the return URL.
Direct API v3 integrations follow official notification verification and resource decryption rules; 稳付pay merchants follow their actual callback documentation. Match the recipient, merchant order, transaction reference, expected amount and currency. Feed queries and callbacks into one state handler. A delayed unpaid response must not overwrite confirmed payment.
For a top-up, create one unique credit record per business order and update the order and balance ledger in one database transaction. Callback retries, repeated checks and refreshes must not issue another credit. Protect membership activation and delivery against duplicates too. If fulfillment fails after payment, retain a retryable task rather than requesting payment again. Acknowledge according to the interface after recording the notification durably.
6. Test launch failures, return pages and delayed credits
If WeChat does not open, capture the order reference, time, OS, browser, actual environment, error and a redacted request reference. Check H5 permission, domain configuration, expiry, redirect handling and whether the client permits opening WeChat. Do not spoof origins or bypass domain checks, and do not promise automatic launch in every browser.
For a blank return page, inspect redirect_url encoding, its domain, routing and login recovery. If payment is confirmed but the balance is unchanged, trace the transaction, callback verification, order state and credit ledger. Query a missing notification; do not blindly recreate a paid order. Redact logs and keep payment links and keys out of public pages or tickets.
Test success, cancellation, expired links, page closure, late or duplicate notifications, concurrent queries and callbacks, and recovery after a failed balance write. Verify one credit per order and traceability across payment, notification and ledger records. 稳付pay can help confirm the integration. Fees, channel availability and USDT settlement conditions are agreed separately; opening checkout proves neither payment nor settlement.
Frequently asked questions
Does H5 remove merchant eligibility or domain requirements?
No. Direct official H5 requires merchant eligibility, product permission and a configured payment domain. For 稳付pay, technical support checks the business, domain, supported environment and parameters. Aggregation does not exempt a merchant from review or bypass WeChat rules.
Can I credit the user after Done if no callback arrives?
Not from that action alone. The backend verifies payment, recipient, amount and currency, then uses the same duplicate-safe crediting process. If confirmation remains unavailable, show pending review and investigate the order reference rather than encouraging a second payment.
References
- WeChat Pay: launching H5 payment
- WeChat Pay: APP payment guide (a separate integration)
- WeChat Pay: H5 product overview
- WeChat Pay: H5 integration prerequisites
- WeChat Pay: H5 development guide
- WeChat Pay: H5 order creation parameters
- Collection order creation and queries: fields, amounts and order states
- Request signing rules: parameter sorting and MD5 calculation
- Current 稳付pay payment channels: WeChat personal QR, WeChat native, Alipay native and T0 real-time USDT settlement