#Skonchy - this.stripe.elements is not a function

1 messages · Page 1 of 1 (latest)

deft dagger
#

Can you largely make other stripe calls on that page?

#

Or when stripe.js is included like that?

small elm
#

So I'm still pretty early in the guide and haven't really made any other calls but when I just look at the stripe object printed into the console I see the other properties such as prices etc.

deft dagger
#

Can you send me the doc you are looking at? Want to make sure I am on the same page

small elm
#

What I've gotten to is after setting up the form, connecting Elements to have the card-entry element

deft dagger
#

Not immediately spotting what this is. Can you send more of your client side stripe code here so I can take a look at it?

small elm
#

sure can I embed in this channel or would you prefer me upload screenshots to imgur or something

#

StripeJS attached in the entry point

#

Object created in data of Vue component

#

I re-initialize it at each point through the lifecycle since I wasn't initially sure if it was a lifecycle issue or not

#

Template is a basic form with the placeholder divs for elements near the bottom of the form. StripeJS attached again to make sure it was being ran before the template, regardless of the attachment at the entry point

#

Anything else on the client you want to see?

#

Thats pretty well it 😛

deft dagger
#

I think I see an issue in your third snippet.

#

try var card = stripe.elements().create('card');

#

Typically in our sample we have it broken out in to its own variable

var elements = stripe.elements();
var cardElement = elements.create('card');```
#

But I think you need to call it on the result of the function

small elm
#

yeah breaking it up like that still gives me the "this.stripe.elements is not a function"

deft dagger
#

Interesting. I will reach out to my colleagues who may be more well versed in Vue to see if they have an idea of why that isn't defined there

deft dagger
#

It looks like we don't have an officially way to get elements to work as a Vue component documented.

small elm
#

No worries I'll take a look at Vue Stripe and hopefully it fixes my issue haha. Thanks so much!