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:
https://i.sstatic.net/Lbiow.jpg
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
https://i.sstatic.net/UsxWa.jpg
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...?)