Tags/topics: 
2
Answers
Vote up!
0
Vote down!

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.

Asked by: sathishdevan
on March 8, 2013

2 Answers

Vote up!
1
Vote down!

Hej!

Try rules.
There must be a rule commerce_checkout_order_status_update.
That is by default set to "pending".
If you have no other payment methods, set that from pending to completed.

greetz, Marc :)

Answer by: dasmoermel
Posted: Mar 8, 2013

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.

- sathishdevan on March 8, 2013

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" } }
]
}
}

- arnoldbird on October 3, 2013