#magnus
1 messages · Page 1 of 1 (latest)
Can you elaborate a bit on what you are looking for here? Is there a specific piece of stripe-go code you are working with now that you are figuring this out for?
I'm looking at the webhooks. To my understanding, it sends everything through POST requests as JSON to my server. When my server then needs to parse the JSON, are there any pre-existing structs in your Go library I can bind it to?
Oh yes definitely. We even have a method you can call to construct those objects from the webhook event
We show it in action here https://stripe.com/docs/webhooks#webhook-endpoint-code
Also you may find this helpful https://stripe.com/docs/webhooks/quickstart?lang=go
So I would just unmarshal the data into stripe.Event? And that covers any event type?
Yes though you will also need to do an unmarshal for the specific object in the event
The code in that doc shows this:
Thanks :)