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 2
2
<form @submit.prevent =" handlePay" >
3
3
<StripeElements
4
4
v-if =" stripeLoaded"
5
+ class =" py-3"
5
6
:stripe-key =" publishableKey"
6
7
:instance-options =" instanceOptions"
7
8
:elements-options =" elementsOptions"
8
9
ref =" elementsComponent"
9
- class =" py-3"
10
10
>
11
11
<StripeElement
12
12
type =" card"
25
25
<script setup lang="ts">
26
26
import { loadStripe } from " @stripe/stripe-js"
27
27
import type {
28
+ StripeCardElement ,
28
29
StripeCardElementOptions ,
29
30
StripeConstructorOptions ,
30
31
StripeElementsOptions ,
@@ -62,7 +63,7 @@ function handlePay() {
62
63
// You need to implement backend for creating PaymentIntent
63
64
// Learn more by reading https://docs.stripe.com/payments/card-element?lang=node
64
65
const stripeInstance = elementsComponent .value ?.instance
65
- const card = cardComponent .value ?.stripeElement
66
+ const card = cardComponent .value ?.stripeElement as StripeCardElement
66
67
67
68
// Let's skip to the point you got clientSecret
68
69
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")
52
52
53
53
const handleSomething = () => {
54
54
const stripeInstance = elementsComponent .value ?.instance
55
- const expressCheckout: StripeExpressCheckoutElement =
56
- expressCheckoutComponent . value ?.stripeElement
55
+ const expressCheckout = expressCheckoutComponent . value
56
+ ?.stripeElement as StripeExpressCheckoutElement
57
57
58
58
// do advanced stuff ...
59
59
}
You can’t perform that action at this time.
0 commit comments