capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
MIT License
185 stars 74 forks source link

Stripe Elements has the same variable declared #43

Closed stefanotauriello closed 3 years ago

stefanotauriello commented 3 years ago

How can we use Stripe Elements if the same variable Stripe is used by Elements and this plugin?

ihadeed commented 3 years ago

Unless something changed with Capacitor, this plugin doesn't use window.Stripe variable. It uses window.Capacitor.Plugins.Stripe.

You can import the plugin into your .ts files in many ways without using the name Stripe, example:

import { Plugins } from '@capacitor/core';
const CapStripe = Plugins.Stripe;

Alternatively refer to the Stripe JS library by window.Stripe instead of Stripe.

stefanotauriello commented 3 years ago

Unless something changed with Capacitor, this plugin doesn't use window.Stripe variable. It uses window.Capacitor.Plugins.Stripe.

You can import the plugin into your .ts files in many ways without using the name Stripe, example:

import { Plugins } from '@capacitor/core';
const CapStripe = Plugins.Stripe;

Alternatively refer to the Stripe JS library by window.Stripe instead of Stripe.

Ok, but the main problem is that Stripe Elements can’t be used in Capacitor because of https requirement. How can I fix this?

ihadeed commented 3 years ago

Not 100% sure. You can try playing with the config values (see https://capacitorjs.com/docs/config) or ask in the Capacitor community (Slack, Reddit, Stackoverflow..etc)

From the config above it looks like you are able to change the server scheme to https but I'm not sure how that would work out (SSL certificates, platform limitations...etc).

Out of curiosity, what are you looking to use Stripe Elements for?

I would like to add UI components to this plugin, so it helps to learn more about how it can be useful in other apps. (e.g what features, fields, or customization options would be useful)

stefanotauriello commented 3 years ago

Elements is very useful because it manages form’s style, validation...

Il giorno mer 9 dic 2020 alle 23:10 Ibby Hadeed notifications@github.com ha scritto:

Not 100% sure. You can try playing with the config values (see https://capacitorjs.com/docs/config) or ask in the Capacitor community (Slack, Reddit, Stackoverflow..etc)

From the config above it looks like you are able to change the server scheme to https but I'm not sure how that would work out (SSL certificates, platform limitations...etc).

Out of curiosity, what are you looking to use Stripe Elements for?

I would like to add UI components to this plugin, so it helps to learn more about how it can be useful in other apps. (e.g what features, fields, or customization options would be useful)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/capacitor-community/stripe/issues/43#issuecomment-742094974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEOXWW3O3IOFUF6AUV4LJLST7YV7ANCNFSM4UTGXFAQ .

-- Stefano Tauriello

stefano.tauriello@gmail.com

[image: facebook] https://www.facebook.com/stefano.tauriello[image: linkedin] https://www.linkedin.com/in/stefano-tauriello-9036784a/[image: twitter] https://twitter.com/stauriello[image: instagram] https://www.instagram.com/stefanotauriello/