import InputError from '@/components/input-error'; import LoadingButton from '@/components/loading-button'; import Switch from '@/components/switch'; import { Card } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { onHandleChange } from '@/lib/inertia'; import { useForm } from '@inertiajs/react'; interface StripeProps { payment: Settings; } const Stripe = ({ payment }: StripeProps) => { const { data, setData, post, errors, processing } = useForm({ ...(payment.fields as StripeFields), type: 'stripe', }); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); post(route('payouts.settings.update')); }; return (

Stripe Settings

Configure Stripe payment gateway

setData('active', checked)} />
Test Mode: setData('test_mode', checked)} />
{/* Test Mode Credentials Section */}

Test Credentials

onHandleChange(e, setData)} placeholder="Enter test public key" disabled={!data.test_mode} />
onHandleChange(e, setData)} placeholder="Enter test secret key" disabled={!data.test_mode} type="password" />
{/* Live Mode Credentials Section */}

Live Credentials

onHandleChange(e, setData)} placeholder="Enter live public key" disabled={data.test_mode} />
onHandleChange(e, setData)} placeholder="Enter live secret key" disabled={data.test_mode} type="password" />
{/* Webhook Secret Section */}

Webhook Settings

onHandleChange(e, setData)} placeholder="Enter webhook secret" type="password" />

Webhooks are used to handle events from Stripe like successful payments

{data.active ? 'Stripe is currently enabled' : 'Stripe is currently disabled'}
Save Changes
); }; export default Stripe;