Guoguo 78ea1a03c5 feat: WeChat Pay V3 integration (fill credentials to activate)
Server:
- New lib/wxpay.js: native crypto RSA-SHA256 signing, JSAPI prepay,
  AES-256-GCM notify decryption, order query (no npm deps)
- New dao/payment-order.dao.js: createOrder, markPrepay,
  markPaidAndActivateSubscription (idempotent + transactional)
- New routes/payment.js: GET order status, POST order sync
- New routes/payment-notify.js: WeChat async callback handler with
  signature verification, amount/appid/mchid validation
- Modified subscription/purchase: auto-detects wxpay config, returns
  real payment_params or mock fallback
- Schema: payment_orders table with out_trade_no unique key
- app.js: express.raw() for notify path, payment routes mounted
- config.js: wxpay block with 7 env vars
- .env.example: all WeChat Pay fields documented
- .gitignore: certs/, *.pem, *.p12

Miniprogram:
- subscribe-plans doPurchase: calls real purchase API, falls back to
  mockPurchase only when server returns mock:true
- Added syncAndRedirect for post-payment order confirmation
- api.js: getPaymentOrder, syncPaymentOrder
- Removed "模拟支付"/"测试环境" from UI text
2026-05-18 03:07:59 -07:00

Hox 文档目录

本目录集中存放项目说明、设计文档、协议资料、计划清单和原型文件,根目录只保留代码目录与仓库级配置。

目录结构

目录 内容
requirements/ 产品说明、系统说明等需求来源文档
design/ 业务流程、接口、数据库、后台、安全、测试等设计文档
protocols/ BLE、云端通信等协议文档;部分 IoT/MQTT 内容为历史设计参考
planning/ 开发计划、当前进度交接、待确认事项、缺口清单
reviews/ 代码与文档对比、评审和分析材料;旧评审可能是历史快照
prototypes/ 小程序和管理后台原型文件
reference/ 原始资料包、UI 导出页、截图等参考材料

当前入口

  • planning/PROGRESS.md — 当前实现和部署状态,以此为准
  • deploy/tencent-cloud.md — 腾讯云函数、MySQL、COS 部署说明
  • requirements/软件系统说明.docx
  • requirements/光子美容仪软件系统说明.docx
  • design/01-BLE通信协议明细.md
  • protocols/BLE协议冲突与问题清单.md
  • protocols/协议简述-补充解析.md
  • design/02-小程序业务流程与状态机.md
  • planning/需求缺口清单.md
  • reviews/代码与设计文档对比分析.md — 历史阶段评审,不能代表当前实现

当前实现提示

  • 当前后端是 server/ 下的腾讯云 HTTP 函数,不是微信云开发函数。
  • 当前小程序通过 HTTPS API 调后端,不再使用 wx.cloud.callFunction()
  • 当前设备不直接连云端 MQTT,设备通信主路径是小程序 BLE 中转。
  • 登录资料授权使用 wx.getUserProfile() 官方弹窗;微信可能返回 微信用户 等脱敏资料。
S
描述
无详细信息
自述文档
1.9 MiB
语言
JavaScript 77.2%
Vue 22%
CSS 0.7%