You need to configure ASP.NET profiles to register subscribers . This allows you to store additional data for each user in the database after they have been verified through IPN. Before sending data to PayPal, you can create a GUID to associate an order with a registered user.
If you are using an ASP.NET website project template, you have profiles out of the box. If you are using an ASP.NET Web Application project template, you can use Web Profile Builder to configure profiles:
http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx
Here is another cool way to do this:
http://leedumond.com/blog/asp-net-profiles-in-web-application-projects/
To associate a payment with a username on your site, the life cycle will be as follows:
1) Use PayPal Subscriptions to process the initial free period :-)
2) The user subscribes to your site and goes to the PayPal site.
3) IPN class handshake using PayPal and capturing the values ββreturned by PayPal
4). The IPN class updates your application database and generates an email to the subscriber with a return URL to register with your site.
5). The IPN class generates email (backup) for the seller with the subscription data.
6) The subscriber creates a user account on your site and sets up any additional information about the members that you want to save in your profile
protected void Createuserwizard1_CreatingUser(object sender, EventArgs e) { WebProfile p = WebProfile.GetProfile(CreateUserWizard1.UserName, true); p.Initialize(CreateUserWizard1.UserName, true); p.subscriberID = ViewState["SubscriberID"].ToString(); p.subscriberExpireDate = ViewState["ExpireDate"].ToString(); p.Save(); }
Some Gotchas:
Do Not Use PayPal Return URL
Do not mix IPN and PDT . IPN is all you need
Remember the Save () method when creating the profile: -S