richnologies / ngx-stripe

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

StripePaymentElementComponent seems to ignore the Elements Appearance API #164

Closed knowledgeplaces closed 2 years ago

knowledgeplaces commented 2 years ago

I have setup a payment component with Angular 12 and ngx-stripe and everything works fine. Now, I would like to use a theme to style my component, as described here. Essentially, I would like to use a theme, and I wrote a code like this:

const stripeAppearance = { theme: 'flat' } as Appearance;
_this.elementsOptions = {
    clientSecret: _this.stripePaymentIntentResponse.paymentIntent.client_secret,
    appearance: stripeAppearance
};

When I run the app, no error in compile, no error in console, but the theme is not applied. Please advise.

gentildpinto commented 2 years ago

I've the same issue This ignores all stylization attempts, there is no way to change the elements. They look static, could you please fix this out?

richnologies commented 2 years ago

Hi @knowledgeplaces and @gentildpinto,

I'll take a look today to this issue, but it seems to work fine if you pass the appearance object directly to the componente, like here: https://stackblitz.com/edit/ngx-stripe-issue-164

Please let me know if this workaround help you until I have the opportunity to check what is going on

Kind regards,

R

richnologies commented 2 years ago

Hi @knowledgeplaces and @gentildpinto, I make a small change in the example and it seems to work fine: https://stackblitz.com/edit/ngx-stripe-issue-164 by passing the styles in the elements options, are you doing it like that?

gentildpinto commented 2 years ago

Hi @knowledgeplaces and @gentildpinto, I make a small change in the example and it seems to work fine: https://stackblitz.com/edit/ngx-stripe-issue-164 by passing the styles in the elements options, are you doing it like that?

It doesn't work with "ngx-stripe": "^9.0.5" on Angular v9 Maybe I Should update to Angular 12 and use "ngx-stripe": "^13.0.0" like in the example to work

richnologies commented 2 years ago

Ah!, yeah, sorry, I will update the older versions