feat: Complete checkout overhaul with Stripe PaymentIntent integration and abandoned cart recovery
This commit is contained in:
@@ -8,14 +8,19 @@ import AppLayout from './Components/Layout/AppLayout';
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import i18n from './i18n';
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
import { Elements } from '@stripe/react-stripe-js';
|
||||
import { loadStripe } from '@stripe/stripe-js';
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
||||
|
||||
// Initialize Stripe
|
||||
const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLISHABLE_KEY || '');
|
||||
|
||||
createInertiaApp({
|
||||
title: (title) => title ? `${title} - ${appName}` : appName,
|
||||
resolve: (name) => resolvePageComponent(
|
||||
`./Pages/${name}.tsx`,
|
||||
import.meta.glob('./Pages/**/*.tsx')
|
||||
`./pages/${name}.tsx`,
|
||||
import.meta.glob('./pages/**/*.tsx')
|
||||
).then((page) => {
|
||||
if (page) {
|
||||
const PageComponent = (page as any).default;
|
||||
@@ -36,10 +41,12 @@ createInertiaApp({
|
||||
}
|
||||
|
||||
root.render(
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<App {...props} />
|
||||
<Toaster position="top-right" toastOptions={{ duration: 4000 }} />
|
||||
</I18nextProvider>
|
||||
<Elements stripe={stripePromise}>
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<App {...props} />
|
||||
<Toaster position="top-right" toastOptions={{ duration: 4000 }} />
|
||||
</I18nextProvider>
|
||||
</Elements>
|
||||
);
|
||||
},
|
||||
progress: {
|
||||
|
||||
Reference in New Issue
Block a user