This commit is contained in:
eric
2026-06-06 04:29:46 -05:00
parent 88aa96a2a1
commit 41493c35ca
50 changed files with 4666 additions and 416 deletions

View File

@@ -4,6 +4,7 @@
import { getPaymentConfig, getJoinPaymentConfig } from "@/config/services.config";
import type { PayChannel, PayEnv } from "./types";
import { apiUrl } from "@/app/lib/api-client";
export function redirectToPay(params: {
user_id: string;
@@ -21,7 +22,7 @@ export function redirectToPay(params: {
const payForm = document.createElement("form");
payForm.method = "POST";
payForm.action = "/api/pay";
payForm.action = apiUrl("/api/pay");
payForm.target = "_self";
payForm.style.display = "none";

View File

@@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { apiUrl } from "@/app/lib/api-client";
const COOKIE_NAME = "join_pay_order";
const STORAGE_NAME = "join_pay_order";
@@ -121,7 +122,7 @@ export function usePayStatusPoll(onPaid: (orderId: string) => void): boolean {
inFlight = true;
try {
const res = await fetch(
`/api/pay/status?order_id=${encodeURIComponent(orderId)}`,
apiUrl(`/api/pay/status?order_id=${encodeURIComponent(orderId)}`),
{ cache: "no-store" }
);
const data = await res.json().catch(() => ({}));