PayPal subscriber purchase not completing properly

Posts: 17
Joined: 03/27/2008

Hi.

I'm new to Drupal and everything that goes with it so bear with me. Up to now I've mostly been using Wordpress, but couldn't get it to easily do what I wanted.

Which leads me onto what I'm trying to do - I have been trying to set up a paid membership site and believe I have everything set up for it (at least a very basic setup).

However, when going through checkout and completing the purchase it takes me to PayPal ok (I'm using the PayPal sandbox by the way) and allows me to log in.

Now comes the problem, when I click on the 'Pay' button in PayPal it takes me to a PayPal page with the browser title of 'Page Not Found' and a couple of links 'Click here to retry' (doesn't work) and 'Return to homepage'.

I've tried searching through the forums here and making some changes if it seemed relevant, but nothing helps.

Any ideas? - I'm using Drupal 5.7 with Ubercart 5.x-1.0-beta7

Thanks.
Tim

Posts: 3197
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hey Tim, really hard to say. I'm curious if the URL that's turning up "Page not found" is on the PayPal side or your own domain. If it's not on your side, I don't really know what to tell you. Puzzled

Posts: 17
Joined: 03/27/2008

Thanks for replying.

It appears to be on the PayPal side.

The URL is https://www.sandbox.paypal.com/us/cgi-bin/webscr?SESSION=-xxx&dispatch=b...

Obviously the xxx is actually lots of letters and numbers.

I have seen at least one other poster with the same problem, but he hasn't had any replies I don't think (can't find the thread now!)

Tim

Posts: 17
Joined: 03/27/2008

Looks like this was a PayPal sandbox problem.

I created another live PayPal account to make a purchase from and didn't get the Page Not Found anymore.

However, it didn't return me automatically to the completion page on my site and it hasn't given the new user a 'subscriber' role either.

Also, I expected it to email the new user with their username and password, but it didn't do this - is it supposed to?

I'll start searching other threads to see if I can find anyone with similar problems.

I saw in another thread about a guide for setting this up on PayPal and about having to choose 'Auto Return' and supplying a URL to return to. I also found a response saying that was outdated and it didn't need that anymore. Which is correct?

Tim

Posts: 3197
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I haven't tested the auto return thing in some time, but it was my experience that it just never worked for me. Sticking out tongue Also, if it depends on a static return URL and not the URL passed in from Ubercart I'd avoid it.

Posts: 17
Joined: 03/27/2008

I've now got a little further.

The reason it didn't send out an email after commpletion was that the workflow was set to give it a status of 'Payment Received' once payment had been made, whereas the order needed to be 'Completed' before sending out info.

However, it still doesn't auto return from Paypal and it also still doesn't give the new user the role I've assigned for them once they've purchased.....

Tim

Posts: 17
Joined: 03/27/2008

You have to set up the autoreturn in PayPal to make it return to the site.

The url I used is http://www.yoursite.com/uc_paypal/wps/complete (change 'yoursite.com' to your own url obviosuly).

There are conflicting messages in different threads about whether you need it or not to get it to autoreturn but from my experience, you do need to enter it in the appropriate place on your PayPal account.

So, that's working now, but it still will not give the new user the role that is supposed to be assigned when the order goes to 'Completed'. The new user is created and they can log in, but do not have the 'Subscriber' role that I set up assigned to them.

Also, the auto email that the new user gets states that the password is for one time use only and that on logging in they will be redirected to a page to change it. I know this is not strictly a Ubercart thing but it doesn't do any of that. You can carry on using the sysetm generated password as much as you like. Any idea where to go to enforce what it says in the email?

Posts: 3197
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

The role not getting applied is a problem Shawn recently posted with the code that keeps role and file additions from getting added to new user accounts. I may have to patch this myself, since Shawn isn't working on Ubercart full time any more, but it will get fixed in the near future.

Regarding the e-mail, I'm pretty sure Drupal is referring to the single use login link and not the username/password. You can adjust the messages through the normal user settings form in Drupal.

Posts: 17
Joined: 03/27/2008

OK, thanks Ryan.

So there's not a lot I can do to get round this myself for now?

Tim

Posts: 17
Joined: 03/27/2008

Re. the login, yes, you're exactly right. Now I have read it again that's what it's actually saying, so just me misinterpreting it.

Thanks.
Tim

Posts: 17
Joined: 03/27/2008

I've got round this role assignment thing temporarily.

As users cannot register for the site accept through purchasing a subscription or by me creating them, I have set up a workflow so that when they log in, it checks to see if they have the subscriber role and if not, assign it to them.

Works for now.

--EDIT sometime later--
Spoke too soon, of course all this does is give the user the subscriber role, but doesn't set any expiry date.

Tried looking at the 'Recurring fee' module but it looks like there is no way to set that up with PayPal at the moment and not being a coder, there's nothing I can do about that it seems.

Can't use PayFlow as I am in the UK and the only other module I've found so far is something called lm_paypal but the last release of that was over a year ago!

All in all, I can't see how I'm ever going to get this to work and it seemed such a straightforward thing to do. Very frustrating.

As I'm runing out of time having spent 2 solid days trying to figure this out, I may have to revert to something simple like a Wordpress blog and a separate static part of the site to which access is controlled by the standard PayPal subscriptions setup.

Seems a shame as Drupal/Ubercart seemed to have so much promise.
Tim

Posts: 17
Joined: 03/27/2008

After doing some more reading and searching I decide to give the lm_paypal module a go after disabling all the Ubercart modules.

Looks like it works very well. Certainly interacts with the PayPal subscription feature without a hitch.

The only thing is that the user has to create an account for themselves first before they can subscribe (which then gives them the extra role).

But until Ubercart has the required functionality, I guess this will have to do.

Is it possible that the lm_paypal module (or at least some of the code behind it) could be integrated into Ubercart somehow? that may be a shortcut to adding some new features.

Tim

Posts: 48
Joined: 01/31/2008

"The only thing is that the user has to create an account for themselves first before they can subscribe (which then gives them the extra role)."

Is this pretty automated (changes role once paypal receives payment)? Does it set the expiration date automatically also?

I was going to use uc_role for a project and I'm glad I read this first otherwise I might be stuck also...although I would like to use uc_role since it will give payment option of paypal or check.

Posts: 17
Joined: 03/27/2008

Hi.

Yes, it does change the role once the PayPal payment is received. The flow is this:

You create the subscription in Drupal and put in all the values you want (price, duration, role it gives access to etc.)

New user clicks on 'Subscribe now' menu link.

They are asked to either login or create a new account.

Once they've logged in they have to either click the subscribe menu link again and then click on a link to take them to Paypal or (as I have now done) click on the equivalent of a 'Buy Now' button which I've got in the sidebar (created by the module) which takes them straight to the PayPal login page.

New user logs into Paypal, they will then get the usual screen to confirm purchase. Once they click this it sets up their subscription within Paypal with all the values you defined.

It then returns you to a thankyou page on the site asking the user to log out and back in, they will then have the role which has been automatically assigned to them.

If the user later decides to cancel their PayPal subscription, it will automatically remove the role as well (unless you charge in arrears you may have to manually give them access for the remainder of the time they've already paid for, something I've only just thought of).

So all in all, a pretty nice little piece of integration.

Tim

Posts: 48
Joined: 01/31/2008

Thanks for the info. I have just seen the subscription setting, but is it possible to only charge one time and have an expiration date set for it with lm_paypal? For users who want to pay by credit card (if not set to subscription, paypal has the option to charge by credit card or use paypal account), but obviously also have the option for subscription...

Posts: 17
Joined: 03/27/2008

You can set the subscription up for whatever length of time you want and then set it to not take a recurring payment at the end, so it will just cancel itself.

Does that meet your requirement?

Tim

Posts: 48
Joined: 01/31/2008

I think that'll work. I'll have to play around with it more. Thanks again!

Posts: 48
Joined: 01/31/2008

Sorry - one more question - what do you specify as the return url for lm_paypal? I get a page not found. Other than that, the option for credit card works.

The thing I like about uc_roles is that it gives you a place to set expiration and change it if need to. I guess the lm_paypal will just have to be based on term, but not sure what happens when they cancel. Will it just end on the current term date automatically?

Posts: 17
Joined: 03/27/2008

It's defined in the admin bit called 'LM PayPal Subscriptions Settings' - the default one is {your domain}/lm_paypal/subscriptions_inprogress.

That's the one I've put in as my autoreturn url in PayPal, seems to work fine.

I agree with you re. uc_roles and I would much prefer to be using that, but it just doesn't do the job for me at the moment. As for cancelling, I highlighted that earlier as a bit of a shortcoming of lm_paypal as it cancels it straight away rather than at the end of the current term.

Just have to keep an eye on any cancellations and manually add the role back in.

I'm just trying enabling the Ubercart store, product and role modules so that I can use the role expiry function when adding it manually after a user has cancelled. Seems to work.

Tim

Posts: 17
Joined: 03/27/2008

Update to above.

Using the Ubercart role expiry does work, except if the user chooses to re-subscribe it gives them the subscriber role again but the expiry is still set through the Ubercart module, so you will have to manually remove that.

I would think the situations this occurs would be few and far between, but something to be aware of.

Tim

Posts: 48
Joined: 01/31/2008

That sounds like a good workaround. BTW- since you are doing "some" manual" input, was the main problem you were having with uc_role caused by the subscriptions function?

"IF" that is one of the main thing. Here are the paypal variables and you can change it so that paypal will take it as subscription.
https://www.paypal.com/IntegrationCenter/ic_std-variable-reference.html#...

uc_paypal.module (inside payment) - you can change cmd to 'cmd' => '_xclick-subscriptions', you'll also need to add "a3", "t3", "src", "sra", and "srt".

// PayPal command variable
'cmd' => '_cart',

this will be changing the code and need to be hardcoded for subscription time and such so it may not be such a good idea but it will work at least for the paypal side of it. you'll just need to go in ubercart when you receive payment emails from paypal and extend user's expiration.

If ubercart can add the paypal subscription as an option with options like above (or like the lm_paypal config page), then that would be nice.

Posts: 17
Joined: 03/27/2008

Interesting.

Unfortunately hard coding it like that is not really an option as I want to be able to offer other products and subscriptions, not just the one.

There were several reasons I decided not to use Ubercart exclusively and one reason was indeed it's lack of handling for subscriptions. Also I found (at least in my case) that it wasn't completing the purchase properly and assigning the role I had set up after purchase (look back up in the thread above for details).

Close, but no cigar would be my summary.

Great system though, with great support, just doesn't do quite what I wanted.

Tim

Posts: 48
Joined: 01/31/2008

"If the user later decides to cancel their PayPal subscription, it will automatically remove the role as well (unless you charge in arrears you may have to manually give them access for the remainder of the time they've already paid for, something I've only just thought of)."

How are you keeping tracking of the time left? Are you just checking paypal for the time of signup and using ubercart to set role expiration based on that (I also wish role expiration was something you can just type in the date instead of putting in + or - days/month/year). I wish we would only need to use one thing and not have to go back and forth to make things work.

BTW-have you tried ecommerce?

Posts: 1
Joined: 04/11/2008

today i spend half a day trying to get an user into a subscriber role using ubercart and standard paypal payment method, after lot of test, i did it. the problem is very simple, when users pay at paypal, his/her order pass from "in checkout" to "pending" status, and never arrive to "completed" (i know, when you back from paypal there is a message saying the order is completed, that "complete" is not the order status really), so what i did was, assign the role in "pending" order status. and there is no security risks because the status doesnt change until the user has paid.

i dont know yet why the order remains in pending status, i had tested in ubercart RC2, and the problem persist, maybe this is the desired behavior.

a bit late, but hope can help you.

Posts: 3197
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

This is desired behavior by default so folks can make up their own minds how to process orders. Check out this doc page for information on how order status updates get automated with Workflow-ng. There's a default configuration to handle received payments that just has to be enabled to work.