AI Agent Hub
Back to skills
Tencent CloudBase WeChat Integration icon

Tencent CloudBase WeChat Integration

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @tencent-adm/cloudbase-wechat-integration.

About this skill

The problem

When integrating WeChat Pay, official-account OAuth, JSAPI, or Native QR-code checkout into CloudBase, the hard part is not a single API call. It is keeping the moving pieces separate: wx.requestPayment vs WeixinJSBridge.invoke, Mini Program openid injection, callback verification and decryption, order persistence, idempotency, and amount validation. Hand-rolled code often guesses generated function names, treats frontend success as payment success, or puts merchant secrets into source, READMEs, or chat.

How the skill works

This skill scopes the work to CloudBase Integration Center generated functions and official documentation. It first classifies the scenario, then points to the matching reference: mini-program-pay.md, native-qr-pay.md, official-account-jsapi-pay.md, or official-account-oauth.md. It enforces a conservative workflow:

  • Console-first setup: use official index.md docs and the CloudBase console forms for Integration Center creation and credentials.
  • No fixed function names: pay-common and offiaccount-common are examples only; confirm the actual generated function name before writing calls.
  • Server-side payment state: rely on callbacks or query results, not UI success.
  • Preserve security logic: keep credential environment variables and callback verification/decryption intact, then add order checks, persistence, idempotency, and fulfillment.

Boundaries

Use it for Mini Program Pay, Official Account JSAPI, Native QR-code Pay, Official Account OAuth, generated-function extensions, and troubleshooting. Do not use it for generic CloudBase Web Auth, unrelated cloud function development, or for inventing Manager SDK/Cloud API calls to manage Integration Center. Keep AppSecret, APIv3 keys, and certificates out of source code, README files, commits, and prompts.

Use Cases

  • Connect a Mini Program checkout to `wx.requestPayment` and verify that callback state matches the order.
  • Start Official Account JSAPI payment inside WeChat H5 using the resolved `openid` and `WeixinJSBridge`.
  • Generate a Native QR-code payment URL for PC/Web checkout and poll the query endpoint for final state.
  • Diagnose 404s, missing credentials, `openid` mismatches, or failed payment callbacks before changing code.

Best For

  • A Mini Program frontend engineer who needs to close the loop between `openid`, order creation, and payment callbacks.
  • A CloudBase backend engineer who needs to extend generated payment functions without breaking signature or decryption logic.
  • An operations or frontend engineer building WeChat H5 checkout who needs reliable JSAPI payment results.
  • An SRE or QA engineer diagnosing payment failures through logs, callbacks, and credential configuration.