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

@@ -5,8 +5,7 @@ import { Link, useLocale } from "@/i18n/navigation";
import { useTranslation } from "@/i18n/navigation";
import JoinModal from "./JoinModal";
import {
getRecommendedChannel,
mustUseWxPay,
getPayEnv,
redirectToPay,
getDeviceFromEnv,
} from "@/app/lib/payment";
@@ -149,13 +148,8 @@ export default function HeroSection() {
}
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,
return_url: returnUrl,