File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 22 <form @submit.prevent =" handlePay" >
33 <StripeElements
44 v-if =" stripeLoaded"
5+ class =" py-3"
56 :stripe-key =" publishableKey"
67 :instance-options =" instanceOptions"
78 :elements-options =" elementsOptions"
89 ref =" elementsComponent"
9- class =" py-3"
1010 >
1111 <StripeElement
1212 type =" card"
2525<script setup lang="ts">
2626import { loadStripe } from " @stripe/stripe-js"
2727import type {
28+ StripeCardElement ,
2829 StripeCardElementOptions ,
2930 StripeConstructorOptions ,
3031 StripeElementsOptions ,
@@ -62,7 +63,7 @@ function handlePay() {
6263 // You need to implement backend for creating PaymentIntent
6364 // Learn more by reading https://docs.stripe.com/payments/card-element?lang=node
6465 const stripeInstance = elementsComponent .value ?.instance
65- const card = cardComponent .value ?.stripeElement
66+ const card = cardComponent .value ?.stripeElement as StripeCardElement
6667
6768 // Let's skip to the point you got clientSecret
6869 const clientSecret = " i_was_created_on_server"
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ const expressCheckoutComponent = useTemplateRef("expressCheckoutComponent")
5252
5353const handleSomething = () => {
5454 const stripeInstance = elementsComponent .value ?.instance
55- const expressCheckout: StripeExpressCheckoutElement =
56- expressCheckoutComponent . value ?.stripeElement
55+ const expressCheckout = expressCheckoutComponent . value
56+ ?.stripeElement as StripeExpressCheckoutElement
5757
5858 // do advanced stuff ...
5959}
You can’t perform that action at this time.
0 commit comments