Am I missing something?

Describing the process in a few words:
1. I created a subscription product normally
2. logged out of the site
3. added the product on my cart as an anonymous user
4. checked out using Paypal WPS (with a sandbox account)

everything seemed normal.

Logged back in with the admin account and checked to see the users list, My test user wasn't assigned the role it should have.

On the module description it says that "you may have to write some glue to make things work"
Any chance we get a bit of glue?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aristeides’s picture

Forgot to mention some additional tasks performed:
As the guest user checked e-mail and confirmed the user account
As user 1 checked the order, changed its status from pending to processing then completed.
Ran cron 2-3 times just to be sure

Still no change... the role is NOT assigned to the user.

Can anyone PLEASE help by pointing me to the right direction?

rupertj’s picture

Status: Active » Postponed (maintainer needs more info)

You should have everything you need for this in the module :) No glue required, hopefully. The only thing I can think of that's outstanding is a nice GUI we've made for subscription product creation.

We did have issues with PayPal being particularly unhelpful and not firing the IPN on their sandbox all the time. If you can try it with a live account, have a go. If I were you, I'd start by adding some logging (watchdog, error_log, whatever you find easy) inside commerce_subscription_paypal_ipn() - dump out $transaction and see what (if anything) you get.

bofrost’s picture

I tried this with real paypal Accounts and still nothing will happen.
Do you have any kind of documentation or forum or something similar to get more in deep with the concept of the module.
I would give you a hand to go further with this module than I think it is really necessary for Commerce Projects.

keithm’s picture

Status: Postponed (maintainer needs more info) » Active

Same symptom here. Installed Commerce Kickstart, enabled all required modules separately, then enabled commerce_subscription. It will create a subscription product and sell it but apparently nothing else. I've completed a sale with a Paypal sandbox where the IPN is correctly received and payment recorded by Drupal Commerce. The commerce_subscription table always remains empty.

When creating a product, a record is created in commerce_product with a type of 'subscription'. I assume there should be a 'subscription' product type in the commerce_product_types table but there isn't.

I tried to understand the module better by running the tests but I wasn't successful. See #1274606: Commerce subscription tests don't run.

Please let me know if there's anything else I can check.

David D’s picture

Any developments with this issue?

saffiresea’s picture

I've tried several things and I still can't figure out how to get a role assigned to users (authenticated user > member).

I've been using real Paypal accounts just to make sure I didn't run into any problems with the sandbox. Everything looks fine with Paypal. Recurring subscriptions work great.

I made sure I enabled Role Reference before Commerce Subscription so I wouldn't get an error.
I set the Order State to go to Completed rather than Pending in Store > Config > Checkout Config > Checkout Rules.
I went into the field settings of the Subscription Recurs field and hit save so the settings for the check box wouldn't disappear.
I uninstalled both modules and deleted the Role field before trying each of these:
I went into the field settings of the "Role" field and clicked the check box for the role I want to assign to users.
I tried reinstalling both modules with this patch for Rolereference: http://drupal.org/node/1280532 ("Allow any role to be referenced if none are explicitly selected".

Any ideas?

webadpro’s picture

@saffiresea: When have you downloaded the dev? Because I think in the last dev, some changes has been applied.

The way the process works is as following.

1- Payment Processes
2- Paypal sends information back to your site and if everything worked, then it will assign a role. If the site cannot get the response from paypal, then no role will get assigned.

saffiresea’s picture

I have the latest from October 18th.

webadpro’s picture

in your db reports can you check if you see: commerce_subscription IPN Process with all the informations?

saffiresea’s picture

There weren't any rows in the tables, and that helped me figure it out. I had .htaccess set up to require a username and password, and that must have been preventing communications.

Now I'll just test to make sure the user role recurs then is revoked on schedule.

kpojeta’s picture

I'm having this same issue - no roles assigned. I checked my db, both commerce_subscription and commerce_paypal_ipn - both have what appears to be complete data but I'm also not entirely sure what I should be looking for....?

I'm using a LIVE paypal account for testing. I have the dev versions of all modules as of today, 01/04/12.

As a side note, after I go through paypal and pay, the return to site link always results in page not found (testing as anonymous user but permissions are set to allow to view own orders). Are the two errors related?
Page not found URL: */checkout/12/payment/return/LBKVcS1a8gqkmXDjLDO1HT1USj4Wj3pWz4B_jQiBmbI

Thanks for any more advice/guidance/help on this...

webadpro’s picture

Kpojeta: Does your site receive the Paypal IPN?

kpojeta’s picture

In my database, it does have the commerce_subscription table with data - but all info in UID column is marked as 0 - so I think that's the issue, just not sure how to resolve it. I would think Paypal isn't properly sending the UID back to Drupal so the role can get assigned...

artatac’s picture

same here and I forced the order status from pending to completed - still nothing

demos’s picture

http://drupal.org/node/1440122 overlaps with this issue at least in part. I also get the "Notice: Undefined property: stdClass::$subscription ..." error from that post, and don't have a solution to that. However, comment #13 here helped me to track down when and why the roles are assigned properly.

When a user makes a purchase while they are not logged in (whether they have an account or not) the entry to the commerce_subscription table is written with the anonymous user's uid (0). This entry is made before the shopping cart redirects to Paypal for payment, and therefore before the proper user id can be determined (or even created in the case of a new account). This entry is used to assign the proper role to the purchaser once IPN notifies that payment is complete. As it stands now, the system tries to assign the anonymous user the role (and fails to do so).

I have attached a patch that reassigns the uid of the commerce_subscription entry when processing IPN. This is probably not the best solution, but it works.

If you don't want to use the patch, another work around would be to use a rule that checks for the product and assigns the role on checkout complete.

dewolfe001’s picture

I have tried to make the role setting work. I checked out the Drupal Commerce site for threads. There are threads started there on the topic, but no follow-up or resolution. This is one of those use cases where UC has it working and Commerce is nowhere close.

FranCarstens’s picture

This module in its current form is unusable, but needed. In the hopes of seeing improvements I'm subscribing to this thread.