function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mahesh GorrepatiMahesh Gorrepati 

I created apex class with @RestResource. And @HttpPost method to use this code as Resource as the webhook URL, but the class is not invoking ,please help here

CLASS:- 
  @RestResource(urlMapping='/Razorpay/*')
global class WebhooK_for_RazorPay 
{
    
@HttpPost
    global static void ResponseFromPaymentLInk()
    {
        
        
        RestRequest request = RestContext.request;
        system.debug('The request '+  request );
        RestResponse response = RestContext.response;
           system.debug('The response '+  response );
        
    }
     
}

Webhook URL:- https://techforceservices18-dev-ed.develop.my.site.com/services/apexrest/Razorpay

used in Razorpay 
SwethaSwetha (Salesforce Developers) 
HI Mahesh,
I'd suggest these troubleshooting steps:

> Can you confirm that the HTTP method used in your webhook request is a POST request, as you have annotated the method with @HttpPost.

>Also cross check that your webhook provider is sending the request using the POST method to the correct URL.

>Add system.debug statements to the ResponseFromPaymentLink() method and also check if any errors or exceptions are being logged when the webhook is triggered.

> Test the webhook using a third-party tool like Postman or cURL, to simulate a webhook request with the necessary payload and headers to your webhook URL. This way, you can isolate if its an issue with webhook configuration or salesforce.

If this information helps, please mark the answer as best. Thank you
Mahesh GorrepatiMahesh Gorrepati
Hi Swetha, ---> I did the troubleshooting 1. Yes it is sending the POST Request 2. id is sending the correct url 3. The ResponseFromPaymentLink() method is not invoking 4. i used another open webhook URl which is getting the request payload mentioned in the Integration docs :- https://webhook.site/e884e632-6206-4d08-9a02-af6234021eb1 the RestResource is not invoked
Mahesh GorrepatiMahesh Gorrepati
Hi Swetha,


---> I did the troubleshooting 
       1. Yes it is  sending the POST Request 
       2. id is sending the correct url
        3. The  ResponseFromPaymentLink()  method is not  invoking
        4. i used another open webhook URl  which is getting the request payload mentioned in the Integration docs
                   :- https://webhook.site/e884e632-6206-4d08-9a02-af6234021eb1
                    
the RestResource is not invokedError when creating the Webhook