Patreon php api webhook to do stuff when receiving pledge info

I’ve searched everywhere.
Now, or I’m retarded, or I don’t know.
What’s the way to make the php script do something when a webhook is received?
I just need to store the webhook pledging\updating pledge\deleting pledge user name and email to two variables.
I’m able to install api library through composer but I’m unable to understand how to make the web hook work like that … please help.

When your app receives the webhook’ _POST action, you need to verify the validity of the info that is posted to your app, and then you can get the info posted with the webhook and do whatever you want with it.

Its moderately complicated due to the need to confirm the validity of the request, but its not a big thing. Check out how the WP plugin does that. You can copy the exact logic to your app: