10 replies [Last post]
David Larsson's picture
Offline
Joined: 09/08/2008
Juice: 18
Was this information Helpful?

Goal

  1. Pay annual membership fee through the site
  2. Anonymous users can buy a new membership through the site (= new user account)
  3. Send members e-mail notifications about pending expiry, renewal,
  4. Confirmations are sent by e-mail (with account info for new members)
  5. Use Paypal Webpayments standards for checkout

What I have done

  1. Installed and Activated Ubercart (with all required modules)
  2. Activated modules:
    • Notify
    • Payment
    • Roles
    • Cart Links
    • PayPal
  3. Follwed instructions in the User's Guide
  4. Follwed instructions for setting up PayPal (http://www.ubercart.org/docs/user/3356/configuring_paypal_website_paymen...)
  5. Follwed instructions setting up roles and product features. (http://www.ubercart.org/docs/user/3366/selling_site_access_role_promotions)
  6. Tested with working e-mail, real adress, real phone, real creditcard, live payment, but small amount (aprox. $0.20)

What happens and problems

  1. Order is payed trough pay pal. I get reciepts, and payment notifications from Paypal
  2. New user account is created. Account details are sent at the same time as the payment receipt.
  3. When I check the order the status i set to complete.
  4. Problem! No role is assigned to the new user.

I knowthere are posts about this already. I have spent at least 4 hours searching and reading both the documentation and the forum. The problem is that most of it does not explain the solution or does not make sense to me or is quite old.

I do have some thoughts about what could have gone wrong, but I need some ideas on how to find out how to test for this. I think it has something to do with the order in the different things happen, aka workflow. In more detail I want to have the new user created after the checkout process. The role should be added to this user after the payment is received. And now the confirmation e-mail should be sent.

I understand this is done in the workflow settings. But honestly, i don't understand very much of that, and I'm not even sure this is the problem.

Grateful for any help
/David

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: No role is assigned to new user

If you're using the latest version of UC, I think a bug was introduced recently that would affect you. I noticed this problem on a live site, and what it amounts to is the default rule configuration in Workflow-ng called Update order status on completed checkout should be triggered by Customer completes checkout, not A payment entered for an order. I'm changing this in core. To change it for yourself, you'll need to manually create the replica or try importing this:

array (
  'cfg_1' =>
  array (
    '#active' => 1,
    '#label' => 'Update order status on completed checkout',
    '#type' => 'configuration',
    '#weight' => '0',
    '#id' => 1,
    '#module' => 'workflow-ng',
    '#event' => 'checkout_complete',
    '#altered' => false,
    0 =>
    array (
      '#type' => 'condition',
      '#name' => 'uc_payment_condition_balance',
      '#id' => 2,
      '#settings' =>
      array (
        'balance_comparison' => 'less_equal',
      ),
      '#argument map' =>
      array (
        'order' => 'order',
      ),
    ),
    1 =>
    array (
      '#negate' => 1,
      '#name' => 'uc_order_condition_is_shippable',
      '#type' => 'condition',
      '#argument map' =>
      array (
        'order' => 'order',
      ),
      '#id' => 3,
    ),
    2 =>
    array (
      '#type' => 'action',
      '#name' => 'uc_order_action_update_status',
      '#argument map' =>
      array (
        'order' => 'order',
      ),
      '#settings' =>
      array (
        'order_status' => 'completed',
      ),
    ),
    '#name' => 'cfg_1',
  ),
)
David Larsson's picture
Offline
Joined: 09/08/2008
Juice: 18
Re: Re: No role is assigned to new user

So I imported the settings. (Even though I don't know exactly the difference.)

I did another test. And woila! I worked!

Thanks!

Next question:

I'm changing this in core.

Does this mean that an update of the UC module would do the same trick? Or do I have to wait for a new version (1.4?)?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: No role is assigned to new user

I just committed it to the version in Bzr (our dev version), so it will be in the 1.4 release when it comes out.

mach5_kel's picture
Offline
Joined: 03/25/2008
Juice: 79
ETA?

Hi Ryan. Do you have a general ETA for the offical launch of 1.4?

When you said import the code above, do you mean in workflows?

(Ive been having the same problem since moving up to 1.3)

Thanks!

a_c_m@drupal.org's picture
Offline
Bug Finder
Joined: 01/02/2008
Juice: 288
Re: Re: No role is assigned to new user

This worked for me too.

BUT.

New users are no longer shown the "Checkout completion for new users: " message and instead get the "Checkout completion for existing users: " message shown to uses who have accounts but didn't log in. I guess this has something to do with changing when the user is created. But could be somthing to watch out for (UC 1.3)

a_c_m

fessio's picture
Offline
Joined: 12/02/2008
Juice: 20
Re: No role is assigned to new user

Hi guys, I've got a similar problem. The difference is that the order status doesn't become 'Completed' and the balance is not zero(it equals the price). I'm using the Sandbox. So I pay with a test PayPal account and everything goes smoothly, when I press return to the Merchant button on the Paypal site, it redirects me to cart/checkout/complete. The user gets created but he has no role, and his order status is Pending. What am I doing wrong? Thanks

Update: What I've done get around this was to create a workflow without conditions, that updated the order status to "Completed". But I'm sure it's so WRONG. Please help.

fessio's picture
Offline
Joined: 12/02/2008
Juice: 20
Re: No role is assigned to new user

With the workaround I mentioned above, the balance of each order is still positive. As far as I understand this means that ubercart was not notified that the payment was successful. Now I'm completely lost... Sad
Update: Sorry for so many posts, but I think I've found the problem. And I don't know how to solve it:
After paying with an anonymous user through PayPal Standard, I went to my order status, it was pending, and in the comments section was the following: "Payment is pending at PayPal: Reason unknown; contact PayPal Customer Service for more information". I will remind you that I'm using Sandbox test server. Help is welcome Smiling

fessio's picture
Offline
Joined: 12/02/2008
Juice: 20
Re: No role is assigned to new user

Ok, I've solved the issue, the problem is that for every transaction I have to login to sandbox with my test seller account and in the order details press "Accept" or "Deny". I wonder if this can be automated. I mean how can I tell paypal to accept all the orders?

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: No role is assigned to new user

I think that's a Sandbox thing. Once you move to Live it should be automated. (Our payments are.)

--
Help directly fund development: Donate via PayPal!

fessio's picture
Offline
Joined: 12/02/2008
Juice: 20
Re: Re: Re: No role is assigned to new user

Thanks for the reply. So does it happen instantly on the live server? If not how long does it take?