From 74b50f120bef9a9e963c1e5773785b9125275449 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 4 Jan 2026 21:44:05 -0600 Subject: [PATCH] feat(client): refine payment handling and improve type safety in components --- src/GroundsForSupport.Client/src/App.tsx | 4 ++-- .../src/CheckoutForm.tsx | 2 +- .../src/PaymentConfirmationCard.tsx | 18 ++++++++-------- .../src/PaymentForm.tsx | 6 +++--- .../src/PreviousPaymentsList.tsx | 18 ++++++++-------- src/GroundsForSupport.Client/src/index.css | 21 ++++++++++--------- .../tests/App.spec.tsx | 11 +++++----- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/GroundsForSupport.Client/src/App.tsx b/src/GroundsForSupport.Client/src/App.tsx index ac4a4b0..ab3e419 100644 --- a/src/GroundsForSupport.Client/src/App.tsx +++ b/src/GroundsForSupport.Client/src/App.tsx @@ -7,7 +7,7 @@ import PaymentForm from './PaymentForm'; import PaymentConfirmationCard from './PaymentConfirmationCard'; import PreviousPaymentsList from './PreviousPaymentsList'; -const stripe = loadStripe(import.meta.env.VITE_STRIPE_API_KEY); +const stripe = loadStripe(import.meta.env.VITE_STRIPE_API_KEY as string); function App() { const queryParams = new URLSearchParams(window.location.search); @@ -44,7 +44,7 @@ function App() { return; } - const data = await res.json(); + const data = await res.json() as { clientSecret: string }; setSecret(data.clientSecret); } catch (err) { console.error(err); diff --git a/src/GroundsForSupport.Client/src/CheckoutForm.tsx b/src/GroundsForSupport.Client/src/CheckoutForm.tsx index 6e7cac6..245a8f4 100644 --- a/src/GroundsForSupport.Client/src/CheckoutForm.tsx +++ b/src/GroundsForSupport.Client/src/CheckoutForm.tsx @@ -32,7 +32,7 @@ export default function CheckoutForm() { } return ( -