nomadro/apps/miniprogram/docs/wechat-virtual-pay-props.md
Eric ac1239c828 Redesign WeChat paid props as ops shelf: Chinese names, SKUs, icons.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-22 11:12:34 +08:00

68 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 微信小程序虚拟支付 · 账号与道具
SoT 代码:`apps/api/services/ebook_svc/domains/books/products.py`
支付签名:`apps/api/services/ebook_svc/services/wxpay.py`(`WX_PAY_ENV=0` 现网 / `1` 沙箱自动选 AppKey)
## 账号
| 项 | 值 |
|---|---|
| AppID(小程序) | `wx11f6afc44ea1532f` |
| OfferID(支付应用) | `1450705308` |
| 现网 AppKey | `JUN15h8sl5sNQt0awMSrd4Jpv1aSGOYY` |
| 沙箱 AppKey | `BQ1DlPjq3PIEzV4UwXQrKxLtqAqlmAEi` |
```env
WX_APPID=wx11f6afc44ea1532f
WX_SECRET=…
WX_OFFER_ID=1450705308
WX_APP_KEY=JUN15h8sl5sNQt0awMSrd4Jpv1aSGOYY
WX_SANDBOX_APP_KEY=BQ1DlPjq3PIEzV4UwXQrKxLtqAqlmAEi
WX_PAY_ENV=0
```
微信后台:**支付与交易 → 虚拟支付 → 道具管理**(`productId` / 价格须与下表一致后再发版)。
## 运营货架(给用户付费看的)
| key | 道具 ID | 名称(≤10) | 价格 | 图 | 备注 / 上架 |
|---|---|---|---|---|---|
| `free` | — | 免费全书 | 免费 | — | 不拉起支付 |
| `yen29` | `nomad_lite` | 轻享全书 | ¥29 | `nomad_lite.png` | 入门 · 可上架 |
| `nomad` | `nomad` | 漫游全书 | ¥49 | `nomad.png` | **主推** |
| `tiktok` | `tiktok` | 短视频全书 | ¥88 | `tiktok.png` | 可上架 |
| `youtube` | `youtube` | 长视频全书 | ¥188 | `youtube.png` | **默认推荐** |
| `ebook` | `ebook_unlock_default` | 经典全书 | ¥188 | `ebook.png` | 兼容旧单 |
| `yen298` | `nomad_plus` | 进阶全书 | ¥298 | `nomad_plus.png` | 可上架 |
| `yen588` | `nomad_pro` | 精英全书 | ¥588 | `nomad_pro.png` | 可上架 |
| `svip` | `svip` | 超级会员 | ¥998 | `svip.png` | 旗舰 |
| `test` | `pay_test` | 联调占位 | ¥1 | `pay_test.png` | **勿对用户发布** |
图标目录:`apps/admin/public/props/`。
遗留草稿 id:`29`/`298`/`588`/`test` → 映射到上表;勿再发布旧草稿。
## 微信批量上传
固定目录:[`wx-props-batch/`](wx-props-batch/)
```bash
python apps/miniprogram/scripts/gen_wx_prop_icons.py
python apps/miniprogram/scripts/gen_wx_props_batch_xlsx.py
```
| 列 | 要求 |
|---|---|
| 道具id | ≤32 英文;语义化 SKU |
| 道具名称 | ≤10 字;**用户可见货架名** |
| 道具图片 | HTTPS;PNG/JPG;200×200;≤200KB;CORS |
| 道具价格 | 整数元 |
| 备注 | ≤50;运营内部说明,不对外 |
图片 CDN:`https://admin.nomadro.cn/props/{file}.png`(已对 `mp.weixin.qq.com` 放 CORS)。
## 验收
- 沙箱:`WX_PAY_ENV=1`
- 现网:道具已「发布」、价格与上表一致;`pay_test` 保持未发布
- 路径:登录 → 下单 → `requestVirtualPayment` → 发货回调