Change Order Status on Custom payment Method transaction success?
I have created a custom payment method and I am using userpoints for payments instead of currency payments. There is no off-site or credit card payments, the user will pay from his points(Lets say it as points payment through my custom payment method).
Now, everything works fine. But the order created is always in "Pending" status after points payment transaction success.
How do I change the respective order status to "Completed" on successfull payment transaction which is made through my custom payment method.
Comments
thanks, Your Answer helped me. But I will have another payment method also available in the system. So I created another rule on checkout completion event with a condition(Which will not affect the other payment method workflow) and added a action to update the order status.
yes, thats the right way. ;)
This doesn't work for me. The order status remains pending. Is there anything wrong with my rule:
{ "rules_update_order_status_when_paid_in_full" : {
"LABEL" : "Update order status when paid in full",
"PLUGIN" : "reaction rule",
"WEIGHT" : "5",
"REQUIRES" : [ "commerce_order", "commerce_payment" ],
"ON" : [ "commerce_payment_order_paid_in_full" ],
"IF" : [
{ "commerce_order_contains_product_type" : {
"commerce_order" : [ "commerce_order" ],
"product_type" : { "value" : { "tutoring" : "tutoring" } },
"operator" : "=",
"value" : "1"
}
}
],
"DO" : [
{ "commerce_order_update_status" : { "commerce_order" : [ "commerce_order" ], "order_status" : "completed" } }
]
}
}