[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to test paypal IPN locally or on sandbox in asp.net

Posted on 2011-10-02
1
Medium Priority
?
842 Views
Last Modified: 2012-08-13
Once a user fills in registration form  clicks the register button i want to store the user info in the database with user status as inactive which will become active once i get IPN verification status from paypal. I m using BuyNow button. Its my first paypal integration. My first question is, if this model is okay i.e. keeping details in the database until IPN verfiication. Secondly how can i test it on sandbox or locally.  As we have to specify a return URL to recieve IPN notfication

I m struggling with the paypal integration and will greatly appreciate any help.
0
Comment
Question by:mmalik15
1 Comment
 
LVL 18

Accepted Solution

by:
Gary Davis earned 2000 total points
ID: 36899575
Your idea of creating a record prior to completed payment is OK, especially if there is specific information needed that you would not received in the IPN message. You will wind up with unpaid records in the table, of course but you can deal with that as needed.

PayPal does have an IPN tester which will send an IPN to your url as long as it can get to it. If you are inside a firewall or require authentication to your server, it may not work. In that case, you will have to use your own test page to send to the IPN.

Normally, the IPN does not display anything to the Response but you can if you are testing - If PayPal receives content, it will ignore it. It is really only looking for an HTTP 200 response.

I also recommend your IPN log all incoming IPN messges as the first step - to the database or filesystem. The IPN is the ideal place to send emails to you or your customer as well as update the database. For safety, you may want to enclose the entire code within a try/catch and the traps should be logged/emailed.

The PayPal sandbox can be used for testing. The IPN will receive a test-ipn flag you can use in the IPN code to affect processing (like flag the registered user as a test-user or whatever).

Gary Davis
Webguild.com
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month20 days, 1 hour left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question