Koder
Koder

Reputation: 1914

Get charge id associated with Stripe checkout session

I am using Stripe checkout sessions. I am capturing 'checkout.session.completed' webhook. I need to know charge id associated with the session so I can refund the customer later. I am not finding any reference to charge object in the session object.

How can I get charge object associated with checkout session?

I tried capturing charge object in charge.succeeded webhook, but it doesn't have any reference to the price object customer used to purchase.

Upvotes: 5

Views: 2905

Answers (1)

Paul Asjes
Paul Asjes

Reputation: 5857

A completed Checkout Session will have an associated PaymentIntent, which in turn has a list of Charges associated with it.

Upvotes: 7

Related Questions