#xXstekkaXx-balance-reconciliation
1 messages ยท Page 1 of 1 (latest)
We actually have a parameter specifically for this. As soon as the Checkout Session succeeds, you can create a Transfer and specify source_transaction=pi_123 where pi_123 is the Checkout Session's payment_intent https://stripe.com/docs/connect/charges-transfers#transfer-availability
That tells us to wait for the funds to land to transfer them.
ok great
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Hi I want to wait for a checkout session to be successful and the funds from the checkout session to become available,
To make transfers to the connected accounts
So I put payment_intent of the session in the field "source_transaction" of the various transfers, but it returns me the error:
StripeInvalidRequestError: No such charge: 'pi_3LAb...."
What am I doing wrong?
Thank you!
Can you send me the request ID from when you got that error message? (req_123)
sure
It should be in your developer logs https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
pi_3LAbZ0AqgzZXSfui0j53s8qJ
Thank you, checking in to your request
I found it
Do you have the request ID specifically for creating the transfer? I am looking through your account logs now but can jump right to it if you have it on hand
Found it
Ah, this needs to be a charge ID (ch_123), I was wrong when I said to pass in the PaymentIntent. You can pass in the first Charge in that PaymentIntent's charges list, then the API call should succeed
one sec
mmm
I'm a little confused
what do you mean by "the first charge"?
where do I take it?
I have the checkout session object, can I take it from there?
Sorry, jumped a couple steps there. So when you get the checkout.session.completed event, the Checkout Session object will have the payment_intent property with the ID you have been using. You can use that ID to retrieve the PaymentIntent. Once retrieved, the PaymentIntent will have a charges array https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges-data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The first element in that charges array, charges.data[0], will be the charge that succeeded. You can pass the ID of that charge in to the create transfer call's source_transaction parameter
ok perfect
Phew, I was typing up a summary because I thought I made it a bit confusing
other charges in the array are always failed?
ahah no problem you made it very clear
Yes, if you are in the checkout.session.completed, that means you have had a successful payment. The first charge in that array will then always be a successful charge. Any other charges in the array will be failed payments in reverse chronological order
perfect
thank you very much!
๐