How to enable a payment method as soon as an order is saved in Drupal commerce programmatically? I am trying to create a membership site using Drupal commerce. I have created a custom form that collects all the billing details of the user and the membership type and then on submit creates and saves a Drupal commerce order (products have already been created).  

Now I want to activate the payment system for the order as soon the order is saved but I have not been able to do so. All of this should be happening in the backend and I do not want to redirect the user to a payment page. How do we do that?
To get it to go onto the review page you can do.

$order = commerce_order_new($uid, 'checkout_review');


When creating your order that sets the status to checkout_review.

Then you can use the following to driect yourself to the page

drupal_goto('checkout/' . $order-&gt;order_id. '/review');


As the status has been set you go to the review page. I did something similar recently and it is working well.