#Kacper_Banasik-Checkout transfer
1 messages ยท Page 1 of 1 (latest)
hi ๐
you could use https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-transfer_data-destination
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
to automatically generate the transfer
instead of creating a separate transfer yourself
yeah in that case you can't that's true
so because of that I have to use transfers
which won't send money as soon as checkout is completed
so the problem stays the same
yes I agree, I'm trying to figure out what's the best course of action in this case
just give me a couple of minutes to think about it
sure take your time
please ping me if I don't get back to you within 10min
yea no worries
this is actually useful https://stripe.com/docs/connect/charges-transfers#transfer-availability
sorry I didn't think about that earlier
with the corresponding charge id?
my payment intent/checkout charges list is empty
from the checkout session object, you need to retrieve the payment_intent.charges.data[0].id
so should i create new charge before using that?
yea and this list is empty in my case
the data list
did you retrieve the payment_intent separately?
maybe I should use it in webhook after checkout is completed?
it's normal that you would only get the payment_intent id from the checkout.session.completed object
since the field is expandable
okay let me try this and I will comeback with certain answer and some screenshots
so just to me sure do i create checkout and then transfer without creating payment intent?
so basically what I'm saying is that when you receive the checkout.session.completed event use the payment_intent field from that object to call https://stripe.com/docs/api/payment_intents/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.
and in transfer source_transaction=payment_intent.charges.data[0].id
ahh okay
now i get it
yes
okay let me try this
let me know if you need any more help
sure, thanks ๐
@dusky prairie It worked as it should. Thank you sooo much for your help ๐
glad to hear that