diff --git a/src/app/api/demo-payment/route.ts b/src/app/api/demo-payment/route.ts index ab84e80c7..3ed7c7fb9 100644 --- a/src/app/api/demo-payment/route.ts +++ b/src/app/api/demo-payment/route.ts @@ -1,9 +1,10 @@ +import { DEMO_PAYMENT_GATEWAY } from "@/checkout/sections/PaymentSection/Demo/PaymentOptions"; + const removeWhiteSpace = (str: string): string => { return str.replaceAll(/[\t\n]+/g, " "); }; const url = `https://${process.env.VERCEL_BRANCH_URL}`; -export const DEMO_PAYMENT_GATEWAY = `storefront.demo-payment`; export async function GET() { return Response.json({ diff --git a/src/checkout/sections/PaymentSection/Demo/PaymentOptions.tsx b/src/checkout/sections/PaymentSection/Demo/PaymentOptions.tsx index 7c2efb35f..f41819c2e 100644 --- a/src/checkout/sections/PaymentSection/Demo/PaymentOptions.tsx +++ b/src/checkout/sections/PaymentSection/Demo/PaymentOptions.tsx @@ -7,7 +7,8 @@ import { useCheckoutCompleteMutation, useTransactionInitializeMutation } from "@ import { useCheckout } from "@/checkout/hooks/useCheckout"; import { replaceUrl } from "@/checkout/lib/utils/url"; import { Button } from "@/checkout/components"; -import { DEMO_PAYMENT_GATEWAY } from "@/app/api/demo-payment/route"; + +export const DEMO_PAYMENT_GATEWAY = `storefront.demo-payment`; export const DemoPayment = () => { const { checkout } = useCheckout(); diff --git a/src/checkout/sections/PaymentSection/usePaymentGatewaysInitialize.ts b/src/checkout/sections/PaymentSection/usePaymentGatewaysInitialize.ts index 58a5c139c..41257a5d9 100644 --- a/src/checkout/sections/PaymentSection/usePaymentGatewaysInitialize.ts +++ b/src/checkout/sections/PaymentSection/usePaymentGatewaysInitialize.ts @@ -4,7 +4,7 @@ import { useCheckout } from "@/checkout/hooks/useCheckout"; import { useSubmit } from "@/checkout/hooks/useSubmit"; import { type MightNotExist } from "@/checkout/lib/globalTypes"; import { type ParsedPaymentGateways } from "@/checkout/sections/PaymentSection/types"; -import { DEMO_PAYMENT_GATEWAY } from "@/app/api/demo-payment/route"; +import { DEMO_PAYMENT_GATEWAY } from "@/checkout/sections/PaymentSection/Demo/PaymentOptions"; export const usePaymentGatewaysInitialize = () => { const {