Create Orchard Account After Successful Paypal transaction?

Topics: Customizing Orchard, Writing modules
Sep 22, 2012 at 12:56 AM

I have a client that would like to automate the process of their clients getting access to their "special content" by offering them instant access to it after they check out.  

Currently they want to use a Paypal "But It Now" button which will redirect to a "success" page after it's complete.  Initially, they will say "we'll create your account shortly" but eventually they want to automate that.

I believe paypal will post back a number of details back to that same page which I suspect is the start of what I would need to then have a module loaded on that page that reviews that data and creates an account for them.  I suspect I would also need to take transaction ID's etc from the server side and make an API call to paypal to validate the ID.

Anyone do anything similar?  Any .Net wrappers around the paypal interface that you have used before?

I've obviously searched for a module and did some google searches and found a page that seems to be pretty straight forward:

http://www.codeproject.com/Articles/42894/Introduction-to-PayPal-for-C-ASP-NET-developers#PostPayment

The second piece of course is the account creation process in orchard upon that validation.  It would need to create a new user likely a custom variable based through the paypal transaction, it would use the email from paypal and generate password that will change on first login.

Anyone have any simple code to do this behind the scene in a module?

Coordinator
Sep 22, 2012 at 6:16 PM

Just look at the code in Orchard.Users. Users are content items, so you can use Content Manager to create them, retrieve them, modify them, etc.

Sep 22, 2012 at 6:25 PM
I'll take a look and ask one more follow-up question. Can I also associate them to roles using this same method?

Sorry for the basic questions, I'm a content creator, admin expert and themer before I'm a coder.

On Sat, Sep 22, 2012 at 12:16 PM, bertrandleroy <notifications@codeplex.com> wrote:

From: bertrandleroy

Just look at the code in Orchard.Users. Users are content items, so you can use Content Manager to create them, retrieve them, modify them, etc.

Read the full discussion online.

To add a post to this discussion, reply to this email (orchard@discussions.codeplex.com)

To start a new discussion for this project, email orchard@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com




--
John B Fraser
Core
952-261-6974


Coordinator
Sep 22, 2012 at 6:27 PM

Yes, roles are provided to users through a part that gets welded to the user type. See Orchard.Roles.

Sep 25, 2012 at 4:28 AM
Edited Sep 25, 2012 at 4:29 AM

I have a .NET Paypal API that has pretty much all you would need to do an express checkout. It is contained in an Orchard module that I wrote but can be used separately. The module is designed to sell digital goods directly (as downloads) after a successful payment, but you could look at how my API calls and talks to paypal as well as the javascript that makes the experience seamless and sweet. The module and Paypal API allow for you to test everything out in the Paypal sandbox as well (before you go live). You really need more than just the Paypal API (in a .NET wrapper), you need to see how the controller and javascript work together to create the checkout experience. My module unfortunately does not involve roles, so the trigger of role privileges you would have to do on your own after the payment is complete, but I think most of what you want is there, and certainly the Paypal specific parts. Unfortunately, because this code is directly used for profit in most cases, it is not free. If you want to create your own solution, check out the Paypal API at developer.paypal.com.

I almost forgot : module is at http://www.rexcardan.com/payfile

Nov 22, 2012 at 12:28 AM

Doesn't PayPal allow anonymous purchases without having to log in? From a capture perspective, I think you might loose clients if you don't give them the three (3) options you normally see on PayPal (Anonymous purchase (no sign in), Sign In, Register).