Cl3MM / vue-stripe-better-elements

vue-stripe-elements on steroids
MIT License
22 stars 4 forks source link

stripeOptions prop has no effect #1

Closed jvmonjo closed 5 years ago

jvmonjo commented 5 years ago

Hi. I'm trying to set locale to 'es'. In order to do that I have set the property stripeOptions this way:

<stripe-element
                type="card"
                :stripe="stripeKey"
                :stripeOptions="stripeOptions"
                @change="cdcompleted = $event.complete"
              >
<stripe-element />

And then in my vue data:

(...)
stripeOptions: {
        locale: 'es'
      },
(...)

But it doesn't seem to take any effect. Am I missing something?

frossigneux commented 5 years ago

In the code I see a mistake: stripeOtions and not stripeOptions. https://github.com/Cl3MM/vue-stripe-better-elements/blob/master/src/stripeElements.js#L55

Cl3MM commented 5 years ago

@jvmonjo sorry for the late reply, I didn't see your message 😬 @frossigneux good catch, thank you!

After some further digging I found out that I was not setting up the options parameters properly (especially the Stripe(key, option)).

Anyway, I've released a new version that will allow you to add localization to your components.

Please install the latest version:

yarn install vue-stripe-better-elements@2.0.0

Please note that there is a breaking change: the options prop is now called elOptions. Please refer to the latest documentation to see how to use the newest props.

You can use it like so:

<stripe-element
  type="card"
  :stripe="stripeKey"
  :elsOptions="{locale: 'fr'}"
  @change="cdcompleted = $event.complete"
/>