Files
gitlab-instance-0a899031_sa…/手机微信支付调试说明.md
2026-03-15 19:12:12 -05:00

45 lines
1.4 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.
# 手机微信支付调试说明
前端vipgroup 等)与 payjsapi 同机时,支付请求由服务端发起,应使用 `127.0.0.1:8700`
## 1. 同机部署vipgroup + payjsapi 都在本机)
**无需配置**。默认使用 `http://127.0.0.1:8700`
`.env.local` 中有 `PAYMENT_API_URL=http://0.0.0.0:8700`,请删除或改为:
```bash
PAYMENT_API_URL=http://127.0.0.1:8700
```
0.0.0.0 无法作为连接目标,会导致立即失败)
## 2. 确认 payjsapi 已启动
```bash
cd C:\project\payjsapi
python run.py
```
应监听 `0.0.0.0:8700`,可从局域网访问。
## 3. 确认防火墙放行 8700 端口
Windows 防火墙可能阻止手机访问 8700。若 vipgroup 与 payjsapi 同机,请求是服务端内部调用,一般无问题。
## 4. 查看控制台日志
支付失败时vipgroup 的 Next.js 控制台会输出:
```
[pay] 请求失败: ... apiUrl: http://xxx:8700 requestHost: xxx
```
-`apiUrl``http://0.0.0.0:8700` → 在 `.env.local` 中设置 `PAYMENT_API_URL=http://192.168.41.222:8700`
-`apiUrl` 正确但仍失败 → 检查 payjsapi 是否运行、网络是否可达
## 5. vipgroup 需包含的配置逻辑
若 vipgroup 与 lms/nomadlms 结构不同,需确保:
1. 调用 `/api/pay` 或直接调用 payjsapi 时,使用正确的 `PAYMENT_API_URL`
2. 本地开发时 `PAYMENT_API_URL` 指向 `http://{你的局域网IP}:8700`