This commit is contained in:
eric
2026-03-13 05:14:28 -05:00
parent f66859c032
commit 8a095f7d45
13 changed files with 820 additions and 132 deletions

View File

@@ -4,8 +4,7 @@ import { useState, useEffect, type FormEvent } from "react";
import { createPortal } from "react-dom";
import { useLocale } from "@/i18n/navigation";
import {
getRecommendedChannel,
mustUseWxPay,
getPayEnv,
redirectToPay,
getDeviceFromEnv,
} from "@/app/lib/payment";
@@ -71,8 +70,8 @@ export default function JoinModal({ isOpen, onClose, initialEmail = "", vipOnly
return;
}
const returnUrl = typeof window !== "undefined" ? `${window.location.origin}/${locale}/join/paid` : "/zh/join/paid";
const env: PayEnv = typeof window !== "undefined" ? (navigator.userAgent.includes("MicroMessenger") ? "wechat" : "pc") : "pc";
const channel: PayChannel = mustUseWxPay(env) ? "wxpay" : getRecommendedChannel(env);
const env = getPayEnv();
const channel: PayChannel = "wxpay";
redirectToPay({
user_id: data.user_id,
return_url: returnUrl,