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.

presentPaymentSheet not working with live publishable key

See original GitHub issue

I am using this library in one of my react native app for iOS to receive payments using credit cards only. The library work fine for test keys but as soon as I start using publishable live key, It starts giving me error: Error code: Failed No valid API key provided. Set STPAPIClient.shared().publishableKey to your publishable key, I double checked the publishable key from my stripe account and it is the correct live key. Here is the code

<StripeProvider
        publishableKey={
          'pk_live_XXXXXXXXXX'
        }>
<App />
      </StripeProvider>

Because in the above code as soon as I change the publishable key from live key to test key, everything starts working as expected. Is there any setting that I am missing in case of Live in iOS apps?

Please help

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
charliecruzan-stripecommented, Feb 9, 2022

merchantIdentifier is only necessary for Apple pay. If everything works correctly, and the only thing you change is the actual text values of the publishable keys, then I would double-check that key if I were you. You may also want to confirm that the value you’re getting from your server is the value you’re expecting it to be

0reactions
eleopardstudioscommented, Feb 9, 2022

It is resolved, yes @charliecruzan-stripe you are absolutely correct, due to copy paste one of the character was coming in different format somehow, due to which it was failing, it was looking correct but was getting read incorrectly. Now its working fine. Apologies for wasting everyone’s time. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stripe not working with live publishableKey React Native
In my Stripeprovider in App.js I was using the publishable test key with no issues everything was working pretty well ...
Read more >
API keys | Stripe Documentation
Live mode publishable key: Use this key, when you're ready to launch your app, ... The key stops working after the expiration date...
Read more >
Mastering Stripe PaymentSheet in React Native with Expo
We don't need the publishable key for now, but we will use it later in our React Native app. Copy the secret key...
Read more >
Payment Sheet - Flutter Stripe - docs.page
Securely accept payments online. Integrate Stripe's prebuilt payment UI into the checkout of your app with the PaymentSheet class.
Read more >
flutter_stripe | Flutter Package - Pub.dev
All you need to do is add your stripe publishable key to the payment profile. ... This plugin requires several changes to be...
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