#alex_
1 messages · Page 1 of 1 (latest)
hi! yeah there isn't really any clean solution there since the amount has to be set statically when creating the CheckoutSession.
this feature doesn't have great support for Connect unfortunately!
one option would be to not use transfer_data and instead manually create a transfer for the amount you want after the payment completes (https://stripe.com/docs/connect/charges-transfers)
I would need to create a transfer group prior to the checkout session? Or this is to be done when a webhook is called after the checkout session is completed?
just use source_transaction instead(bottom of the page) and ignore transfer groups
Ok so I should listen for any charges coming in (charge.succeeded). In my webhook, I need to create the transfers with the right amounts depending on the charge and its products, specifying the source transaction. Do I get this right?
no, use checkout.session.completed like always for Checkout payments
then if the Checkout payment was related to something you want to split, you can access the PaymentIntent from the session and the Charge ID to pass to source_transaction is intent.charges.data[0].id , or intent.latest_charge if you're on the latest API version which removed the charges array from PI