How to write an ASP.NET application with PayPal IPN integration and Instant Delivery of Digital Goods functionality RRS feed

  • Question

  • User-1659924024 posted

    There are several good articles on how to write ASP.NET application to integrate PayPal into a website. Some examples include: Introduction to PayPal for C# - ASP.NET developers and Paypal Integration Code: Using ASP.Net / C# 

    I want to extend these codes to include the code for instant delivery of digital products as follows: After the user is sent back to my site from PayPal and my code receives the payment confirmation from PayPal via PayPal IPN, my code should be able to send an email to the user with a serial number for my digital good (a software) and a download link that my code should have the capability to set the expiration time on etc.

     Could someone please guide (code samples, links to articles, documentation etc.)?


    Sunday, November 7, 2010 3:15 AM

All replies

  • User1508394307 posted

    Have you look already at PayPal - 1) Instant Payment Notification Guide (PDF) 2) code samples ?

    Sunday, November 7, 2010 8:50 AM
  • User-1659924024 posted

    Thank you for your response. Yes, I have looked at the PayPal documentation and code samples. These only demonstrate the back and forth response from PayPal - and not the instant delivery part: A) How to send an email to the user with a link to the download and serial number of a digital product after his/her payment has been confirmed by PayPal. B) How to make sure that the URL to the download expires after a certain time period.


    Sunday, November 7, 2010 2:18 PM
  • User1508394307 posted

    Well, this has nothing to do with PayPal, because it must be done on your side. After you got confirmation regarding payment, you should 

    1) generate unique url
    2) save url and date/time to a database
    3) send an email
    4) in url check if it is valid (not expired) and redirect to download 

    An url can be simply generated using System.Guid.NewGuid() in the following way


    where in download.aspx you should check if id is in the database and date/time is still valid...

    Sunday, November 7, 2010 2:34 PM