Hi,
I’m trying to set up webhooks to get charge.succeeded and charge.failed from stripe, and then to save the details of that charge into my database.
I’m facing 2 issues:
- Some of the data I need to get is (I don’t know if this is the correct term, but) embedded 1 or 2 layers down - for example, below you’ll see that within “data”, there’s “object”, and within “object” there’s “id” which has the charge number - I want to get this number, but I’m not sure how.
I found that i was able to get data from the 1st “level”, but I don’t know how to get things that are on lower levels.
For example, when I set up the Webhook API endpoint like this:
I was able to create a thing and save the id, which came out as this (which is good):
Any ideas how I can get to the information on lower levels, like the ch_?
- I’m using Stripe’s subscriptions for my app - when a charge goes through, I need to know which subscription it was in reference to, but the charge doesn’t appear to have the reference subscription (this also could be maybe because it’s stripe’s Test Webhook, and not one of my actual subscriptions) - if the webhook doesn’t include the reference subscription, any ideas on how I can get it?
Thanks in advance,
Jeff