Checking Stripe Connect Account’s Capabilities from your iOS platform

Charlie Oxendine
Mac O’Clock
Published in
2 min readJun 27, 2020

In a previous article, I discussed onboarding Stripe connect users in your iOS platform with Firebase Cloud Functions/Auth(Node.JS). If you wanna learn more about that check it out here!

Photo by rupixen.com on Unsplash

If you don’t know, Stripe is a powerful payment processing platform that allows developers to create complex payment flows with minimal legal/development overhead.

Connect gives you a lot of control over how you route payments. There are three basic models for routing funds in your Connect marketplace. It could be a one-to-one (Uber — rider to driver), one-to-many (online stores — user purchases from many vendors), or many to many (SaaS platform where vendors provide some virtual service).

One problem with payment platforms is that regulations and laws vary based on location and can change over time. Therefore, many firms find it more cost-effective to rely on payment platforms like Stripe to take care of that overhead. But even though Stripe will check on our accounts to make sure they have all the necessary information, we still need to consistently check that our users’ Connect accounts are in good standing. By doing this, we can avoid unexpected errors later due to bad account states.

Time to write some code!

Stripe doesn’t offer one magical “info needed” function for their accounts. Instead, you manage the information that Stripe needs and your users’ account statuses based on the capabilities you need that user to have. With more capabilities, Stripe may need more information. This is great for us because that means we only need to prompt our users when we actually need information from them, minimizing the interruptions to their experience.

You can check out more information on Stripe Connect Account capabilities here.

Below, we are creating a cloud function that takes in an account ID and checks for a user’s transfer capability. This determines whether a user can transfer money to another person on your platform or make withdrawals to their bank. You can change this to whatever capability you want to check for. There’s a list of capabilities here.

On the client-side, we use Alamo-Fire to make the call to our cloud function. If it returns false, then you should pass the user into the Stripe Connect Onboarding webform (explained in the previous article).

Side Note: You can call cloud functions directly from your app with the Firebase Framework instead of Alamo-Fire. Check it out here.

If everything is done properly, this function should return true or false (if a user’s capabilities are active). You can use this to check when the user logs in, or when the user tries to use their capability in your app. I hope this helps and suggestions are always welcome!

--

--