#vmehtawhq_api

1 messages ยท Page 1 of 1 (latest)

shrewd willowBOT
#

๐Ÿ‘‹ 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/1268138353765781554

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

wicked ospreyBOT
#

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.

ebon pewter
#

๐Ÿ‘‹ happy to help

#

I'm testing to see whether you can pass the paymentMethodOptions with the financial connection permissions to the PaymentElement the same way you do with PaymentIntents

#

give me a second please

sonic needle
#

Sure

ebon pewter
#

ok so basically you can use

payment_method_options: {
    us_bank_account: {
      financial_connections: {
         prefetch: ['balances'],
        permissions: ['payment_method', 'balances', 'ownership', 'transactions'],
      },
    },
  },
``` when creating the element `stripe.elements({...})` to prefetch the balance when using the deferred flow
sonic needle
#

Sweet! Does this allow the frontend to directly get the balance from Stripe or we still need to get that from backend by listening to webhooks?

ebon pewter
#

you will get the financial connection account ID in the frontend and then you can send that to your backend and get the balance details there

sonic needle
#

Okay, that helps. I will try this out

ebon pewter
#

please leverage confirmationTokens instead of creating a new PaymentMethod when using the deferred flow

sonic needle
#

What do you mean by confirmationTokens?
We only use existing payment methods if saved by user.

shrewd willowBOT
sonic needle
#

Hey I am not able to find the prefetch in stripe.js, is this in latest version?

cobalt yacht
#

what does "find the prefetch" mean, where are you looking and exactly and for what?

sonic needle
#

prefetch parameter for financial connections

cobalt yacht
#

I see. Yes, it's not in the docs. Does it work if you pass it anyway? (might just be a mistake in the docs)
But personally I don't think it's possible to set this client-side, might be a backend-only thing

#

not really sure, I'm not too familiar with this part of the API

sonic needle
#

It doesn't allow me to pass because the underlying lib doesn't have the param.

cobalt yacht
#

are you talking about typescript not letting you?

sonic needle
#

Yep

cobalt yacht
#

if you ts-ignore the line and just pass it anyway does it work?

sonic needle
#

I can try and let you know

shrewd willowBOT
cobalt yacht
#

cool. If yes -> it's an oversight in the docs(types come from the data source) ; if no, then it's not supported today in this deferred flow, but there's probably an alternative(I don't know what it is off the top of my head)

keen pivot
#

Oh, wait you mean prefetch specifically

sonic needle
#

That's correct

keen pivot
#

Did ignoring the TS error pass the param anyway? Did it work as needed?

sonic needle
#

I yet have to test

sonic needle
#

I was able to send the prefetch param in stripe elements.

#

Now that I have sent it, I would get a webhook in response right?

keen pivot
keen pivot
sonic needle
#

On setting the prefetch param in stripe elements, I should expect a webhook in the backend that would give me the balance for the account right?

#

Or is my understanding wrong here?

#

In test mode, I was able to see the balances though for the bank accounts

keen pivot
#

I think you'd see the balances in the UI when you call the confirmPayment function to initiate the bank verification flow

sonic needle
#

Even before calling the confirmPayment, when I choose bank account to fill in details, I have started seeing balances there

keen pivot
#

Yes, but which function in Stripe.js have you called at that point?

#

There won't be a webhook event at that point with that info, no

sonic needle
#

I have just passed the above mentioned options in <Elements {here} /> and I started seeing balances

keen pivot
#

Started seeing balances where?

sonic needle
keen pivot
#

That UI won't display just by calling stripe.elements()

ebon pewter
#

@sonic needle as I mentioned earlier you will receive the fca_xxx ID that you then need to pass to your backend and retrieve the FCA to get the balance information

#

what you're describing now is what your customer will see eventually

sonic needle
#
  1. From which call will I get FC id?
  2. We are using PaymentElement from lib, also useStripe, useElements hooks, AddressElement,
    LinkAuthenticationElement, as well and nothing else.
  3. I do get that customer is going to see this, I am trying to understand the flow here.

If UI passes above mentioned options in <Elements/> where will I get FC id? Secondly, in test mode how am I able to see these balances, if according to docs, we get balance in backend https://docs.stripe.com/financial-connections/balances?financial-connections-integration=payment_intent#initiate-balance-refresh

Learn how to access an account's balances with your user's permission.

ebon pewter
sonic needle
#

I don't create any such token or do you mean confirmPayment/ clientSecret?

ebon pewter
#

no, since as you said you're doing a deferred flow

#

you can first start by creating the confirmationToken as I explained

#

then you can access the confirmationToken.payment_method_preview.us_bank_account.financial_connections_account

sonic needle
#

I might be wrong here but does this mean deferred flow?

ebon pewter
sonic needle
#

I see, I can look into confirmationToken.
Could you also please clear my confusion on how am I able to see balances in test mode without using confirmationToken, if that's the only way or is it not?

ebon pewter
#

seeing the balance on the UI does not mean you have access to the balance

#

this is only accessible to the customer

#

when you create the confirmationToken you then have a financial connection account created

#

and then passing it to your backend gives you the ability to inspect the balance

sonic needle
#

That makes sense!

#

This is helpful, thank you @ebon pewter !

ebon pewter
#

sure