Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Payment
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2020 at 09:32 UTC
Updated:
17 Feb 2022 at 09:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mbovan commentedThis is a snippet I had in mind.
I am not sure whether it makes sense to introduce new permission just for the label. The administrative permission and
manage own commerce_payment_methodwork for us.Comment #3
berdirYeah, not sure about the permission to use here, but +1 on the approach, I think being able to see the gateway label is useful in a lot of cases.
Possibly a more common permission would be sufficient, or a dedicated view gateway label one if we want to be sure to not affect anything else. Lets see what @bojanz thinks :)
Comment #4
bojanz commentedI'd lean more towards reusing an existing permission, like this patch does, since I consider the payment gateway label to be non-sensitive. There's a frequent need to show it around. However, it will need to wait until after 2.17.
Comment #5
waspper commentedTested patch from #2, and it works fine for label. The only drawback is, it doesn't do the same for gateway ID. This last one could be useful for Views where we would want payment gateway ID to be used as CSS class to display an icon (theming).
Comment #6
johnpitcairn commentedFor gateway ID, does the access operation need to be "view", not "view label"? We implement
hook_commerce_payment_gateway_access()to allow viewing the rendered gateway entity in views (which just gives you the label anyway), and we use a custom permission for safety. Interestingly, that same hook doesn't appear to work to override the "view label" operation, which I would prefer.Comment #7
bakopTested patch from # 2 and it was exactly what i need. Now i can display the payment gateway field in view.
Comment #8
bakopComment #9
zambrey commented#2 works in my case as well.
Comment #11
jsacksick commentedWent ahead and committed the patch from #2, thanks everyone!