(async function () {
console.log("⏳ skysyncau용 결제 장기 링크를 생성하는 중...");
try {
const session = await fetch("/api/auth/session").then((r) => r.json());
if (!session.accessToken) {
throw new Error("토큰을 가져올 수 없습니다. ChatGPT에 로그인되어 있는지 확인하세요.");
}
const payload = {
plan_name: "chatgptteamplan",
team_plan_data: {
workspace_name: "myWorkspace",
price_interval: "month",
seat_quantity: 2 // 좌석 수 2개
},
billing_details: {
country: "US", // 국가 전용
currency: "USD" // 국가 달러(USD라고 적는 것이 더 적절함)
},
cancel_url: "https://chatgpt.com/?promoCode=THINK26",
promo_code: "THINK26",
checkout_ui_mode: "hosted"
};
const response = await fetch(
"https://chatgpt.com/backend-api/payments/checkout",
{
method: "POST",
headers: {
Authorization: Bearer ${session.accessToken},
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
const data = await response.json();
if (data.url) {
console.clear();
console.log(
"%c✅ skysyncau 할인 적용 장기 링크 생성 성공:",
"color: #10a37f; font-size: 22px; font-weight: bold;"
);
console.log(data.url);
console.log(
"\n%c이 링크를 직접 열면 → 2석 기준 AU$25(48개월 고정) 호주 할인 가격이 표시될 수 있습니다.",
"color: gray; font-size: 16px;"
);
} else {
console.error("❌ 생성 실패. 응답 내용:", data);
}
} catch (e) {
console.error("❌ 실행 중 오류 발생:", e);
}
})();