[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M771B5VBWEZBDANSVBM12AW5":3,"skill-same:01M771B5VBWEZBDANSVBM12AW5":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M771B5VBWEZBDANSVBM12AW5","china-payment-integration",null,"Integrate Chinese payment methods (WeChat Pay, Alipay, UnionPay) into applications. Teach AI agents how to implement payment flows, handle callbacks, manage refunds, and comply with Chinese payment regulations. Covers: WeChat Pay JSAPI\u002FH5\u002FNative\u002FMini Program payment, Alipay web\u002Fmobile payment, dual-payment unified interface, refund and reconciliation, and payment compliance. Triggers on: 微信支付集成, wechat pay integration, 支付宝集成, alipay integration, 银联支付, unionpay, 中国支付接入, china payment integration, 微信小程序支付, mini program payment, 支付回调, payment callback, 退款处理, refund processing, 支付合规, payment compliance, 双支付统一接口, dual payment interface","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fchina-payment-integration\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: china-payment-integration\ndescription: \"Integrate Chinese payment methods (WeChat Pay, Alipay, UnionPay) into applications. Teach AI agents how to implement payment flows, handle callbacks, manage refunds, and comply with Chinese payment regulations. Covers: WeChat Pay JSAPI\u002FH5\u002FNative\u002FMini Program payment, Alipay web\u002Fmobile payment, dual-payment unified interface, refund and reconciliation, and payment compliance. Triggers on: 微信支付集成, wechat pay integration, 支付宝集成, alipay integration, 银联支付, unionpay, 中国支付接入, china payment integration, 微信小程序支付, mini program payment, 支付回调, payment callback, 退款处理, refund processing, 支付合规, payment compliance, 双支付统一接口, dual payment interface\"\n---\n\n# China Payment Integration - 中国支付集成专家\n\nYou are an expert at integrating Chinese payment methods into applications. You handle WeChat Pay, Alipay, and UnionPay — the three pillars of Chinese digital payments.\n\n## Core Philosophy\n\n**In China, if you can't accept WeChat Pay or Alipay, you can't collect money.** Credit cards are secondary. Your job is to make payment integration painless and compliant.\n\n## Payment Landscape\n\n| Method | Market Share | Best For | Settlement |\n|--------|-------------|----------|------------|\n| WeChat Pay | ~40% | Mini Programs, social commerce, in-app | T+1 |\n| Alipay | ~55% | E-commerce, web payments, subscriptions | T+1 |\n| UnionPay | ~5% | Large transactions, government, banking | T+1 |\n\n## Workflow 1: WeChat Pay Integration\n\n### Prerequisites\n1. Register merchant account: https:\u002F\u002Fpay.weixin.qq.com\n2. Get merchant ID (mchid), API key (apiV3Key), and certificate\n3. Set payment callback URL (notify_url)\n\n### JSAPI Payment (In-WeChat Browser)\n```javascript\n\u002F\u002F Backend: Create order (Node.js)\nconst WxPay = require('wechatpay-node-v3');\nconst pay = new WxPay({\n  appid: 'YOUR_WECHAT_APP_ID',\n  mchid: 'YOUR_MERCHANT_ID',\n  publicKey: Buffer.from(process.env.WX_CERT),\n  privateKey: Buffer.from(process.env.WX_KEY),\n  apiV3Key: process.env.WX_API_V3_KEY,\n});\n\n\u002F\u002F Step 1: Create prepay order\nconst result = await pay.transactions_jsapi({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' }, \u002F\u002F total in 分 (cents)\n  payer: { openid: userOpenId },\n});\n\n\u002F\u002F Step 2: Return payment params to frontend\nconst payParams = {\n  appId: 'wx1234567890',\n  timeStamp: String(Math.floor(Date.now() \u002F 1000)),\n  nonceStr: crypto.randomUUID(),\n  package: `prepay_id=${result.prepay_id}`,\n  signType: 'RSA',\n};\npayParams.paySign = pay.sign(payParams);\n\n\u002F\u002F Frontend: Call WeChat JSAPI\n\u002F\u002F WeixinJSBridge.invoke('getBrandWCPayRequest', payParams, callback);\n```\n\n### Native Payment (QR Code)\n```javascript\n\u002F\u002F For desktop web — generates QR code for user to scan\nconst result = await pay.transactions_native({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' },\n});\n\u002F\u002F result.code_url → generate QR code for this URL\n```\n\n### Mini Program Payment\n```javascript\n\u002F\u002F Same as JSAPI but called from mini program\nconst result = await pay.transactions_jsapi({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' },\n  payer: { openid: userOpenId },\n});\n\n\u002F\u002F Frontend: wx.requestPayment\n\u002F\u002F wx.requestPayment({ timeStamp, nonceStr, package, signType, paySign });\n```\n\n### Payment Callback Handler\n```javascript\n\u002F\u002F POST \u002Fapi\u002Fpay\u002Fwechat\u002Fcallback\napp.post('\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback', async (req, res) => {\n  try {\n    \u002F\u002F Step 1: Verify signature\n    const signature = req.headers['wechatpay-signature'];\n    const timestamp = req.headers['wechatpay-timestamp'];\n    const nonce = req.headers['wechatpay-nonce'];\n    \n    \u002F\u002F Step 2: Decrypt notification\n    const decrypted = pay.decipher_gcm(\n      req.body.resource.ciphertext,\n      req.body.resource.associated_data,\n      req.body.resource.nonce,\n    );\n    \n    const payment = JSON.parse(decrypted);\n    \n    \u002F\u002F Step 3: Process payment result\n    if (payment.trade_state === 'SUCCESS') {\n      await Order.updateOne(\n        { out_trade_no: payment.out_trade_no },\n        { \n          status: 'paid',\n          transaction_id: payment.transaction_id,\n          paid_at: new Date(payment.success_time),\n        }\n      );\n    }\n    \n    \u002F\u002F Step 4: Acknowledge\n    res.json({ code: 'SUCCESS', message: 'OK' });\n  } catch (err) {\n    console.error('Payment callback error:', err);\n    res.json({ code: 'FAIL', message: err.message });\n  }\n});\n```\n\n## Workflow 2: Alipay Integration\n\n### Prerequisites\n1. Register at https:\u002F\u002Fopen.alipay.com\n2. Create app, get appid\n3. Upload RSA2 public key, get Alipay public key\n4. Set payment callback URL\n\n### Web Payment (PC)\n```javascript\nconst AlipaySdk = require('alipay-sdk').default;\nconst alipay = new AlipaySdk({\n  appId: '2021001234567890',\n  privateKey: process.env.ALIPAY_PRIVATE_KEY,\n  alipayPublicKey: process.env.ALIPAY_PUBLIC_KEY,\n});\n\n\u002F\u002F Create payment page\nconst result = alipay.pageExec('alipay.trade.page.pay', {\n  method: 'GET',\n  bizContent: {\n    out_trade_no: `ORDER_${Date.now()}`,\n    total_amount: '1.00', \u002F\u002F 元 (yuan, not cents!)\n    subject: 'Product Name',\n    product_code: 'FAST_INSTANT_TRADE_PAY',\n    notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Falipay\u002Fcallback',\n    return_url: 'https:\u002F\u002Fyour-domain.com\u002Fpayment\u002Fsuccess',\n  },\n});\n\u002F\u002F Redirect user to result (Alipay payment page)\n```\n\n### Mobile Payment (H5)\n```javascript\nconst result = alipay.pageExec('alipay.trade.wap.pay', {\n  method: 'GET',\n  bizContent: {\n    out_trade_no: `ORDER_${Date.now()}`,\n    total_amount: '1.00',\n    subject: 'Product Name',\n    product_code: 'QUICK_WAP_WAY',\n    quit_url: 'https:\u002F\u002Fyour-domain.com\u002Fpayment\u002Fcancel',\n  },\n});\n```\n\n### Alipay Callback Handler\n```javascript\napp.post('\u002Fapi\u002Fpay\u002Falipay\u002Fcallback', async (req, res) => {\n  \u002F\u002F Step 1: Verify signature\n  const isValid = alipay.checkNotifySign(req.body);\n  if (!isValid) return res.send('fail');\n  \n  \u002F\u002F Step 2: Process\n  if (req.body.trade_status === 'TRADE_SUCCESS') {\n    await Order.updateOne(\n      { out_trade_no: req.body.out_trade_no },\n      { status: 'paid', transaction_id: req.body.trade_no }\n    );\n  }\n  \n  \u002F\u002F Step 3: Acknowledge\n  res.send('success');\n});\n```\n\n## Workflow 3: Dual-Payment Unified Interface\n\n**When**: Support both WeChat Pay and Alipay with one codebase\n\n```javascript\nclass ChinaPayment {\n  constructor() {\n    this.wechatPay = new WxPay(wxConfig);\n    this.alipay = new AlipaySdk(alipayConfig);\n  }\n\n  async createOrder({ method, orderId, amount, description, openid }) {\n    switch (method) {\n      case 'wechat_jsapi':\n        return this._wechatJSAPI(orderId, amount, description, openid);\n      case 'wechat_native':\n        return this._wechatNative(orderId, amount, description);\n      case 'alipay_page':\n        return this._alipayPage(orderId, amount, description);\n      case 'alipay_wap':\n        return this._alipayWAP(orderId, amount, description);\n      default:\n        throw new Error(`Unsupported payment method: ${method}`);\n    }\n  }\n\n  async handleCallback(provider, req) {\n    switch (provider) {\n      case 'wechat':\n        return this._handleWechatCallback(req);\n      case 'alipay':\n        return this._handleAlipayCallback(req);\n    }\n  }\n\n  \u002F\u002F Amount conversion helper\n  _toFen(yuan) { return Math.round(yuan * 100); }  \u002F\u002F WeChat uses 分\n  _toYuan(fen) { return (fen \u002F 100).toFixed(2); }   \u002F\u002F Alipay uses 元\n}\n```\n\n## Workflow 4: Refund Processing\n\n```javascript\n\u002F\u002F WeChat Refund\nasync function wechatRefund(out_trade_no, refund_amount, total_amount) {\n  const result = await pay.refund({\n    out_trade_no,\n    out_refund_no: `REFUND_${Date.now()}`,\n    amount: {\n      refund: refund_amount,  \u002F\u002F in 分\n      total: total_amount,    \u002F\u002F in 分\n      currency: 'CNY',\n    },\n    reason: 'User requested refund',\n  });\n  return result;\n}\n\n\u002F\u002F Alipay Refund\nasync function alipayRefund(out_trade_no, refund_amount) {\n  const result = await alipay.exec('alipay.trade.refund', {\n    bizContent: {\n      out_trade_no,\n      refund_amount: refund_amount.toFixed(2),  \u002F\u002F in 元\n    },\n  });\n  return result;\n}\n```\n\n## Workflow 5: Payment Compliance Checklist\n\n### Required for All Payment Integrations\n- [ ] **Business license** (营业执照) — required for merchant accounts\n- [ ] **ICP filing** — required for payment callback URLs\n- [ ] **User agreement** — terms of service with payment terms\n- [ ] **Refund policy** — clearly stated refund process\n- [ ] **Invoice support** (发票) — Chinese users expect fapiao\n- [ ] **Data encryption** — card\u002Fbank info must be encrypted\n- [ ] **Transaction logging** — keep records for 5+ years\n- [ ] **Anti-fraud** — implement rate limiting and suspicious activity detection\n\n### WeChat Pay Specific\n- [ ] Mini Program payment only works within WeChat ecosystem\n- [ ] Virtual goods cannot use WeChat Pay (use in-app purchase API instead)\n- [ ] Subscription payments require special approval\n\n### Alipay Specific\n- [ ] Real-name verification required for merchants\n- [ ] Annual transaction limits apply for personal accounts\n- [ ] Cross-border payments require separate qualification\n\n## Safety Rules\n\n1. **Never store payment credentials** — use tokens\u002Freferences only\n2. **Always verify callback signatures** — never trust unverified callbacks\n3. **Idempotency** — handle duplicate callbacks gracefully (check order status before processing)\n4. **Amount in correct unit** — WeChat uses 分(cents), Alipay uses 元(yuan) — this is the #1 bug\n5. **HTTPS only** — payment callbacks must use HTTPS\n6. **Test in sandbox first** — both WeChat and Alipay provide sandbox environments\n7. **Monitor for chargebacks** — set up alerts for dispute notifications\n\n## Quick Reference\n\n```bash\n# WeChat Pay sandbox\n# https:\u002F\u002Fpay.weixin.qq.com\u002Fwiki\u002Fdoc\u002Fapi\u002Fjsapi.php?chapter=23_1\n\n# Alipay sandbox\n# https:\u002F\u002Fopen.alipay.com\u002Fdevelop\u002Fsandbox\u002Fapp\n\n# Test payment amount conventions\n# 0.01元 = 1分 (minimum test amount)\n# Amount ending in 1 = success, 2 = fail (in sandbox)\n```\n","# China Payment Integration - 中国支付集成专家\n\nYou are an expert at integrating Chinese payment methods into applications. You handle WeChat Pay, Alipay, and UnionPay — the three pillars of Chinese digital payments.\n\n## Core Philosophy\n\n**In China, if you can't accept WeChat Pay or Alipay, you can't collect money.** Credit cards are secondary. Your job is to make payment integration painless and compliant.\n\n## Payment Landscape\n\n| Method | Market Share | Best For | Settlement |\n|--------|-------------|----------|------------|\n| WeChat Pay | ~40% | Mini Programs, social commerce, in-app | T+1 |\n| Alipay | ~55% | E-commerce, web payments, subscriptions | T+1 |\n| UnionPay | ~5% | Large transactions, government, banking | T+1 |\n\n## Workflow 1: WeChat Pay Integration\n\n### Prerequisites\n1. Register merchant account: https:\u002F\u002Fpay.weixin.qq.com\n2. Get merchant ID (mchid), API key (apiV3Key), and certificate\n3. Set payment callback URL (notify_url)\n\n### JSAPI Payment (In-WeChat Browser)\n```javascript\n\u002F\u002F Backend: Create order (Node.js)\nconst WxPay = require('wechatpay-node-v3');\nconst pay = new WxPay({\n  appid: 'YOUR_WECHAT_APP_ID',\n  mchid: 'YOUR_MERCHANT_ID',\n  publicKey: Buffer.from(process.env.WX_CERT),\n  privateKey: Buffer.from(process.env.WX_KEY),\n  apiV3Key: process.env.WX_API_V3_KEY,\n});\n\n\u002F\u002F Step 1: Create prepay order\nconst result = await pay.transactions_jsapi({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' }, \u002F\u002F total in 分 (cents)\n  payer: { openid: userOpenId },\n});\n\n\u002F\u002F Step 2: Return payment params to frontend\nconst payParams = {\n  appId: 'wx1234567890',\n  timeStamp: String(Math.floor(Date.now() \u002F 1000)),\n  nonceStr: crypto.randomUUID(),\n  package: `prepay_id=${result.prepay_id}`,\n  signType: 'RSA',\n};\npayParams.paySign = pay.sign(payParams);\n\n\u002F\u002F Frontend: Call WeChat JSAPI\n\u002F\u002F WeixinJSBridge.invoke('getBrandWCPayRequest', payParams, callback);\n```\n\n### Native Payment (QR Code)\n```javascript\n\u002F\u002F For desktop web — generates QR code for user to scan\nconst result = await pay.transactions_native({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' },\n});\n\u002F\u002F result.code_url → generate QR code for this URL\n```\n\n### Mini Program Payment\n```javascript\n\u002F\u002F Same as JSAPI but called from mini program\nconst result = await pay.transactions_jsapi({\n  description: 'Product Name',\n  out_trade_no: `ORDER_${Date.now()}`,\n  notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback',\n  amount: { total: 100, currency: 'CNY' },\n  payer: { openid: userOpenId },\n});\n\n\u002F\u002F Frontend: wx.requestPayment\n\u002F\u002F wx.requestPayment({ timeStamp, nonceStr, package, signType, paySign });\n```\n\n### Payment Callback Handler\n```javascript\n\u002F\u002F POST \u002Fapi\u002Fpay\u002Fwechat\u002Fcallback\napp.post('\u002Fapi\u002Fpay\u002Fwechat\u002Fcallback', async (req, res) => {\n  try {\n    \u002F\u002F Step 1: Verify signature\n    const signature = req.headers['wechatpay-signature'];\n    const timestamp = req.headers['wechatpay-timestamp'];\n    const nonce = req.headers['wechatpay-nonce'];\n    \n    \u002F\u002F Step 2: Decrypt notification\n    const decrypted = pay.decipher_gcm(\n      req.body.resource.ciphertext,\n      req.body.resource.associated_data,\n      req.body.resource.nonce,\n    );\n    \n    const payment = JSON.parse(decrypted);\n    \n    \u002F\u002F Step 3: Process payment result\n    if (payment.trade_state === 'SUCCESS') {\n      await Order.updateOne(\n        { out_trade_no: payment.out_trade_no },\n        { \n          status: 'paid',\n          transaction_id: payment.transaction_id,\n          paid_at: new Date(payment.success_time),\n        }\n      );\n    }\n    \n    \u002F\u002F Step 4: Acknowledge\n    res.json({ code: 'SUCCESS', message: 'OK' });\n  } catch (err) {\n    console.error('Payment callback error:', err);\n    res.json({ code: 'FAIL', message: err.message });\n  }\n});\n```\n\n## Workflow 2: Alipay Integration\n\n### Prerequisites\n1. Register at https:\u002F\u002Fopen.alipay.com\n2. Create app, get appid\n3. Upload RSA2 public key, get Alipay public key\n4. Set payment callback URL\n\n### Web Payment (PC)\n```javascript\nconst AlipaySdk = require('alipay-sdk').default;\nconst alipay = new AlipaySdk({\n  appId: '2021001234567890',\n  privateKey: process.env.ALIPAY_PRIVATE_KEY,\n  alipayPublicKey: process.env.ALIPAY_PUBLIC_KEY,\n});\n\n\u002F\u002F Create payment page\nconst result = alipay.pageExec('alipay.trade.page.pay', {\n  method: 'GET',\n  bizContent: {\n    out_trade_no: `ORDER_${Date.now()}`,\n    total_amount: '1.00', \u002F\u002F 元 (yuan, not cents!)\n    subject: 'Product Name',\n    product_code: 'FAST_INSTANT_TRADE_PAY',\n    notify_url: 'https:\u002F\u002Fyour-domain.com\u002Fapi\u002Fpay\u002Falipay\u002Fcallback',\n    return_url: 'https:\u002F\u002Fyour-domain.com\u002Fpayment\u002Fsuccess',\n  },\n});\n\u002F\u002F Redirect user to result (Alipay payment page)\n```\n\n### Mobile Payment (H5)\n```javascript\nconst result = alipay.pageExec('alipay.trade.wap.pay', {\n  method: 'GET',\n  bizContent: {\n    out_trade_no: `ORDER_${Date.now()}`,\n    total_amount: '1.00',\n    subject: 'Product Name',\n    product_code: 'QUICK_WAP_WAY',\n    quit_url: 'https:\u002F\u002Fyour-domain.com\u002Fpayment\u002Fcancel',\n  },\n});\n```\n\n### Alipay Callback Handler\n```javascript\napp.post('\u002Fapi\u002Fpay\u002Falipay\u002Fcallback', async (req, res) => {\n  \u002F\u002F Step 1: Verify signature\n  const isValid = alipay.checkNotifySign(req.body);\n  if (!isValid) return res.send('fail');\n  \n  \u002F\u002F Step 2: Process\n  if (req.body.trade_status === 'TRADE_SUCCESS') {\n    await Order.updateOne(\n      { out_trade_no: req.body.out_trade_no },\n      { status: 'paid', transaction_id: req.body.trade_no }\n    );\n  }\n  \n  \u002F\u002F Step 3: Acknowledge\n  res.send('success');\n});\n```\n\n## Workflow 3: Dual-Payment Unified Interface\n\n**When**: Support both WeChat Pay and Alipay with one codebase\n\n```javascript\nclass ChinaPayment {\n  constructor() {\n    this.wechatPay = new WxPay(wxConfig);\n    this.alipay = new AlipaySdk(alipayConfig);\n  }\n\n  async createOrder({ method, orderId, amount, description, openid }) {\n    switch (method) {\n      case 'wechat_jsapi':\n        return this._wechatJSAPI(orderId, amount, description, openid);\n      case 'wechat_native':\n        return this._wechatNative(orderId, amount, description);\n      case 'alipay_page':\n        return this._alipayPage(orderId, amount, description);\n      case 'alipay_wap':\n        return this._alipayWAP(orderId, amount, description);\n      default:\n        throw new Error(`Unsupported payment method: ${method}`);\n    }\n  }\n\n  async handleCallback(provider, req) {\n    switch (provider) {\n      case 'wechat':\n        return this._handleWechatCallback(req);\n      case 'alipay':\n        return this._handleAlipayCallback(req);\n    }\n  }\n\n  \u002F\u002F Amount conversion helper\n  _toFen(yuan) { return Math.round(yuan * 100); }  \u002F\u002F WeChat uses 分\n  _toYuan(fen) { return (fen \u002F 100).toFixed(2); }   \u002F\u002F Alipay uses 元\n}\n```\n\n## Workflow 4: Refund Processing\n\n```javascript\n\u002F\u002F WeChat Refund\nasync function wechatRefund(out_trade_no, refund_amount, total_amount) {\n  const result = await pay.refund({\n    out_trade_no,\n    out_refund_no: `REFUND_${Date.now()}`,\n    amount: {\n      refund: refund_amount,  \u002F\u002F in 分\n      total: total_amount,    \u002F\u002F in 分\n      currency: 'CNY',\n    },\n    reason: 'User requested refund',\n  });\n  return result;\n}\n\n\u002F\u002F Alipay Refund\nasync function alipayRefund(out_trade_no, refund_amount) {\n  const result = await alipay.exec('alipay.trade.refund', {\n    bizContent: {\n      out_trade_no,\n      refund_amount: refund_amount.toFixed(2),  \u002F\u002F in 元\n    },\n  });\n  return result;\n}\n```\n\n## Workflow 5: Payment Compliance Checklist\n\n### Required for All Payment Integrations\n- [ ] **Business license** (营业执照) — required for merchant accounts\n- [ ] **ICP filing** — required for payment callback URLs\n- [ ] **User agreement** — terms of service with payment terms\n- [ ] **Refund policy** — clearly stated refund process\n- [ ] **Invoice support** (发票) — Chinese users expect fapiao\n- [ ] **Data encryption** — card\u002Fbank info must be encrypted\n- [ ] **Transaction logging** — keep records for 5+ years\n- [ ] **Anti-fraud** — implement rate limiting and suspicious activity detection\n\n### WeChat Pay Specific\n- [ ] Mini Program payment only works within WeChat ecosystem\n- [ ] Virtual goods cannot use WeChat Pay (use in-app purchase API instead)\n- [ ] Subscription payments require special approval\n\n### Alipay Specific\n- [ ] Real-name verification required for merchants\n- [ ] Annual transaction limits apply for personal accounts\n- [ ] Cross-border payments require separate qualification\n\n## Safety Rules\n\n1. **Never store payment credentials** — use tokens\u002Freferences only\n2. **Always verify callback signatures** — never trust unverified callbacks\n3. **Idempotency** — handle duplicate callbacks gracefully (check order status before processing)\n4. **Amount in correct unit** — WeChat uses 分(cents), Alipay uses 元(yuan) — this is the #1 bug\n5. **HTTPS only** — payment callbacks must use HTTPS\n6. **Test in sandbox first** — both WeChat and Alipay provide sandbox environments\n7. **Monitor for chargebacks** — set up alerts for dispute notifications\n\n## Quick Reference\n\n```bash\n# WeChat Pay sandbox\n# https:\u002F\u002Fpay.weixin.qq.com\u002Fwiki\u002Fdoc\u002Fapi\u002Fjsapi.php?chapter=23_1\n\n# Alipay sandbox\n# https:\u002F\u002Fopen.alipay.com\u002Fdevelop\u002Fsandbox\u002Fapp\n\n# Test payment amount conventions\n# 0.01元 = 1分 (minimum test amount)\n# Amount ending in 1 = success, 2 = fail (in sandbox)\n```\n",{"name":5,"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fc\u002Fchina-payment-integration",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill china-payment-integration",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill china-payment-integration",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill china-payment-integration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fchina-payment-integration\u002FSKILL.md",true,[],[48,56,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":55},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":55},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":55},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":55},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":55},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":55},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]