question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Payment Option undefined when calling initPaymentSheet , presentPaymentSheet not working?

See original GitHub issue

Describe 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 Screen Shot 2021-06-28 at 15 39 02

Both have been tested in Android & IOS simulator and nothing seems to work

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
daveadapptorcommented, Nov 12, 2021

@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.

0reactions
swatantragoswami09commented, Nov 21, 2022

I am Also getting the same issues image

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Stripe initPaymentSheet returning "paymentOption"
I didn't write the rest because initPaymentSheet is returning "paymentOption": undefined on stripe dahsboard, a customer is being created an ...
Read more >
@stripe/stripe-react-native
If no object is provided (undefined), then it is assumed that the payment method has already been attached to the Payment Intent. options:...
Read more >
Accept a payment | Stripe Documentation
Securely accept payments online.
Read more >
Exploring the new Stripe React Native SDK - LogRocket Blog
Follow this guide to implement the Stripe payment system in your React Native apps with the new Stripe React Native SDK.
Read more >
Adding Stripe payments to your React Native App with Expo.
So we want to use a unified flow for every payment method and to be able to maintain ... <Text>Open up App.js to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found