richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

ngx-stripe-iban: IntegrationError: Invalid value for create(): supportedCountries should be array. You specified: undefined #110

Closed julianuphoff closed 4 years ago

julianuphoff commented 4 years ago

I'm using Version 9.2.0 with angular 9.1.7

Is this a feature request or a bug report? BUG

What's gone wrong? I've added a ngx-stripe-iban to one of my components. I've integrated it simmalar to this example: https://github.com/richnologies/ngx-stripe/blob/main/projects/ngx-stripe-tester/src/app/stripe-test-02/stripe-test-02.component.ts

After loading the page in my browser I've got this error: IntegrationError: Invalid value for create(): supportedCountries should be array. You specified: undefined.

Acording to the StripeJS Docs ( https://stripe.com/docs/stripe-js/elements/iban#submit-source ) the following parameter must be set: supportedCountries: ['SEPA']

I've found this in an old version of ngx-stripe: https://github.com/richnologies/ngx-stripe/blob/main/projects/ngx-stripe-tester/src/app/stripe-test-02/stripe-test-02.component.ts In the current version this was deleted.

ciriousjoker commented 2 years ago

@julianuphoff Can you please add the solution instead of just closing the issue?

Nvm, figured it out:

<ngx-stripe-iban [options]="elementOptionsIban"></ngx-stripe-iban>
elementOptionsIban: StripeIbanElementOptions = {
  supportedCountries: ['SEPA'],
};