Hello,

I'm trying to assign roles after a new user registers and completes the purchase process. I'm using PayPal module as a payment method. I'm able to complete checkout process:
1. add product to a cart
2. register as a new user and continue checkout
3. make PayPal payment
4. login to Drupal as a new user

However, new user doesn't receive the roles selected in the 'Role assignments' section on the Product when payment is received.

I'm using 'Non-Shippable Product' product type with the following features:
- Anonymous purchases (selected by default)
- User Creation
- Role Assignment
- Recurring Products

I want new users to register so I'm using 'Registered' option as store's 'Anonymous purchasing policy'.

I'm not sure what I'm doing wrong here. I'm not getting any code errors so it seems like this might be some configuration issue. Am I missing anything here?

Thanks for your help.

Comments

gordon’s picture

Status: Active » Postponed (maintainer needs more info)

Quick question:-

After the payment was made, is the workflow status of the transaction set to complete?

If not does the role get assigned when you edit the header and change the workflow to complete?

glakomy’s picture

Good question.

When I go to Administer > e-Commerce > Overview and try to see 'Completed' orders, I'm getting the following error message:

* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''6'' at line 1 query: SELECT COUNT(DISTINCT st.txnid) FROM ec_transaction st LEFT JOIN ec_receipt_allocation era ON era.type = 'transaction' AND st.txnid = era.etid WHERE st.workflow '6' in /usr/share/drupal5/includes/database.mysql.inc on line 172.

    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''6' GROUP BY st.txnid ORDER BY st.txnid DESC LIMIT 0, 50' at line 1 query: SELECT DISTINCT st.txnid,st.*,IFNULL((st.gross - SUM(era.amount)), st.gross) AS balance FROM ec_transaction st LEFT JOIN ec_receipt_allocation era ON era.type = 'transaction' AND st.txnid = era.etid WHERE st.workflow '6' GROUP BY st.txnid ORDER BY st.txnid DESC LIMIT 0, 50 in /usr/share/drupal5/includes/database.mysql.inc on line 172.

However, when I go to 'Monthly Orders', I can see all created users/orders with workflow status set to 'completed'. It doesn't change anything if I try to Edit Header and update transaction again.

Greg.

glakomy’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

I want to mention that I'm using 'Sandbox settings'.

Have anyone tried using 'role assignment' at completed transaction?

Thanks,
Greg.

gordon’s picture

If you are using the sandbox from behind a firewall the IPN will not get called, so you need to use the other method PDT which will update the status of the payment.

You could also use PayPal Express instead of the basic method

glakomy’s picture

I'm using PDT and the transaction status is being updated to 'completed'. However, user roles are not being assigned.

Greg.

jough’s picture

I'm having the same issue.

Another thing I've noticed is that while the workflow status is set to "complete" the "Owing" column in the order history shows the transaction as "Unpaid" even though the transaction completed successfully.

Are there any fixes or workarounds for this?

gordon’s picture

Status: Active » Fixed

Yes this has been fixed in 4.x-dev and 3.x-dev and will be included in the next release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.