Closed Aksoom-Hussain closed 2 years ago
@Aksoom-Hussain Thanks for issue. Where is console.log
that undefined
displayed?
I suggest you console.log(["where's log", result]);
. Thanks.
the undefined log come after
await Stripe.createPaymentSheet()
the function is not return so it show undefined
@Aksoom-Hussain createPaymentSheet
's then
? or catch
?
In many cases, the back-end implementation is the problem (e.g., API keys do not match)
I follow all the previous issues requested make tweaks
with that I was able to run it on the android app but the web issue still persist
it say issue is with present in web.ts as shown in screenshot
Is it async problem?
Since Stripe.initialize
is intended to be executed only once, it is not appropriate to put it here. You should run it beforehand with constructor
or something similar.
tried on beforemounted() function
getting this error in vue.js 3 nuxt 3
OK, I see. It seems @stripe-elements
's lazy load and SSG/SSR issue. ( Not this plugin ).
I'm not Nuxt user, so can't support your project. Please check https://github.com/capacitor-community/stripe/blob/master/src/web.ts#L47-L83, and get log.
( did you run npm install @stripe-elements/stripe-elements
? )
yes stripe elements is installed and in node_module
@Aksoom-Hussain Please read https://github.com/capacitor-community/stripe/blob/master/src/web.ts#L47-L83 .
Stripe
object. stripe-payment-sheet
in body.However, if you suffer from this, perhaps you should build it yourself at https://stripe.com/docs/payments/elements instead of @stripe-elements
on web.
1 stripe objects is always get undefine on first initialize 2 html have empty stripe-payment-sheet tag and all JS import in name of stripe
Wait...
await store
.getStripe(route.params.id, 0)
.then(async () => {
Stripe.initialize({
publishableKey: user.stripe_publishable_key,
});
This is not await Stripe.initialize. Why Stripe.initialize
run into then?
await store.getStripe(route.params.id, 0);
await Stripe.initialize({
publishableKey: user.stripe_publishable_key,
});
the first await is for the API call then it initialize the stripe
if stripe objects is always get undefine
is true, can't run Stripe.initialize
.
yes that only case for the web, android is working fine
the stripe initialize get this error in web
https://github.com/ionic-team/stencil/issues/3195 help you? vite may be one of reason of issue.
This is not this plugin issue. I can't help you.
ok let me check
Sorry I can't help you. A solution might be to not bundle them in vite and use script tags for loading @stripe-elements...
https://stenciljs.com/docs/vue
is it possible to make your library bundle Vue compatible as stencil also have it, that will help in future scope
is it possible to make your library bundle Vue compatible as stencil also have it,
Can't. This is not problem about @capacitor-community/stripe. This plugin contains neither StencilJS nor Web Components.
Platform
Describe the bug
Unable to find a Capacitor plugin to handle requestCode an android
To Reproduce using these 2 function in vue.js nuxt 3 1 initializing the listener and placing the keys 2 calling the payment sheet crashing the app 3 in web it give error
Expected behavior unable to start the stripe gateway