#Alex Chartier-refund
1 messages · Page 1 of 1 (latest)
Apologies, I'm not sure I follow. Could you elaborate a bit on what you're trying to accomplish?
OK, so I set up my stripeClient with the appropriate secret apikey. I then create a session and place the session ID in the redirectToCheckout call of the button onclick method. When I get the callback from Stripe I retrieve the session information for the specific sessionID. This indicates a completed transaction.
When I later wish to perform a refund on this transaction it seems I need a charge ID. I am not sure where to get this.
Gotcha, so you can get the relevant charge ID by:
- Getting the associated Payment Intent ID from the Checkout Session:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent - Retrieve the corresponding Charge's ID from the Payment Intent's
charges.datafield:
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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah, OK. Should I be retrieving this info on the callback for additional validation of the completion status or is the status in the session itself sufficient?
The Session's status should be sufficient. If the Charge fails then the upstream objects won't move to a succeeded state.