@@ -56,42 +56,27 @@ async function subscribePlan() {
56
56
body: JSON .stringify (body ),
57
57
})
58
58
59
- const client = await response .json ()
59
+ const client: any = await response .json ()
60
60
61
- console . log ( client )
61
+ const clientSecret = client . client_secret
62
62
63
63
stripe = await loadStripe (publishableKey )
64
64
65
- // if (stripe) {
66
- // elements = stripe.elements({clientSecret});
67
- // const paymentElement = elements.create('payment');
65
+ if (stripe ) {
66
+ elements = stripe .elements ({clientSecret });
67
+ const paymentElement = elements .create (' payment' );
68
68
69
- // paymentElement.mount("#payment-element");
70
- // const linkAuthenticationElement = elements.create("linkAuthentication");
71
- // linkAuthenticationElement.mount("#link-authentication-element");
69
+ paymentElement .mount (" #payment-element" );
70
+ const linkAuthenticationElement = elements .create (" linkAuthentication" );
71
+ linkAuthenticationElement .mount (" #link-authentication-element" );
72
+ }
72
73
73
- // }
74
+ loading . value = false
74
75
}
75
76
</script >
76
77
77
78
<template >
78
- <div class =" flex space-x-4" >
79
- <div v-show =" !loading" class =" w-2/3 rounded-md bg-white px-8 py-6 shadow-md" >
80
- <form id =" payment-form" >
81
- <div id =" link-authentication-element" >
82
- <!-- Stripe.js injects the Link Authentication Element -->
83
- </div >
84
- <div id =" payment-element" >
85
- <!-- Stripe.js injects the Payment Element -->
86
- </div >
87
- <button id =" submit" class =" primary-button" >
88
- <div id =" spinner" class =" spinner hidden" />
89
- <span id =" button-text" >Pay now</span >
90
- </button >
91
- <div id =" payment-message" class =" hidden" />
92
- </form >
93
- </div >
94
- </div >
79
+
95
80
96
81
<div class =" mx-auto px-4 py-8 container lg:px-8" >
97
82
<div class =" flex justify-center" >
@@ -113,6 +98,23 @@ async function subscribePlan() {
113
98
</p >
114
99
</div >
115
100
101
+ <div v-show =" !loading" class =" w-2/3 rounded-md bg-white px-8 py-6 shadow-md" >
102
+ <form id =" payment-form" >
103
+ <div id =" link-authentication-element" >
104
+ <!-- Stripe.js injects the Link Authentication Element -->
105
+ </div >
106
+ <div id =" payment-element" >
107
+ <!-- Stripe.js injects the Payment Element -->
108
+ </div >
109
+ <button id =" submit" class =" primary-button" >
110
+ <div id =" spinner" class =" spinner hidden" />
111
+ <span id =" button-text" >Pay now</span >
112
+ </button >
113
+ <div id =" payment-message" class =" hidden" />
114
+ </form >
115
+ </div >
116
+
117
+ <div v-if =" loading" >
116
118
<div class =" pt-8" >
117
119
<div class =" flex justify-center" >
118
120
<fieldset aria-label =" Payment frequency" >
@@ -165,7 +167,7 @@ async function subscribePlan() {
165
167
<span class =" text-gray-900 font-medium" >Pro</span >
166
168
167
169
<p class =" pt-2 text-xs text-gray-600" >
168
- All Stacks features are included & being able to add team members.
170
+ All Stacks features are included & being able to invite team members.
169
171
</p >
170
172
</span >
171
173
</span >
@@ -188,6 +190,8 @@ async function subscribePlan() {
188
190
Subscribe
189
191
</button >
190
192
</div >
193
+
194
+ </div >
191
195
</div >
192
196
</div >
193
197
</div >
0 commit comments