#vmehtawhq_api
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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.
- vmehtawhq_api, 1 day ago, 16 messages
- vmehtawhq_api, 1 day ago, 17 messages
๐ 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
Sure
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
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?
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
Okay, that helps. I will try this out
please leverage confirmationTokens instead of creating a new PaymentMethod when using the deferred flow
What do you mean by confirmationTokens?
We only use existing payment methods if saved by user.
Hey I am not able to find the prefetch in stripe.js, is this in latest version?
what does "find the prefetch" mean, where are you looking and exactly and for what?
I was referring to #1268138353765781554 message
prefetch parameter for financial connections
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
It doesn't allow me to pass because the underlying lib doesn't have the param.
are you talking about typescript not letting you?
Yep
if you ts-ignore the line and just pass it anyway does it work?
I can try and let you know
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)
It should be typed: https://github.com/stripe/stripe-js/blob/master/types/stripe-js/elements-group.d.ts#L613
Oh, wait you mean prefetch specifically
That's correct
Did ignoring the TS error pass the param anyway? Did it work as needed?
I yet have to test
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?
Great, looks like we're just missing the type definitions then! I'd recommend filing an issue on the repo
Sent what? Which API requests have you made?
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
I think you'd see the balances in the UI when you call the confirmPayment function to initiate the bank verification flow
Even before calling the confirmPayment, when I choose bank account to fill in details, I have started seeing balances there
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
I have just passed the above mentioned options in <Elements {here} /> and I started seeing balances
Started seeing balances where?
That UI won't display just by calling stripe.elements()
@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
- From which call will I get FC id?
- We are using PaymentElement from lib, also useStripe, useElements hooks, AddressElement,
LinkAuthenticationElement, as well and nothing else. - 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
when you create the confirmationToken
const {error, confirmationToken} = await stripe.createConfirmationToken({
elements,
params: {
payment_method_data: {
billing_details: {
name: 'Jenny Rosen',
}
}
}
});
from https://docs.stripe.com/payments/build-a-two-step-confirmation#create-ct
I don't create any such token or do you mean confirmPayment/ clientSecret?
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
I might be wrong here but does this mean deferred flow?
This is from https://api.stripe.com/v1/elements/sessions api that stripe.js calls
which you then send to your backend and call https://docs.stripe.com/api/treasury/financial_accounts/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
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
sure