Why does the selected payment method comparison always fail? I'm trying with following simplified rule but nothing happens if using maro_credits as payment method!?

{ "rules_pay_with_maro_credits" : {
"LABEL" : "pay with maro credits",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules_conditional", "rules", "commerce_payment", "commerce_pos" ],
"ON" : { "commerce_pos_transaction_completed" : [] },
"DO" : [
{ "CONDITIONAL" : [
{
"IF" : { "commerce_payment_selected_payment_method" : { "commerce_order" : [ "order" ], "method_id" : "maro_credits" } },
"DO" : [ { "drupal_message" : { "message" : "aklfjaipwoejfipasjfijasdfas" } } ]
}
]
},
{ "LOOP" : {
"USING" : { "list" : [ "order:commerce-line-items" ] },
"ITEM" : { "list_item" : "Current list item" },
"DO" : []
}
},
{ "drupal_message" : { "message" : "test pos event" } }
]
}
}


However the orders in admin - store - orders show up with the payment method, as shown in this screenprint:

http://imgur.com/a/XZeHy

Anyhelp?

Edit:
I used the mentioned selected_payment_method comparison method that pierre referenced below from start on.

cant add more than 2 links, so i have to add multiple pictures like this i guess:
first you see the selected_payment_method input for the version in the actions with conditional and the rule in the view also with what happens

i after changed the rule to use the conditions directly to show that also there it does not work

http://imgur.com/a/5Ekiu

is this more clear now? or you need more specification?

edit2: in the end i added some screens showing the fields that could be found (nothing with payment method)

Edit3:
Ok I added some descriptions in the pictures on imgur to clarify a bit.
In the end I want to be able to subtract user points form users that pay with "maro credits" (that part already works)

As you see in the screenshots I changed the rule having only the event pos transaction completed (that works!)

then condition selected payment method as shown

and action post a message

as you see in following screenshot that does not work (in the orders list you see there is the order with the payment method maro credits

I hope its clear now?

Ah forgot: in the last screenshots you see all the fields I would be able to chose from and there is none with payment method (and i think that is the problem...?)
Part 1 - Getting your rule to work

Try to add a Rules Condition Entity has field to make the appropriate field available for further processing in your Rules. That's also what is mentioned in the Rules UI when you're adding a "data comparison" condition: somewhere it says:


  The data selector helps you drill down into the data available to Rules. To make entity fields appear in the data selector, you may have to use the condition 'entity has field' (or 'content is of type').


Don't believe me (yet) about my recommendation here ... first add an extra Rules Action as your very first Rules Action, to simply display the actual value of that field you try to use within the "If" of your Conditional Rules construct ... Without such "entity has field" Rules Condition, I bet the value of that field will be shown as empty (or blank). Which would then also explain why your "If" always results in a FALSE ...

For a video tutorial that illustrates the importance of this Entity has field condition, refer to Data types and data selection, especially what is shown between about 13:30 and 17:30 in that video.

Note: it's hard to tell from the current content of your question what the exact field (for which to add such Rules Condition) should be in your case. But my best guess is some field about the payment method (possibly method_id?)

Part 2 - Simplify your rule

From the current content of your rule, it seems that you want to perform a Rules Loop as a Rules Action, but only if some condition (the "If" you added using "Conditional Rules" module) is true. And then as the very last Rules Action the rule shows that test pos event message.

If this very last message is just for debugging (i.e if it is not really needed after you get it to work anymore), then it seems to me that you could replace that "If" (added using Conditional Rules) by a regular Rules Condition. And by doing so your rule would not require the Conditional Rules module anymore.

Plan B

As per the comment posted below this answer, you may want to try a completely different approach ... which is based on this commit, and related to issue # 1278156:


Use the Rules Condition Selected payment method comparison, located within the Commerce Payment group.
Check if its value is equal to your 'maro_credits'.