#iCoNio-PI
1 messages · Page 1 of 1 (latest)
Hey @kindred quarry for sure. I'm trying to the product that was sold through the webhook api. I'm using the charge.succeeded event. That, on its own doesn't give me anything related to the product, I then tried the paymentIntents.retrieve() method using the payment intent and also tried the charges.retrieve()but then again nothing related to the product.
do you have the PaymentIntent ID pi_xxx just so I can look it up and confirm how it was created and where the product information would be?
(there might not be any depending on how you integrate)
I do. pi_3L9vTcBFmPjLabqy09rLf1AF
I have created the product on Stripe's dashboard and I'm using the purchase link generated by the dashboard.
ok got it
so yeah the Product information is not the in the PaymentIntent, it's in the CheckoutSession.
The normal way to handle this is you listen to the checkout.session.completed event https://stripe.com/docs/payments/checkout/fulfill-orders and as part of that you would call https://stripe.com/docs/api/checkout/sessions/retrieve and use expand:['line_items.data.price.product] and then the details are in that line_items field
for PaymentLinks you generally want to use the Checkout docs since that's what it is under the hood, and it's easier to work with the CheckoutSession API instead of the raw PaymentIntent API
to save you time the CheckoutSession ID for that PaymentIntent was cs_test_a1FJEQnjAAPv555sV7roXmbOhC79bGr2oRCuLBS5KJDuHw9JXwBpLrFGo1 so you can test out retrieving/expanding that