#abrams_tank - webhook json

1 messages · Page 1 of 1 (latest)

modern widget
#

You're seeing the payment intent object id and metadata then the nested charges data -- this is normal. At the time the charge is created, in inherits the metadata from the payment intent, which is why you see it there too.

#

You can ignore the nested charges data for your purposes

golden pilot
#

Ok, I just want to make sure I can get it from the first instance and that it will always be there. It would cause problems if one day, Stripe removed them from the first instance, and then I needed to get it from the charges data

#

But now that you mentioned the payment intent object id, maybe there is something that I don't understand. The payment intent object id that I am getting looks something like pi_3KJyCrKNJvnLf1Web8eFqJSAe. When I go to https://dashboard.stripe.com/test/payments, the list of payments also seems to be ordered by this payment intent object id

#

If a dispute arises with a customer, or I am refunding the customer, is this the ID that I should be using when I communicate with the customer? That is, pi_3KJyCrKNJvnLf1Web8eFqJSAe?

#

pi_3KJyCrKNJvnLf1Web8eFqJSAe looks like a very weird payment ID because it includes what looks like hexadecimal characters

modern widget
#

You should parse the payment intent ID and metadata from the event data.object after parsing the data. I'm not sure what you mean by the "first instance" -- there is a defined structure/path to use. If you mean in the string representation then I would not recommend making that assumption.
https://stripe.com/docs/api/events/object#event_object-data-object

That ID is not something that would carry any meaning to your customer, no. It's for you to use with Stripe. What are you trying to do?

golden pilot
#

Oh yes, by "first instance," I mean that I can always get the payment intent ID and metadata from data.object, rather than getting it from data.object.charges. I just want to make sure the JSON structure won't change in the future, such that I cannot get the payment intent ID and metadata from data.object anymore and I am forced to get it from data.object.charges.

#

If it will always be available from data.object, I will get it from there

modern widget
#

That object is a payment intent object, you can count on the id and metadata being available there (metadata only when set, of course).

golden pilot
#

Ok, thanks! About the actual payment intent ID that looks like pi_3KJyCrKNJvnLf1Web8eFqJSAe, yeah you are right. It won't be shown to the customer.

#

I am getting this mixed up with PayPal because PayPal does show a transaction ID to the customer, since customers can purchase with their PayPal balance. But of course, there is no such thing as a balance for customers that use Stripe.

modern widget
#

OK great - let me know if you have any other questions I can help with 🙂

golden pilot
#

Nope, no more questions for now. Thank you for your help!

modern widget
#

My pleasure, good luck with your work!