feat(billing): guide parents to recharge the child account

This commit is contained in:
brother7 committed 2026-10-09 08:43:05 +08:00
1 parent fe1a3775c5
commit 281e6dc151
10 files changed
+105 -14

No files matched your search

+1 -1
View File
@@ -178,7 +178,7 @@ export async function handleWorksBillingRoutes(req: IncomingMessage, res: Server
if (!response.ok) {
const detail = record(payload).detail;
const rejection = detail && typeof detail === 'object' && record(detail).outcome === 'definitive_rejection';
const messages: Record<number, string> = { 401: '登录已失效,请重新登录。', 403: '当前账户不能充值,请联系家长。', 404: '充值档位或订单已不可用,请刷新。', 409: '请先完成或核查已有充值订单;计费服务也可能正在切换。', 410: '账户服务版本不匹配,请更新客户端和服务端。' };
const messages: Record<number, string> = { 401: '登录已失效,请重新登录。', 403: '当前账号暂不能充值,请在社区账户页查看原因或联系支持。', 404: '充值档位或订单已不可用,请刷新。', 409: '请先完成或核查已有充值订单;计费服务也可能正在切换。', 410: '账户服务版本不匹配,请更新客户端和服务端。' };
sendJson(res, response.status >= 400 && response.status < 500 ? response.status : 502, {
success: false, error: rejection ? '支付服务拒绝了本次请求,请稍后重试。' : messages[response.status] ?? '支付结果尚未确认,请刷新订单或联系运营核查,勿重复付款。',
commandOutcome: rejection || [401, 403, 404, 422].includes(response.status) ? 'definitive_failure' : 'unknown',