微信生态集成 · WeChat Integration
CloudBase WeChat integration guide for Mini Program WeChat Pay, Mini Program virtual payment (虚拟支付, wx.requestVirtualPayment), Official Account JSAPI Pay, Native QR-code Pay, Official Account OAuth, openid handling, payment callbacks, and CloudBase Integration Center generated functions. This skill should be used when users ask to add, debug, or extend WeChat payment, virtual payment, or official-account flows on CloudBase.
Rank
62
Safety
84
Downloads
3.6k
Updated
Oct 9, 2026
Version
1.2.57
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 3.6K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 3.6K downloadsadoption · observed Oct 9, 2026
- Latest release
- 1.2.57release · observed Oct 9, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s17cgdbxp195f7dy8f5h6p0d9183h6nq:cloudbase-wechat-integration- Install using `clawhub skill install s17cgdbxp195f7dy8f5h6p0d9183h6nq:cloudbase-wechat-integration` in an isolated environment before connecting it to live workloads.
- No published capability contract is available yet, so validate auth and request/response behavior manually.
- Review the upstream CLAWHUB listing at https://clawhub.ai/binggg/cloudbase-wechat-integration before using production credentials.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-binggg-cloudbase-wechat-integration/snapshot"
Documentation
CLAWHUB
160,000 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
--- name: cloudbase-wechat-integration description: CloudBase WeChat integration guide for Mini Program WeChat Pay, Mini Program virtual payment (虚拟支付, wx.requestVirtualPayment), Official Account JSAPI Pay, Native QR-code Pay, Official Account OAuth, openid handling, payment callbacks, and CloudBase Integration Center generated functions. This skill should be used when users ask to add, debug, or extend WeChat payment, virtual payment, or official-account flows on CloudBase. version: 2.35.0 alwaysApply: false --- # CloudBase WeChat Integration This skill routes WeChat payment and official-account work through CloudBase Integration Center. It gives the agent the stable execution contract and points to the official Markdown docs for console details that may change. ## Sibling skills (local only) Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../auth-tool-cloudbase/SKILL.md`. If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do **not** HTTP-fetch remote skill or protocol markdown into the agent context. Official CloudBase Integration Center docs (human reference — do not treat as skill markdown to fetch into agent context as a sibling skill substitute): - CloudBase Integration Center overview: `https://docs.cloudbase.net/integration/introduce.md` - CloudBase Integration Center usage: `https://docs.cloudbase.net/integration/usage.md` - When cloud function deployment or log operations are needed and no sibling skill is available, use the current platform's CloudBase MCP tools or CloudBase console instead of guessing unsupported APIs. ## Activation Contract ### Use this first when - The user asks about WeChat Pay, 小程序支付, 微信支付, JSAPI 支付, 公众号支付, Native 扫码支付, 二维码支付, refund callbacks, payment callbacks, `wx.requestPayment`, `WeixinJSBridge`, `openid`, or Official Account OAuth in a CloudBase app. - The user asks about 虚拟支付 (virtual payment) for virtual goods: 道具直购, 代币充值, `wx.requestVirtualPayment`, OfferID, AppKey 签名, `xpay_*` callbacks (发货推送/查单/退款), or MP 后台虚拟支付开通与配置. - The task mentions CloudBase Integration Center, 集成中心, generated payment functions, `pay-common`, `offiaccount-common`, or callback routing for WeChat payment. - The user needs to extend a CloudBase Integration Center generated function with order persistence, idempotency, fulfillment, or payment-status sync. ### Then also read - Mini Program structure and preview work -> `../miniprogram-development/SKILL.md` (if unavailable, use the current mini program platform docs and the mini-program payment reference in this skill) - Web frontend work -> `../web-development/SKILL.md` (if unavailable, use the JSAPI or Native references in this skill) - Cloud function runtime, logs, deployment, or gateway work -> `../cloud-functions/SKILL.md` (if unavailable, use CloudBase console/MCP function tools and the generated-function guidance in this skill) ### Do NOT use
_meta.json
{
"ownerId": "kn7emfp36dbn1xx4fz4s5q4a6180439j",
"slug": "cloudbase-wechat-integration",
"version": "1.2.57",
"publishedAt": 1791524513531
}references/mini-program-pay.md
# Mini Program WeChat Pay
Official docs:
- `https://docs.cloudbase.net/integration/wechat-pay-miniprogram.md`
- `https://docs.cloudbase.net/integration/usage.md`
## When To Use
Use this reference for WeChat Mini Program payment flows on CloudBase, including 小程序微信支付, `wx.cloud.callHTTPFunction`, `wx.requestPayment`, Mini Program openid handling, payment callbacks, refunds, and order-status sync.
## Agent Must Know
- The CloudBase Integration Center generated payment function is an HTTP cloud function.
- `pay-common` is an example function name; use the actual generated function name.
- Mini Program openid can be injected by CloudBase when calling through the Mini Program cloud function path.
- The client-side `wx.requestPayment` success callback is not the final business truth.
- Fulfillment must be driven by callback handling or explicit order query.
## Minimal Contract
Typical Mini Program flow:
1. Mini Program calls the generated payment function over `wx.cloud.callHTTPFunction`.
2. The request path targets the generated payment route, commonly an order-creation path such as `/wx-pay/wxpay_order`.
3. The generated function returns payment parameters for `wx.requestPayment`.
4. The Mini Program invokes `wx.requestPayment`.
5. Backend callback or query logic confirms paid state before updating business data.
Example shape:
```js
const functionName = "replace-with-generated-payment-function";
const orderResult = await wx.cloud.callHTTPFunction({
name: functionName,
path: "/wx-pay/wxpay_order",
data: {
out_trade_no: orderId,
description: "Order payment",
amount: {
total: 1,
currency: "CNY",
},
},
});
// callHTTPFunction returns { data, statusCode, header }
// The generated function typically returns { code, data, message }
// Payment params are under orderResult.data.data
const payment = orderResult.data?.data;
if (!payment) {
throw new Error("Missing payment parameters from CloudBase payment function");
}
await wx.requestPayment(payment);
```
Adjust field names to the official docs and the generated function contract before using in production.
## Implementation Checklist
- Confirm `wx.cloud.init({ env })` uses the canonical full CloudBase environment ID.
- Confirm the Mini Program AppID matches the WeChat Pay merchant binding.
- Confirm the generated function name and path in CloudBase console.
- Generate a unique `out_trade_no` on the backend or trusted business layer.
- Validate amount and product data server-side before creating payment.
- Persist pending order state before initiating payment.
- Handle payment callback idempotently.
- Query the order after client payment success before showing final fulfillment state.
## Common Extensions
- Write order and payment status to CloudBase database.
- Add an idempotency key on `out_trade_no`.
- Add fulfillment only after callback/query confirms success.
- Add refund initiation and refund callback handling if the product supports refunds.
## Dreferences/native-qr-pay.md
# Native QR-Code Pay
Official docs:
- `https://docs.cloudbase.net/integration/wechat-pay-native.md`
- `https://docs.cloudbase.net/integration/usage.md`
## When To Use
Use this reference for PC/Web checkout, Native WeChat Pay, QR-code payment, or flows where the generated function returns a payment `code_url` for the frontend to render as a QR code.
## Agent Must Know
- Native payment does not use `wx.requestPayment` or `WeixinJSBridge`.
- The generated payment function creates an order and returns a QR-code URL such as `code_url`.
- The frontend renders the QR code and polls or subscribes to payment state.
- Fulfillment must wait for callback or query confirmation.
## Minimal Contract
Typical Native flow:
1. Backend or frontend calls the generated payment function to create a Native order.
2. The generated function returns `code_url`.
3. The frontend renders `code_url` as a QR code.
4. The user scans the QR code in WeChat.
5. The app polls order status or waits for callback-driven state changes.
Example frontend shape:
```js
async function createNativePayment(orderId) {
const response = await fetch("/api/pay/native-order", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ orderId }),
});
const data = await response.json();
if (!data.code_url) {
throw new Error("Missing Native payment code_url");
}
return data.code_url;
}
```
In CloudBase frontend-only projects, the API wrapper can call the generated HTTP function directly if the access model and CORS/security rules are appropriate. For production, prefer a trusted backend or generated function extension that validates amount and order ownership.
## Implementation Checklist
- Confirm this is Native QR-code payment, not JSAPI or Mini Program payment.
- Confirm generated function name and Native order path.
- Generate a unique order number and persist pending state.
- Validate amount and goods details before creating payment.
- Render QR code from `code_url`.
- Poll order status with backoff, or update UI from callback-driven status.
- Expire stale QR codes and handle closed orders.
## Do Not
- Do not call `wx.requestPayment` for Native QR-code pay.
- Do not fulfill the order when the QR code is generated.
- Do not rely on frontend polling alone if callback data says otherwise.references/official-account-jsapi-pay.md
# Official Account JSAPI Pay
Official docs:
- `https://docs.cloudbase.net/integration/wechat-pay-jsapi-h5.md`
- `https://docs.cloudbase.net/integration/wechat-official-oauth.md`
- `https://docs.cloudbase.net/integration/usage.md`
## When To Use
Use this reference for WeChat Official Account webpage payment, JSAPI payment inside the WeChat browser, H5 checkout that calls `WeixinJSBridge.invoke`, and flows that need an official-account openid before creating the payment order.
## Agent Must Know
- JSAPI payment requires the page to run in the WeChat built-in browser.
- The payer openid must belong to the correct Official Account, not the Mini Program openid.
- Official Account OAuth is commonly needed before JSAPI order creation.
- The generated payment function name and routes must be read from the user's Integration Center setup.
- Final business state still depends on payment callback or order query.
## Minimal Contract
Typical JSAPI flow:
1. Redirect the user through Official Account OAuth to get an openid.
2. Call the generated payment function to create a JSAPI order.
3. Pass returned payment parameters to `WeixinJSBridge.invoke("getBrandWCPayRequest", ...)`.
4. Use payment callback or order query to confirm paid state.
Example invocation shape:
```js
function invokeJsapiPay(paymentParams) {
return new Promise((resolve, reject) => {
if (!window.WeixinJSBridge) {
reject(new Error("WeixinJSBridge is unavailable; open this page in WeChat"));
return;
}
window.WeixinJSBridge.invoke(
"getBrandWCPayRequest",
paymentParams,
(res) => {
if (res.err_msg === "get_brand_wcpay_request:ok") {
resolve(res);
return;
}
reject(new Error(res.err_msg || "JSAPI payment failed"));
},
);
});
}
```
Adjust request paths and parameter names to the generated function contract and official docs.
## Implementation Checklist
- Confirm the app is an Official Account web flow, not a Mini Program page.
- Confirm the page runs inside WeChat before showing JSAPI checkout.
- Obtain the Official Account openid through OAuth before order creation.
- Confirm merchant account binding matches the Official Account AppID.
- Persist pending order state before invoking payment.
- Confirm paid state through callback or query before fulfillment.
## Do Not
- Do not reuse Mini Program openid for Official Account JSAPI pay.
- Do not show JSAPI checkout in a normal desktop browser.
- Do not put AppSecret, merchant private keys, or APIv3 keys in browser code.activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/binggg/skills/cloudbase-wechat-integration",
"sourceUrl": "https://clawhub.ai/binggg/skills/cloudbase-wechat-integration",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T07:34:55.285Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-binggg-cloudbase-wechat-integration/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-binggg-cloudbase-wechat-integration/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T07:34:55.285Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "3.6K downloads",
"href": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceUrl": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T07:34:55.285Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.2.57",
"href": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceUrl": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-09T05:41:53.531Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-binggg-cloudbase-wechat-integration/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-binggg-cloudbase-wechat-integration/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.2.57",
"description": "Recent commits / 最近提交: | - fix(env): 🐛 stop shipping package IDs that do not exist (#1136) | - chore: sync cloudbase plugin skills from upstream | - chore(connectors): sync generated cloudbase-intl package [skip ci] | - feat(mcp): retire MySQL provisioning from the tool surface (#1137) | - chore(deps): 🔒 把安全 overrides 顶到已修复版本 (#1135)",
"href": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceUrl": "https://clawhub.ai/binggg/cloudbase-wechat-integration",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-10-09T05:41:53.531Z",
"isPublic": true
}
]
}Record generated Oct 9, 2026.
