#bhanu365 - webhooks

1 messages · Page 1 of 1 (latest)

opal cloak
#

Hello, yes there are events for all of those except for maybe the reminder before the auto-renew

trim marsh
opal cloak
#

customer.subscription.updated or invoice.paid would be best for subscription renewal

#

invoice.payment_failed would be best for the payment failure

#

invoice.upcoming for the reminder

#

customer.subscription.updated for upgrade

#

And customer.subscription.deleted for cancelation

trim marsh
#

How can I test and trigger that webhooks?

opal cloak
trim marsh
#

And how can i increase and decrease the date of the subscription. Just want to test so I can easily test when any subscription auto renew, exipred etc

opal cloak
#

If that is not quite what you meant, let me know

trim marsh
opal cloak
trim marsh
#

I have trigger an event but where I can see the response that I have printed in the code?

opal cloak
#

Where is your code?

trim marsh
opal cloak
#

Are you running that code in visual studio or somewhere else?

#

It looks like this isn't defined by Stripe, this depends on how/where you are running your code

trim marsh
#

Yes this is visual studio code editor

#

?

opal cloak
#

Right, so unfortunately I don't know where you would see your output. This is your environment

trim marsh
#

I'm asking you where I can see the output of my printed code?

#

How i can check what actually I am getting the response of webhook event

trim marsh
#

?

abstract linden
#

hello

#

You seem to be misunderstanding how webhooks work

#

Stripe's server sends an HTTP request to your server. There's no "browser" or anything in between, so there's no way to just echo things and see them

#

What we recommend is logging to a file if you need to debug, that way you can read the file with logs after a request and debug it. That's what I do in my code ```
$msg = "Got Event: '" . $event_json->id . "' with type '" . $event_json->type . "'\n";
file_put_contents("./log.txt", $msg, FILE_APPEND);

trim marsh
#

Got it

#

Thanks