#Gyan
1 messages ยท Page 1 of 1 (latest)
Hi ๐ do you happen to know what request is being made when that error is encountered? Payment Sheet integrations use your publishable key and an ephemeral key, so I'm a little surprised to see an error saying you needed to provide a secret key and think this may be a server-side request that is failing.
i am just logging the response, and that's where i see the first error message.
const response = await presentPaymentSheet();
console.log("openpaymentsheet", response);
It is set to run on a buttonClick and there is nothing that executes before this line
Is the sample code shown here roughly what is running when you click the button in your app?
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
It looks like, as written, that code makes a request to your backend server to create a Payment Intent, Customer, and Ephemeral Key, and I'm wondering if it's that backend code that is missing the API key.
okay i can check
but if the backend code is missing the stripe key, will it throw the same error on fronend call of presentPaymentSheet()?
So far i see, the backend piece returning correct response.
Ah gotcha, so you're getting initialization and it's during the present step that error is being raised. Hm, not sure why a secret key would be needed there, thinking through this a bit more.
const response = await presentPaymentSheet(); console.log("openpaymentsheet", response);
this is the code that i am executing on checkout button click after getting all the values from backend piece.
Hm, I'm not seeing that error message in our React Native library, so I think that's coming directly from our API.
Can you share the ID of an intent where you're seeing this behavior?
this is the create-payment-intent webhook event:
i see :> "status": "requires_payment_method"
Thank you. Yup, I see your backend seems to consistently create Customer, Ephemeral Keys, and Payment Intents.
Hello! I'm taking over and catching up...
So you set your publishableKey in your <StripeProvider> as shown here? https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#stripe-initialization
@tepid field You still around?
Is the publishable key hard-coded or is it a variable? If it's a variable can you log it to confirm it contains the key you expect?
it's being passed through an env variable
also, just confirmed this is not an issue from backed at all.
I think it is something around publishable key
but i have not changed anything recently on frontend, checking what's going wrong
Yep, I agree, it's probably the env variable not containing the key.
Or maybe it's missing a character or something due to a bad copy or paste?
it worked when i hardcoded the key