有个gpt team埃及的码

roy 2026-08-21 11:00 1

有需要的话说下 1150egp大概是22.7 usd吧 提取长链接代码


(async function generateAUTeamLink() {
// ================= 配置项 =================
const WORKSPACE_NAME = "xxx";
const COUPON = "XXXXXXXXXXXX"; // 优惠码
const EXISTING_WORKSPACE_ID = ""; // 留空则新建空间
const SEAT_QUANTITY = 2; // 席位数量(Team 最少 2 个)
const AUTO_OPEN_CHECKOUT = false;
// ==========================================

if (window.location.origin !== "https://chatgpt.com") {
throw new Error(`请在 https://chatgpt.com 页面执行脚本,当前来源为 ${window.location.origin}`);
}

console.log("⏳ 正在获取 ChatGPT Session Token...");

// 1. 自动获取登录凭证
let accessToken;
try {
const s = await fetch("/api/auth/session", { credentials: "include" }).then(r => r.json());
accessToken = s?.accessToken;
if (!accessToken) throw new Error("accessToken 为空,请确认已登录 ChatGPT 账号");
const currentAccount = s.account || {};
const currentPlan = currentAccount.planType || currentAccount.plan_type;
const currentStructure = currentAccount.structure;
if (currentPlan !== "free" || currentStructure !== "personal") {
throw new Error("当前选中的不是 Personal/Free 个人账户,请先切换个人账户后重试");
}
} catch (e) {
console.error("❌ 获取 Token 失败:", e.message);
return;
}
console.log("✅ Token 获取成功");

// 2. 构建请求 Payload
const payload = {
plan_name: "chatgptteamplan",
team_plan_data: {
workspace_name: WORKSPACE_NAME,
price_interval: "month", // month 或 year
seat_quantity: SEAT_QUANTITY,
...(EXISTING_WORKSPACE_ID ? { existing_workspace_id: EXISTING_WORKSPACE_ID } : {})
},
billing_details: {
country: "EG",
currency: "EGP"
},
cancel_url: "https://chatgpt.com/?promoCode=XXXXXXXXXXXX",
promo_code: COUPON,
checkout_ui_mode: "hosted"
};

// 3. 请求 Stripe 长链接
console.log("⏳ 正在请求 Stripe 支付长链接...");
try {
const resp = await fetch(
"/backend-api/payments/checkout",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json"
},
credentials: "same-origin",
body: JSON.stringify(payload)
}
);
const data = await resp.json();

if (!resp.ok) {
console.error(`❌ 请求失败 HTTP ${resp.status}`);
console.log("📋 响应详情:", data);
return;
}

const hostedUrl = data?.url || data?.stripe_hosted_url || data?.checkout_url;
if (!hostedUrl) {
console.warn("⚠️ 未找到长链接,原始响应:", data);
return;
}
const checkoutUrl = new URL(hostedUrl);
if (checkoutUrl.protocol !== "https:") {
throw new Error("服务端返回了无效的支付链接");
}

// 4. 打印结果
console.log("─".repeat(60));
console.log("✅ ChatGPT Team 链接生成成功!");
console.log(`📌 工作区名称 : ${payload.team_plan_data.workspace_name}`);
console.log(`💺 席位数量 : ${payload.team_plan_data.seat_quantity}`);
console.log(`🎟️ 优惠码 : ${COUPON}`);
console.log(`🌍 地区/货币 : ${payload.billing_details.country} (${payload.billing_details.currency})`);
if (data.checkout_session_id) {
console.log(`🆔 Session ID : ${data.checkout_session_id}`);
}
console.log("─".repeat(60));
console.log("🔗 Stripe 支付长链接(复制到浏览器打开):");
console.log(checkoutUrl.href);
console.log("─".repeat(60));
if (AUTO_OPEN_CHECKOUT) {
window.open(checkoutUrl.href, "_blank", "noopener,noreferrer");
}
} catch (e) {
console.error("❌ 网络异常或请求失败:", e.message);
}
})();
最新回复 (3)
  • xiaojudy 08-21 12:00
    1

    付完23刀的样子

  • YAIBIWAIBY 08-21 12:02
    2

    别人埃及好像20人的车很便宜啊 为什么2人不便宜?

  • tf2026 08-21 12:34
    3

    感谢分享!

* 帖子来源NodeSeek
返回