+ Start a Discussion
PugetSoundJimPugetSoundJim 

Need help troubleshooting. Apex class not logging when being called as a Rest WebService by PayPal IPN service.

Transitioning a charity from its previous payment processor to PayPal.  Donor transactions work perfectly fine.  For clarity, the donation transactions do not touch Salesforce.  I'm utilizing PayPal’s Instant Payment Notification service to populate Salesforce.

I have created and set up an Apex class I’ve called IPNHandler to respond to incoming IPN calls to a configured site which allows for anonymous authentication, since IPN doesn’t have a way to configure authentication to your IPN listener (AKA Apex Class).  The class basically responds to the incoming call, validates it with PayPal and should create a custom object record with the IPN message to be processed later using flows.

In PayPal, I can see that the messages are being successfully sent to Salesforce and validated.  On the Salesforce side however, the custom object is not being populated.  (Yes, for the guest profile being used by the site, I have given read/create access to the custom object and enabled Apex Class access to the IPNHandler class.)

Furthermore, I have set up debug logging for the class both through the Developer Console and the Setup Menu, but no logs are being created even though I am simulating donations which get queued up and then sent through the IPN service.  So obviously PayPal's IPN service is reaching out to Salesforce and recieving the required response which could only have happen if the Apex call was successful.

Does anyone have any thoughts?
vijay kumar kvijay kumar k
Hi Jim

I'm suggesting you cross-check the below points
1.Check which endpoint URL you trying to call  REST Service from PayPal
2.In which user based your authenticating to salesforce. Check that the user profile having all permissions(Apex Class, Connected App, etc).
3.Enable debug log trace for that user during the testing period.
4.Test your endpoint URL using postman or any other API tools.

Let me know if you still facing the same issue and for that kindly attach some reference screenshots.

Regards
Vijay
PugetSoundJimPugetSoundJim
Hi Vijay - 

Thanks for the response.  Regarding your suggestions, I did attempt all of them prior to posting and as I mentioned I could tell that the IPN service was communicating with SFDC.  

I have figured out the issue was my Apex was parsing the data incorrectly and I misunderstood that when setting up trace for a class or trigger it would generate logs.  It does not.

Cheers.  Happy New Year.

Jim