文件
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

39 行
671 B
Bash

NODE_ENV=development
PORT=3000
TENCENT_SECRET_ID=
TENCENT_SECRET_KEY=
TENCENT_REGION=ap-guangzhou
DB_HOST=
DB_PORT=3306
DB_USER=root
DB_PASSWORD=
DB_NAME=jw_beauty
COS_BUCKET=jw-bucket-1426323813
COS_REGION=ap-guangzhou
WECHAT_APPID=
WECHAT_SECRET=
JWT_SECRET=replace-with-a-long-random-secret
ADMIN_JWT_SECRET=replace-with-a-different-long-random-secret
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
CORS_ORIGIN=https://admin.vsai.net.cn
# WeChat Pay V3
WX_MCH_ID=
WX_MCH_API_V3_KEY=
WX_MCH_SERIAL_NO=
WX_MCH_PRIVATE_KEY=
WX_MCH_PRIVATE_KEY_PATH=
WX_PAY_NOTIFY_URL=https://api.vsai.net.cn/api/v1/payment/wechat/notify
DB_POOL_SIZE=10
COS_CDN_DOMAIN=tx.vsai.net.cn