MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / syncBindCardTask

Function syncBindCardTask

static/js/payment.js:2797–2818  ·  view source on GitHub ↗
(taskId)

Source from the content-addressed store, hash-verified

2795}
2796
2797async function syncBindCardTask(taskId) {
2798 try {
2799 const data = await api.post(`/payment/bind-card/tasks/${taskId}/sync-subscription`, {}, {
2800 timeoutMs: 60000,
2801 retry: 0,
2802 });
2803 const sub = String(data?.subscription_type || "free").toUpperCase();
2804 const source = String(data?.detail?.source || "unknown");
2805 const confidence = String(data?.detail?.confidence || "unknown");
2806 const note = String(data?.detail?.note || "");
2807 const suffix = note ? `, note=${note}` : "";
2808 const msg = `同步完成: ${sub} (source=${source}, confidence=${confidence}${suffix})`;
2809 if (sub === "PLUS" || sub === "TEAM") {
2810 toast.success(msg);
2811 } else {
2812 toast.warning(msg, 7000);
2813 }
2814 await loadBindCardTasks();
2815 } catch (e) {
2816 toast.error(`同步订阅失败: ${formatErrorMessage(e)}`);
2817 }
2818}
2819
2820async function deleteBindCardTask(taskId) {
2821 const ok = await confirm(`确认删除绑卡任务 #${taskId} 吗?`, "删除任务");

Callers

nothing calls this directly

Calls 6

loadBindCardTasksFunction · 0.85
formatErrorMessageFunction · 0.85
successMethod · 0.80
warningMethod · 0.80
errorMethod · 0.80
postMethod · 0.45

Tested by

no test coverage detected