Payment Option undefined when calling initPaymentSheet , presentPaymentSheet not working?
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
I would like to display the prebuilt payment sheet
To Reproduce I wrapped my whole app with the Stripe provider, and gave it my publishableKey like so:
<StripeProvider publishableKey="mypublishabletestkey"> <App/> </StripeProvider>
And in the App I have
` const result = await initPaymentSheet({ customerId: customer.id, customerEphemeralKeySecret: ephemeralKey.secret, setupIntentClientSecret: paymentIntent.client_secret, }) console.log(result)
{“paymentOption”: undefined}
As you can see, I keep getting payment option as undefined here, here are my keys
ephemeralKey: ephkey_1J7KbPKN3W88XVfoQ7khNUSu customerId: cus_JkocvtKKkryYU0 paymentIntentId: pi_1J7KbQKN3W88XVfoB4s0vmoj
When I try to hardcode my client secret into the presentPaymentSheet and log the response, nothing happens, any log that falls under the method does not get called `
Expected behavior Either I should get a response when initializing , which I get as paymentOption: undefinde OR a modal should pop up when I try to call presentPaymentSheet
Screenshots
Both have been tested in Android & IOS simulator and nothing seems to work
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (1 by maintainers)
@justinmichael-stripe I eventually realised that we should be using the customFlow and yes indeed it does return in that instance. However if you aren’t using the custom flow the customer HAS selected a payment method and in fact the dashboard backs this up. To be clear this is after the payment sheet has been presented, the user selects a payment option and the payment sheet returns, it returns undefined. I can see the payment id being returned in the api call so its there, also if you call retrieveSetupIntent it comes back with a paymentMethodId so this is clearly a bug. Either way its no longer a problem for us but I’d suggest its still going to be a problem for others.
I am Also getting the same issues