switched to paddle inline checkout, removed paypal and most of stripe. added product sync between app and paddle.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { Head, usePage } from "@inertiajs/react";
|
||||
import MarketingLayout from "@/layouts/mainWebsite";
|
||||
import type { CheckoutPackage } from "./checkout/types";
|
||||
import type { CheckoutPackage, GoogleProfilePrefill } from "./checkout/types";
|
||||
import { CheckoutWizard } from "./checkout/CheckoutWizard";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { X } from "lucide-react";
|
||||
@@ -9,20 +9,28 @@ import { X } from "lucide-react";
|
||||
interface CheckoutWizardPageProps {
|
||||
package: CheckoutPackage;
|
||||
packageOptions: CheckoutPackage[];
|
||||
stripePublishableKey: string;
|
||||
paypalClientId: string;
|
||||
privacyHtml: string;
|
||||
googleAuth?: {
|
||||
status?: string | null;
|
||||
error?: string | null;
|
||||
profile?: GoogleProfilePrefill | null;
|
||||
};
|
||||
paddle?: {
|
||||
environment?: string | null;
|
||||
client_token?: string | null;
|
||||
};
|
||||
}
|
||||
|
||||
export default function CheckoutWizardPage({
|
||||
package: initialPackage,
|
||||
packageOptions,
|
||||
stripePublishableKey,
|
||||
paypalClientId,
|
||||
privacyHtml,
|
||||
googleAuth,
|
||||
paddle,
|
||||
}: CheckoutWizardPageProps) {
|
||||
const page = usePage<{ auth?: { user?: { id: number; email: string; name?: string; pending_purchase?: boolean } | null } }>();
|
||||
const currentUser = page.props.auth?.user ?? null;
|
||||
const googleProfile = googleAuth?.profile ?? null;
|
||||
|
||||
|
||||
const dedupedOptions = React.useMemo(() => {
|
||||
@@ -58,10 +66,10 @@ export default function CheckoutWizardPage({
|
||||
<CheckoutWizard
|
||||
initialPackage={initialPackage}
|
||||
packageOptions={dedupedOptions}
|
||||
stripePublishableKey={stripePublishableKey}
|
||||
paypalClientId={paypalClientId}
|
||||
privacyHtml={privacyHtml}
|
||||
initialAuthUser={currentUser ? { id: currentUser.id, email: currentUser.email ?? '', name: currentUser.name ?? undefined, pending_purchase: Boolean(currentUser.pending_purchase) } : null}
|
||||
googleProfile={googleProfile}
|
||||
paddle={paddle ?? null}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user