s''
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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(() => ({}));
|
||||
|
||||
Reference in New Issue
Block a user