#peter_code

1 messages ยท Page 1 of 1 (latest)

marble oarBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1379096614706217112

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

quartz belfry
#

Since my Stripe Elements configuration has "prefetch: ['balances']," under the Financial Connections object, I am assuming the bank balance info would be in the confirmation token object that is returned

timid egret
quartz belfry
#

How does a prefetch of the balance work in this instance? My understanding is that waiting for the balance refresh to complete is the next step after you initiate "an on-demand refresh". In my case, I initiated the balances property in the prefetch array - is there a different next step to get the balance after this? My assumption is that with a prefetch, you don't have to manually initiate "an on-demand refresh"

timid egret
#

Hm, testing this to confirm where the balances will surface here, hang tight

marble oarBOT
cinder magnet
#

Hi there ๐Ÿ‘‹ I'm jumping in as my teammate needs to step away soon.

Can you share the ID of a Confirmation Token that you created during your testing? I'm curious to see if the payment_method_preview.us_bank_account.financial_connections_account field on it is populated with the ID of the Financial Account object that you can retrieve to check the balance.

quartz belfry
#

It's there, I was just testing this

#

Let me get you a screenshot

#

I took the "financial_connections_account" ID here and did a look-up on the back-end using "stripe.financialConnections.accounts.retrieve()". The account object it returns has "null" for the "balance" object - so it looks like it didn't prefetch the balance status?

cinder magnet
#

Hm, can you copy/paste that confirmation token ID here?

quartz belfry
#

Sure, here's an updated request

#

Front-end confirmation token object

#

Back-end account object

cinder magnet
#

Sorry, I meant, can you just put the string that is the ID of the Confirmation Token object in this chat. (Not a screenshot)

Though looking at that most recent screenshot, the permissions on the FCA don't seem to align with what you're setting in when initializing Elements.

quartz belfry
#

"ctoken_1RVZRLBwYVbvgwKIAMcpJu95"

cinder magnet
#

Thank you! Taking a closer look at logs from our side.

#

While I do, I want to double check, you're using react-stripe-js for this? If so, can you confirm what version of that package you're using?

quartz belfry
#

"@stripe/react-stripe-js": "~2.8.0",
"@stripe/stripe-js": "~4.4.0",

#

let me get you the lack file versions

#

*lock

#

@stripe/react-stripe-js = 2.8.0

#

@stripe/stripe-js = 4.4.0

#

On the back-end Node side, "stripe": "16.9.0"

cinder magnet
#

Hm, looking at the Confirmation Token creation request, the financial_connections hash isn't coming through:
https://dashboard.stripe.com/test/logs/req_gS0utyEoJhU5ce

Oh, looking back at your code it looks like financial_connections is beside us_bank_account, rather than being nested inside of it:
https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions-us_bank_account

I'd suggest starting by trying to move your financial_connections hash inside of the us_bank_account hash, and see if that helps.

quartz belfry
#

yeah, I just got it working by moving financial_connections into us_bank_account

#

but just to confirm, there is no way to get the balances on the front-end with just a confirmation token and Stripe Elements?

#

Looking at the docs, it looks like stripe.financialConnections.accounts.retriev can only be called server side and from searching through the API docs, I don't see the balance object returned from any other endpoint

#

in the perfect world, I would like to have the balance info before I send the request from the front-end to our back-end so that I can forgo that request if the balance isn't sufficient

cinder magnet
#

I'd suggest planning on checking the balance on your backend server. A savvy javacript user could make adjustments to what your client-side code is seeing, so it seems safer to me to plan on doing that server-side from the start.

quartz belfry
#

Correct me if I am wrong, but prefetch: ['balances'] in my example here just means I don't have to manually refresh the balance for the account (which is why I think I can call stripe.financialConnections.accounts.retrieve() directly on the back-end and it returns a balance object)? It doesn't actually mean I can get the balance info as part of an object that's returned from a POST action somewhere?