capacitor-community / stripe

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

Payment Sheet Failed #89

Closed max1018 closed 2 years ago

max1018 commented 2 years ago

When trying to use the plugin on an iOS device or simulator I am getting a payment sheet failed message. However the code works just fine on web.

PaintedShepherd commented 2 years ago

Are you using the ephemeral key? If yes, then you have to use the id of the ephemeralResponse

max1018 commented 2 years ago

Hi @PaintedShepherd , yes I am using the ephemeral key I am manually setting it at the moment for testing purposes.

rdlabo commented 2 years ago

@max1018 First, you need to isolate whether the problem is with this plugin or something else. For that we are providing a demo. Please clone this repository and try https://github.com/capacitor-community/stripe/tree/master/demo/angular

max1018 commented 2 years ago

@rdlabo , after i download the repo what commands do i need to run to install dependencies and use this on a simulator?

rdlabo commented 2 years ago

Please run npm run cap && npx cap update && npx cap open ios .

max1018 commented 2 years ago

I get the following error below

Screen Shot 2021-08-02 at 8 44 32 AM

rdlabo commented 2 years ago

Sorry, I forgot one command: npm run build in top repository.

max1018 commented 2 years ago

The demo is working on my test device... not sure why its not in my application.

rdlabo commented 2 years ago

Maybe this is your backend api issue. Please check https://stripe.com/docs/payments/accept-a-payment?platform=ios#add-server-endpoint , and if not resolve, please ask stripe team.

max1018 commented 2 years ago

I am manually entering the information so it shouldn't be my backend. Also it works on web. What reason would the paysheet pop up and then immediately fail ?

rdlabo commented 2 years ago

Manually? You should create by code: https://github.com/capacitor-community/stripe/blob/master/demo/server/src/app.controller.ts#L23-L26

The web will open the PaymentSheet even if the key is wrong, but iOS does not seem to. This is a Stripe specification, so please ask Stripe.

max1018 commented 2 years ago

I create by code on the backend but then take response and manually enter in

rdlabo commented 2 years ago

@max1018 Did you adapt this plugin for production? If yes, please tell us what app. Please help us to develop this plugin in 2022. https://github.com/capacitor-community/stripe/issues/145 Thanks.