wechat-webhooks

Installation
SKILL.md

WeChat Pay Webhooks

When to Use This Skill

  • How do I receive WeChat Pay webhooks (APIv3 notifications)?
  • How do I verify the Wechatpay-Signature header?
  • How do I decrypt the encrypted resource in a WeChat Pay notification?
  • How do I handle TRANSACTION.SUCCESS or REFUND.SUCCESS events?
  • Why is my WeChat Pay signature verification failing?

How WeChat Pay Notifications Work

WeChat Pay APIv3 does not use HMAC or the Standard Webhooks spec. Each notification is:

  1. Asymmetrically signed (SHA256withRSA) — verify with the WeChat Pay platform public key, matched by the Wechatpay-Serial header, over the message "{timestamp}\n{nonce}\n{body}\n".
  2. Separately encrypted — the resource object is AEAD_AES_256_GCM ciphertext. Decrypt resource.ciphertext with your 32-byte APIv3 key to recover the transaction/refund JSON.

The signed body is the raw request bytes (the ciphertext envelope), so verify first, then decrypt. Always use the raw request body — never JSON.parse before verifying.

Installs
11
GitHub Stars
81
First Seen
Jul 25, 2026
wechat-webhooks — hookdeck/webhook-skills