#Chung-Yi-Balances

1 messages ยท Page 1 of 1 (latest)

glad pike
#

๐Ÿ‘‹ happy to help

#

unfortunately there is no specific amount of time, what you can do instead is do an exponential backoff(https://en.wikipedia.org/wiki/Exponential_backoff) and use the balances_refresh.status to check whether it's still pending or succeeded

Exponential backoff is an algorithm that uses feedback to multiplicatively decrease the rate of some process, in order to gradually find an acceptable rate. These algorithms find usage in a wide range of systems and processes, with radio networks and computer networks being particularly notable.

gilded wraith
#

Thanks! So I assume polling the account balance is a valid approach to integrate the balance check in our checkout flow. And we need to set our own interval (as you suggested), timeout etc and design our experience. Right?

glad pike
#

yes right

gilded wraith
#

@glad pike And just to make sure I don't miss something obvious, we can't get the account balance in a synchronous way, right? (because Stripe does it in the background.)

glad pike
#

right

gilded wraith
#

OK awesome! One last thing: the doc mentioned "The time required to fetch the most recent data can vary depending on the financial institution, but can generally be returned in seconds."

Are we talking about generally <10 seconds or a different magnitude? Because we probably won't be able to get enough data before using it in production, I'd like to help our team decide a good interval/timeout (or even pursuing this approach).

glad pike
#

I guess you could start by 1 second and work around it with the backoff algorithm

gilded wraith
#

OK I can give that a try. Thank you for your help! ๐Ÿ™

glad pike
#

let me know if you need any more help