#JohnnyVL
1 messages · Page 1 of 1 (latest)
Creating Account API is an backend API, and should be called with a secret key
you can't call it from iOS app
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
You simply call a request to your server, and let your backend does the work
Ok, would you be able to check my code? I'm doing exactly that in the code I think
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?
I'm calling backend, and posting a new account to where we have our connected accounts, not sure about backend calling the API?
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
Yes that means I am calling it directly then I think
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
Ok, so I don't have any backend server set up, only Firebase Firestore for some user auth stuff, how would I proceed?
You would need to setup Firebase Firestore with Stripe API then 🙂
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
Yep
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)