#JohnnyVL

1 messages · Page 1 of 1 (latest)

violet bobcatBOT
rapid edge
#

Creating Account API is an backend API, and should be called with a secret key

#

you can't call it from iOS app

umbral vigil
#

Ok, so how would I do it? I can send the code of what I have if that helps, chat gpt seems to think it's possible lol

rapid edge
#

You simply call a request to your server, and let your backend does the work

umbral vigil
#

Ok, would you be able to check my code? I'm doing exactly that in the code I think

rapid edge
#

We can but let's talk through the expected steps/flow first

#

So you called your backend and your backend actually calling Create Account API?

umbral vigil
#

I'm calling backend, and posting a new account to where we have our connected accounts, not sure about backend calling the API?

rapid edge
#

Request returned an invalid response: Optional(<NSHTTPURLResponse: 0x6000026be640> { URL: https://api.stripe.com/v1/accounts } { Status Code: 400, Headers { - then shows the headers.
This looks like you are calling Stripe API directly

umbral vigil
#

Yes that means I am calling it directly then I think

rapid edge
#

So you need to change it. Instead of calling directly, you need to send a request to your server/backend, and let your backend developer call the Create Account API from their side and returns back information to you

umbral vigil
#

Ok, so I don't have any backend server set up, only Firebase Firestore for some user auth stuff, how would I proceed?

rapid edge
#

You would need to setup Firebase Firestore with Stripe API then 🙂

umbral vigil
#

Ah ok, and specifically have Firestore handle the request, send it to Stripe API, then return a created account at that endpoint in Stripe?

Like this;

User taps button to create in app -> firestore creates request -> Stripe receives request, Stripe creates an account

rapid edge
#

Yep

umbral vigil
#

This is new to me, how would the request look from Firestone stripe? Also all still in SwiftUI?

(You’ve answered my question, this is just any extra info)