This commit is contained in:
eric
2026-03-10 07:23:18 -05:00
parent a1696c2d0b
commit e9c6ec4d84
4 changed files with 100 additions and 34 deletions

View File

@@ -6,12 +6,7 @@ import { marked } from "marked";
import PocketBase from "pocketbase";
import { indexMd } from "./index-content";
import styles from "./index.module.css";
import {
getPayEnv,
getRecommendedChannel,
mustUseWxPay,
getDeviceFromEnv,
} from "@/app/lib/payEnv";
import { getPayEnv, getDeviceFromEnv } from "@/app/lib/payEnv";
import { usePayStatusPoll } from "@/app/lib/usePayStatusPoll";
const PB_URL =
@@ -152,14 +147,13 @@ export default function Home() {
const userId = getOrCreateUserId();
const returnUrl = `${window.location.origin}/paid`;
const env = getPayEnv();
const channel = mustUseWxPay(env) ? "wxpay" : getRecommendedChannel(env);
const device = getDeviceFromEnv(env);
redirectToPay({
user_id: userId,
return_url: returnUrl,
total_fee: 180,
total_fee: 8800,
type: "vip",
channel,
channel: "wxpay",
device,
});
}, [getOrCreateUserId]);