From 94f23489856176be1137813578180f022d07144e Mon Sep 17 00:00:00 2001 From: ajay-sentry <159853603+ajay-sentry@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:54:03 -0700 Subject: [PATCH] feat: Update Edit Payment Card Component to use Stripe Card Element (#2911) --- .../EmailAddress/EmailAddress.tsx | 1 - .../PaymentCard/CreditCardForm.jsx | 44 ++++++++----------- .../PaymentCard/PaymentCard.spec.jsx | 6 +-- src/ui/TextInput/TextInput.tsx | 3 +- 4 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/EmailAddress/EmailAddress.tsx b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/EmailAddress/EmailAddress.tsx index 27382d42bd..994d8033cd 100644 --- a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/EmailAddress/EmailAddress.tsx +++ b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/EmailAddress/EmailAddress.tsx @@ -79,7 +79,6 @@ function EmailAddress() { placeholder="Your email" disabled={isLoading} {...register('newCustomerEmail', { required: true })} - variant="billing" /> {errors?.newCustomerEmail && (
diff --git a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/CreditCardForm.jsx b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/CreditCardForm.jsx index 212ba401b3..b41522c04a 100644 --- a/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/CreditCardForm.jsx +++ b/src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/CreditCardForm.jsx @@ -1,9 +1,4 @@ -import { - CardCvcElement, - CardExpiryElement, - CardNumberElement, - useElements, -} from '@stripe/react-stripe-js' +import { CardElement, useElements } from '@stripe/react-stripe-js' import cs from 'classnames' import PropTypes from 'prop-types' @@ -24,34 +19,31 @@ function CreditCardForm({ closeForm, provider, owner }) { function submit(e) { e.preventDefault() - updateCard(elements.getElement(CardNumberElement), { + updateCard(elements.getElement(CardElement), { onSuccess: closeForm, }) } - const inputClass = 'bg-ds-gray-primary py-3 px-4 rounded ' const resetError = error && reset return (