Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loginRequired prevents processing on behalf of a user #12

Closed
nateiler opened this issue May 22, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@nateiler
Copy link

commented May 22, 2018

$user->loginRequired();

The assumption here is that the user creating the source is the logged in user, which may not always be the case (ex: CLI, admin operation, etc.)

Looking at the (only usage of) service method that currently calls this, it seems the required $userId could be easily passed thru to the gateway method.
https://github.com/craftcms/commerce/blob/ae4a6c2bdb3b3df0d6846f8866c23619af19d7d0/src/services/PaymentSources.php#L181

@andris-sevcenko andris-sevcenko self-assigned this May 23, 2018

@andris-sevcenko

This comment has been minimized.

Copy link
Member

commented May 23, 2018

Yeah, you're right. It would also help decoupling the gateway from Craft.

@andris-sevcenko

This comment has been minimized.

Copy link
Member

commented May 23, 2018

You'll have to wait till Commerce 2 beta 5 is released, though.

@nateiler

This comment has been minimized.

Copy link
Author

commented May 23, 2018

Thanks Andris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.