#phal0r_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime!
๐ 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/1212735404357451777
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
โฒ๏ธ 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. Thank you for your patience!
Hi @old oyster ,
if you need further information or code samples, let me know.
Hi
Yes you can't update a payment_intent's transfer_group created by an invoice
You can proceed and create a transfer by referencing the PaymentIntent without the need of the transfer_group
You can't specify a transfer_group when creating an invoice:
https://docs.stripe.com/api/invoices/create
You can proceed and create a transfer by referencing the PaymentIntent without the need of the transfer_group
you mean by using the source_transaction property?
yes
ok, that's what we are doing already
we use invoice.charge and assign it as source_transaction in the transfers
What do we lose if we remove transfer_group entirely?
According to the docs, it is not really necessary, but I am not entirely sure about the implications
Yes it's not mandatory, it's a way for regrouping transfers
Can we still identify, to wich payment the transfers belong without the tranfser_group?
Yes using the source_transaction
we tried this and faced a new error
same flow:
- create invoice
- create 2 transfers using invoice.charge, but the charge is undefined at this point
What is needed to have the correct charge?
what is the error? can you share the request Id ?
one sec
๐ taking over for my colleague. let me know when you have the request ID
ok, thanks
sorry for the delay
this is such an event: evt_1Op9BcGMzVvXT46ZZsMsXMzP
is this the id you need?
use the invoice.payment_intent.latest_charge
but this means you need to either retrieve the payment_intent or better retrieve the invoice and expand on payment_intent
I guess the latest_charge is set, when a payment is tried, right?
yes
that's why you need to wait until invoice.paid event
to create the transfers
maybe the big picture right now is important:
- create the invoice and finalize it (with mode send_invoice)
- we create the transfers
- we return the clientSecret to the frontend
- frontend uses it to for PaymentElement
- user proceeds with payment
ah okay, that's what I wanted to discuss
so we are creating the transfers to early?
๐ stepping in
Yep was catching up and helping a few other folks
Finishing up taking a look now
One sec
thanks, take your time
So yeah, you basically can't use transfer_group here since this is a PaymentIntent from an Invoice and in that case you can't update trasnfer_group. Instead, you would want to use metadata here to tie the PaymentIntent and Transfers together.
this was the beginning of the convo
when we consider this flow:
maybe the big picture right now is important:
- create the invoice and finalize it (with mode send_invoice)
- we create the transfers
- we return the clientSecret to the frontend
- frontend uses it to for PaymentElement
- user proceeds with payment
we cannot add source_transaction because the charge is undefined
I just wanted to make sure, that there is no way to create the transfers at this time, right?
You are trying to send to multiple Connected Accounts, yeah?
And unless it is an async payment method then you do have the Charge at that time, otherwise you are correct you don't, and you would have to wait for payment_intent.succeeded to create the Transfers.
You are trying to send to multiple Connected Accounts, yeah?
yes
And unless it is an async payment method then you do have the Charge at that time, otherwise you are correct you don't, and you would have to wait for payment_intent.succeeded to create the Transfers.
in our tests the charge is undefined in my outlined scenario and your colleauge confirmed, that a charge is only created if a payment is actually tried
I mean, we can put it in the webhook, this is not a problem
I would just like to understand the details ๐
Indeed you would only see a Charge once payment is completed.
But I don't understand how/why you would be transferring funds before that anyway...
yeah, we don't want to transfer the funds beforehand. I understood the docs, that we can create the transfers and if we add source_transaction property, it will only be executed once the source transaction is finished
No, source_transaction allows you to transfer funds related to a Charge before the funds are actually availalbe. They will then remain pending in the Connected Account until available. Otherwise, you can't transfer the funds at all until they are available.
source_transaction does not hold the execution of the transfer itself