#joe8912

1 messages · Page 1 of 1 (latest)

crimson plazaBOT
round moth
#

Hi, are you asking how you can attain the charge ID after a Checkout Session succeeds?

vapid spoke
#

yes please

round moth
#

I highly recommend that you watch this explanation on how our objects relate to each other, https://stripe.com/docs/payments/tour#payment-objects. It's very helpful.

You can listen to the checkout.session.completed event, https://stripe.com/docs/api/events/types#event_types-checkout.session.completed which would have the Payment Intent, https://stripe.com/docs/api/checkout/sessions/object?lang=php#checkout_session_object-payment_intent ID. You can then retrieve the Payment Intent, and look at https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge latest charge id.

vapid spoke
#

got it ill give it a look. thank you. I need it so i can transfer like so if session.status == "success":
stripe.Transfer.create(
amount=int(200*100),
currency="usd",
source_transaction=session.payment_intent.charges.data[0].id,
destination="account",
)

round moth
#

@vapid spoke let me know if you have any questions here. The recommended approach does not require you to write an additional if statement to make the transfer. It's a bit simpler

vapid spoke
#

yes, it is easier but I need to transfer to multiple accounts.

round moth
#

I see

#

That makes sense

#

I've shared your feedback to allow multiple transfers in Stripe Checkout for future product reiterations. Thank you.

vapid spoke
#

got it thank you!