How to debug PayPal IPN Handler using ASP.NET Trace
What is ASP.NET Trace?
ASP.NET tracing enables you to view diagnostic information about a single request for an ASP.NET page. ASP.NET tracing enables you to follow a page's execution path, display diagnostic information at run time, and debug your application. ASP.NET tracing can be integrated with system-level tracing to provide multiple levels of tracing output in distributed and multi-tier applications.
How to enable ASP.NET Trace in AbleCommerce?
- Edit your Website/Web.config file
- Locate following element in it
<trace enabled="false" requestLimit="10" pageOutput="false" localOnly="true" />
and update its enabled property value to true like below. You will also want to turn off the localOnly option and for best results set mostRecent option to true.
<trace enabled="true" requestLimit="100" pageOutput="false" localOnly="false" mostRecent="true" />
- Save Web.config and if you followed the procedure properly then trace is now availble on your AbleCommerce powered store
Trace should be disabled again once you have completed the troubleshooting.
How to open Trace viewer?
You need to open URL with following pattern in your browser
When you open the Trace viewer you will see trace information for pages that have been recently accessed in your website.
What is PayPal IPN Handler?
PayPal IPN handler is a special callback page that's been called by PayPal to inform about different transactions. For example when some one uses Pay Now button to pay an order and fulfills the payment upon PayPal website. Then against that transaction PayPal sends the notification to IPN Handler with transaction data to give us a chance to update order data in our store depending upon the results of transaction made by customer.
In AbleCommerce powered stores the URL of IPN Handler is
How to debug PayPal IPN Handler?
First of enable ASP.NET tracing as described above. Once tracing is available then better to put PayPal in sandbox environment by choosing sandbox option on PayPal gateway screen in AbleCommerce merchant side. You can test the PayPal in live mode too but sandbox is the preferred one because its specifically for testing purpose. All the payments stuff/card details etc would be for demo purpose nothing real. Then try checking out with some items in cart, upon payment step choose PayPal as payment method and checkout. Then it will take your receipt page where you will see Pay Now button. Before using the PayNow button it would be better to open the trace viewer and clear all previous records from it using clear option. Then use Pay Now button, complete the payment on PayPal website. Once you are done with payment then open the trace viewer.
- If you see an entry in trace viewer for ProcessPayPal.ashx, then it means that PayPal is able to access your IPN Handler.
- If you see transaction data information in page then it means that PayPal is successfully sending transaction information in IPN. You can use this information to confirm that certain information is available in IPN message or not.