Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error when adding a card with options #2

Closed
csbszb opened this issue Jan 13, 2021 · 1 comment
Closed

Type error when adding a card with options #2

csbszb opened this issue Jan 13, 2021 · 1 comment

Comments

@csbszb
Copy link

csbszb commented Jan 13, 2021

Hey @frandiox,

Thanks for this wrapper, it's very helpful!

I had an issue when I wanted to add a card element with custom options following your example:

const {
      stripe,
      elements: [cardElement],
    } = useStripe({
      key: process.env.VUE_APP_STRIPE_PUBLIC_KEY || '',
      elements: [{ type: 'card', options: {} }],
    })

The issue was that the ElementType type's options? attribute is the union of the different options, changing the AND to OR it works fine.

@frandiox
Copy link
Owner

@csbszb Glad you found it helpful! I've fixed that issue in 0.0.2.
The new 0.1.0 supports Vue 2 and 3 at the same time but has 1 extra dependency (vue-demi). If you don't need Vue 2 you can stay in 0.0.2 and save 300 bytes 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants