Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Why are my checkout completion rules executed by the Anonymous user?

Using the action "Create a new entity" on rule "Completing the checkout process" works fine for site admin. When doing the payment process as a different user the entity is created but has author "Anonymous".

Author is set with Data selector "site:current-user" but something seems to go wrong when coming back from Paypal site. Entity is correctly being created using the node/add form so it doesn't seem to be an access rights problem.

Asked by: gerald
on February 20, 2013

Comments

This issue seems to be related to the fact that all actions triggered by checkout rules are processed as Anonymous user. I just filed a bug report for this: https://drupal.org/node/1922318

- gerald on February 20, 2013

1 Answer

Vote up!
3
Vote down!

Your issue is with using the site:current-user token. You've indicated you're using PayPal WPS, so what's happening here is the event is being triggered when the PayPal IPN is processed by the site. This IPN typically arrives before the customer returns from PayPal and accesses the checkout complete page, and of course the IPN will always be processed anonymously.

Instead of depending on site:current-user, you should use the commerce-order:uid token.

Ryan Szrama
Answer by: Ryan Szrama
Posted: Feb 20, 2013

Comments

Thanks, commerce-order:owner did the job!

- gerald on February 20, 2013