#HarryET-vue
1 messages ยท Page 1 of 1 (latest)
Nope ๐ฆ
is it window.stripe vs window.Stripe? ๐ค
oh no sorry that is a typo, as I have a constant file
and I have tried logging stripe to ensure it has the function and it does
when I add logs before and after the call to confirmPayment it runs the one before but nothing after
can you log out the high level stripe object that you're storing on window?
This one? window.stripe
Here is both the logged output and the weird error
hmm let me think
Yeah got me too! Nothing like it in the docs, going to try accessing the site through ngrok to see if https helps
Okay even a production build doesn't help ๐ฆ
Unlikely but are you seeing any attempts made to confirm the PaymentIntent on your Stripe dashboard?
Where should I be looking on the dashboard?
what do you see when you print out elms.value.elements ?
Will do that now
@young lynx
and the element renders just fine?
takes a seccond to load but then sure it works
here is the actual code for that:
<template>
<div>
<div class="space-y-5">
<p class="text-sm text-gray-500">
Since you haven't setup a payment method before, you need to add one to
your swift account now before we can let you sign in. This can be
changed in the future through the billing portal and won't be charged
till after the 14 day free trial!
</p>
<form @submit="paymentSubmit" class="space-y-5">
<div
v-if="!data && !error"
class="bg-white flex space-x-2 p-5 rounded-full justify-center items-center"
>
<div
class="bg-brand-600 p-2 w-4 h-4 rounded-full animate-bounce animation-delay-100"
></div>
<div
class="bg-brand-600 p-2 w-4 h-4 rounded-full animate-bounce animation-delay-200"
></div>
<div
class="bg-brand-600 p-2 w-4 h-4 rounded-full animate-bounce animation-delay-300"
></div>
</div>
<div v-if="!data && error"></div>
<StripeElements
v-if="data && !error"
v-slot="{ elements }"
ref="elms"
:stripe-key="STRIPE_PK"
:instance-options="ref({})"
:elements-options="
ref({
clientSecret: data.data.clientSecret,
})
"
>
<StripeElement
type="payment"
ref="payment"
:elements="elements"
:options="ref({})"
/>
</StripeElements>
<button
type="submit"
class="inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-brand-600 text-base font-medium text-white hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500 sm:text-sm"
>
Start Free Trial
</button>
</form>
</div>
</div>
</template>
are you using any third party packages for StripeElements or is this a component you've written that uses Stripe.js functions underneath?
Its a third party package, as there are no officially ones for vue3
OMG, I am an idiot ๐
What was it? ๐
That library creates its own stripe instace which it uses
and gives you access to
so it should be:
const { error } = await elms.value.instance.confirmPayment({
elements: elms.value.elements,
confirmParams: {
return_url: "http://localhost:3000/login/stripe/return",
},
});
I'll make an issue maybe to that package to make that clearer there, but a quick question any reason stripe dosen't have a Vue3 package and only has official react ones
yup! I had a theory that I was going to write a long essay about here ๐
Glad you figured it out
Sorry to waste your time ๐
All good ๐ Happy to help
Good luck