See the response from my webhook

How can i check the response of my webhook endpoint after the payment.update. after payment update my webhook handler not processing the order,and i think an error has occurred but i cant see the response then how do i debug this? can i see what square getting from my webhook handler?

I’m not sure I fully understand the question. What response are you looking for? Whats your application ID? :slight_smile:

thanks for responding, the url square webhook calls after a payment completed. then i have to receive the data sent from square and validate them then get the data of the payment then process the client order. but somehow the order is not processing. i think theres an error in my code which is handling square webhook. this can be problem on validating request,it can be due to sdk loaded or not also can be syntax error. But i cannot check which type of error occuring in my code,since the request process on backend after my user paid and payment.update webhook triggered, also i cannot make fake request with the square webhook like request to see whats going on my function…like on stripe on webhook logs theres a panel that show the response from my webhook endpoint,thats how i know if there any error occured and where the problem is,on the otherhand i cannot figure out…i am new to square so please help me out how can i debug this issue

You can send test webhooks for testing. When you setup the webhook subscription you can click on More and it will allow you to send test events. :slight_smile:

square

i only get to see the response code,it would be better if i could read the response body to see the exact error with error line and error message. now how do i supposed to debug the error with just response code

When you check the webhook logs whats the error message you get? There should be more detailed information there. :slight_smile:

there nothing more, only request data, and response code,not much information about the response

Are you using one of our sample Verify and Validate an Event Notification? If so which one are you using or could you provide us with the snippet that’s not working as expected? :slight_smile:

Some random thoughts that might help with webhook debugging:

Make sure you tuurn on error logging, which should leave a log you can examine to find the issue.

You can often visit the webhook in the browser to trigger errors and possibly see them, depending on config.

You can also jury rig a small proxy that posts with appropriate headers and body, just to allow testing. You could then get that to display any error message going to the display. It just has to do POST with a few headers and that isn’t too hard to code in most languages. The trick here is to get the error messages to go into a file which you can then read. Debugging webhooks is a dog. :slight_smile:

If you’re using PHP, you can detect syntax errors by visiting it in the browser as above or using CLI PHP. Undefined function names are the most common cause of 500 errors in my experience with PHP - they don’t cause syntax errors, hence you get the runtime error.