401c24d15d
原实现只清 openid,reviewing 单的退款推迟到管理员审核打款(execute_withdraw_transfer 回读空 openid)才触发——用户解绑后后台仍挂单、现金不即时退回。改为 force 解绑时直接对 所有 reviewing 单走 _refund_withdraw 立即退回现金 + 置终态(新增 refund_reviewing_ withdraws_on_unbind),让提示文案名副其实、后台不再挂死单。_refund_withdraw 加可选 remark 自定义流水文案。同步 docs/api。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.8 KiB
1.8 KiB
POST /api/v1/wallet/unbind-wechat — 解绑微信(清空 openid)
所属:Wallet 组(前缀
/api/v1/wallet) | 鉴权:Bearer | ← 返回 API 索引集成实现:见 integrations/wxpay。
入参
请求体 UnbindWechatRequest(可选:旧客户端可不带 body,等价 force=false):
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
force |
bool | false |
跳过「有待审核提现」二次确认,强制解绑。首次解绑传 false;命中 needs_confirm 后用户确认,再带 true 调一次才真解绑 |
出参
响应 200:UnbindWechatResultOut
| 字段 | 类型 | 说明 |
|---|---|---|
bound |
bool | 解绑成功为 false;命中二次确认(本次未解绑)时为当前真实绑定态(通常 true) |
needs_confirm |
bool | true = 有待审核提现且未 force,本次未解绑,客户端应弹确认弹窗 |
message |
string | null | needs_confirm=true 时的提示文案,直接展示给用户 |
说明
清空当前用户的 wechat_openid / wechat_nickname / wechat_avatar_url。幂等:未绑定时调用也返回 bound=false。解绑后该微信可被其他账号绑定。
有待审核提现时的二次确认:用户有 reviewing(待审核)状态的提现单且未带 force=true 时,首次解绑被拦下——不清 openid,返回 bound(真实绑定态)+ needs_confirm=true + message。客户端据此弹确认弹窗,用户确认后带 force=true 再调一次即放行解绑。
只拦
reviewing:这类单还没打款,用户确认解绑(force=true)时立即退回现金余额(写withdraw_refund流水、单子置终态),后台不再挂单、不必等管理员审核。pending(打款在途)单转账已发起、解绑影响不到、照常打款到微信,故不拦。