Files
pay/config/config.yaml
T
wangjia fd5f56f7de feat: 微信V3 + 支付宝手机站/UA自适应 + 业务对接(签名下单/webhook) + 通用多业务
- 微信支付 V3 Native 渠道 (wechat.go):Native下单/回调AES-GCM解密验签/查单
- 支付宝:手机网站支付 wap.pay + 按 UA 自适应(PC page.pay扫码 / 手机拉App);qr_pay_mode=2 完整扫码收银台
- 业务对接:下单接口扩展(biz_system/biz_ref/return_url)+ HMAC 签名鉴权;支付成功 webhook 主动推送业务方 + 60s 重试 + BizNotifyLog
- 通用多业务:config.biz 改 map,加业务只改配置(BIZ_<SYS>_SECRET/_CALLBACK_URL)
- seedPlans:四档真实套餐 + promo_first_month(¥1) + test_liandiao(0.01),均挂 biz_code;/products 暴露 biz_code
- 删除沙箱 pay.html;对接设计文档入 docs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019UQmqWmV67sXGLrb3U1XXn
2026-07-03 22:44:34 +08:00

58 lines
3.1 KiB
YAML
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.
# 支付服务配置(模板)
# ⚠️ 密钥严禁写进本文件!一律走环境变量(生产由 Bitwarden 经 rbw 灌入):
# ALIPAY_APP_PRIVATE_KEY / ALIPAY_PUBLIC_KEY
server:
port: "8080"
mode: "debug" # debug | release
# 拼 notify_url / return_url 的根地址。
# 本机只测「下单→跳收银台」用 http://localhost:8080 即可;
# 要测异步回调 notify 需公网可达地址(内网穿透,或部署到服务器用 IP/域名)。
base_url: "http://localhost:8080"
database:
driver: "sqlite" # sqlite(默认,纯 Go 无需 gcc | mysql
dsn: "pay.db" # sqlite 文件路径;mysql 时填 user:pass@tcp(host:3306)/db?...
# 启动时据此 upsert 一个支付宝商户。把 enabled 改 true、填 app_id,密钥走环境变量。
# 沙箱信息:https://open.alipay.com/develop/sandbox/app
alipay_sandbox:
enabled: false
production: false # false=沙箱网关;true=正式网关(真钱)
merchant_code: "yanmei"
merchant_name: "岩美(北京)技术有限公司"
app_id: "" # 沙箱/生产 APPID
app_private_key: "" # 留空!走环境变量 ALIPAY_APP_PRIVATE_KEY
alipay_public_key: "" # 留空!走环境变量 ALIPAY_PUBLIC_KEY
# 启动时据此 upsert 一个微信商户(V3 Native 扫码)。微信无沙箱:enabled=true 即正式收款。
# 密钥严禁写进本文件!走环境变量(生产由 Bitwarden 经 rbw 灌入):
# WECHAT_MCH_PRIVATE_KEY(商户私钥 apiclient_key.pem / WECHAT_APIV3_KEYAPIv3 密钥)
wechat:
enabled: false
merchant_code: "yanmei-wx" # 与支付宝商户区分
merchant_name: "岩美(北京)技术有限公司"
mch_id: "" # 微信支付商户号(入驻后拿到)
app_id: "" # 绑定的 APPID
cert_serial: "" # 商户 API 证书序列号
private_key: "" # 留空!走环境变量 WECHAT_MCH_PRIVATE_KEY
apiv3_key: "" # 留空!走环境变量 WECHAT_APIV3_KEY
# 业务系统对接(通用)。任意业务系统在 biz.<name> 下加一段即可接入,无需改代码。
# 契约见 pay-contract 仓(OpenAPI + README)。业务方带签名下单 + 入账后 pay 回调其 webhook。
# 每个业务的 secret/callback 按约定走环境变量:BIZ_<NAME 大写>_SECRET / BIZ_<NAME 大写>_CALLBACK_URL
# 严禁写本文件(callback 可写这里,secret 一律走 env)。
biz:
jiu:
callback_url: "https://jiu.51yanmei.com/api/v1/pay/callback" # 支付成功回调 jiu 的接收器
secret: "" # 留空!走环境变量 BIZ_JIU_SECRET
# dudu: # 将来接入 dudu:加这段 + 设 BIZ_DUDU_SECRET
# callback_url: "https://.../api/v1/pay/callback"
# secret: ""
# 兜底主动查单:定时把待支付订单拿去查,防异步回调丢失
query_sync:
enabled: true
interval_sec: 30
max_age_min: 30