client error fix
This commit is contained in:
parent
94883bd04d
commit
fec2c8c789
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { useState } from 'react';
|
||||
import { useAuth } from '../context/AuthContext';
|
||||
import { getStripe } from '../lib/stripe';
|
||||
import { getStripe } from '../lib/stripe-client';
|
||||
|
||||
interface PaymentModalProps {
|
||||
isOpen: boolean;
|
||||
|
|
|
|||
7
app/lib/stripe-client.ts
Normal file
7
app/lib/stripe-client.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { loadStripe } from '@stripe/stripe-js';
|
||||
|
||||
// Initialize Stripe on the client
|
||||
export const getStripe = () => {
|
||||
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
|
||||
return stripePromise;
|
||||
};
|
||||
|
|
@ -1,12 +1,5 @@
|
|||
import { loadStripe } from '@stripe/stripe-js';
|
||||
import { headers } from 'next/headers';
|
||||
|
||||
// Initialize Stripe on the client
|
||||
export const getStripe = () => {
|
||||
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
|
||||
return stripePromise;
|
||||
};
|
||||
|
||||
// Helper function to create a payment intent (server-side only)
|
||||
export async function createPaymentIntent(amount: number, currency: string = 'usd') {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user