#thepaje

1 messages · Page 1 of 1 (latest)

fleet ploverBOT
young mirage
fleet ploverBOT
ivory wind
#

I debugged the error currectly this time, and it seems the problem is to an call to Stripe api as stated in the srvr attribute on the query to api.stripe.com

Error Domain=com.stripe.lib Code=51 "There was an unexpected error -- try again in a few seconds" UserInfo={com.stripe.lib:ErrorMessageKey=You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/., com.stripe.lib:StripeErrorTypeKey=invalid_request_error, com.stripe.lib:hintKey=No valid API key provided. Set `STPAPIClient.shared().publishableKey` to your publishable key, which you can find here: https://stripe.com/docs/keys, com.stripe.lib:StripeErrorCodeKey=, NSLocalizedDescription=There was an unexpected error -- try again in a few seconds}

I probably messed up the configuration somewhere because the publishableKey is not being sent.

young mirage
#

What API do you call here?

#

oh it doesn't tell

#

But it does hightlight how to set the PublishableKey

ivory wind
#

Yea it is the API call to initialize the setup intent as far as I can tell but somewhere I'm messing up with my publishable key and I'm trying to figure it out where now.
Ty already helped a lot, ill update here when I find out!

#

Sorry, not the setup intent but after the setup intent created to open up the Swift UI Flow

ivory wind
#

Ok, I fixed it and it was really silly.

I was fetching my publishableKey from my backend before initializing, but since its an async function and I did not properly set the promisses and it ended up initializing the Stripe api before the return from the backend, but while debugging the key was already there because when i was testing the fetch was finished.

Anyway, thanks a lot @young mirage