capacitor-community / stripe

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

Stripe initialization #222

Closed v-trishyn closed 1 year ago

v-trishyn commented 1 year ago

Hello.

Platform

Describe the bug When I'm redirected by a router to the page with payments, I'm trying to initialize Stripe, and the IOS emulator outputs: ⚡️ To Native -> Stripe initialize 37184741 ⚡️ TO JS undefined

To Reproduce Stripe.initialize({publishableKey: VUE_APP_STRIPE_PUBLIC_KEY})

Screenshots

image

Additional context I'm using Ionic and Vuejs.

@capacitor-community/stripe": "^4.1.0

I was trying to find the problem with existing issues here and found this ticket and there was the same problem, but the issuer said that he had another problem, it was about the ephemeral key. (I'm certain issuer has resolved this issue in another way but that ticket has no information about it)

Still, I did the same rdlabo requested to do - I've added the defineCustomElements(window); in a way that Ionic Vuejs demands and still no results.

I was also trying to go further and have called isApplePayAvailable() but it just hangs and never return any values at then()/catch()

v-trishyn commented 1 year ago

Hello? Could anyone guide me on what I'm doing wrong please?

v-trishyn commented 1 year ago

So, accidentally I found the problem, the reason was IOS Emulator, which demanded to confirm Apple ID. When I was starting the app, the iPhone emulator was asking to confirm my Apple account with a popup, for some strange reason when I was clicking on the button to confirm it, iPhone was just opening Settings, and that's all, no screen to input the password. But for another strange reason (I really don't know how that happen) I got another popup after I was redirected to Settings, on which I clicked, and then it showed me the input for the password, I typed it and it worked without errors.

So now I have errors from Capacitor Stripe, which is gorgeous, it's much better than having none.