How to create a payment form / pane directly from order_id Study case : customers already have the ability to pay only a deposit. So they 'll have to come back and pay the order balance later.

How can I create a payment form ?


where they will be able to directly submit a payment form and proceed to off-site payment to pay order balance
without coming from cart/checkout process, (as it has already be done in deposit payment another day)


This will be linked from the user/%/orders/% page. 

Is there any commerce API function that could fit that issue ?
I had a look at commerce_payment_order_transaction_add_form($form, &amp;$form_state, $order but I could not find any doc to implement it, .

Thank you

PS : related issue: Commerce partial payment
I got it doing the following :

with a link in user/%/orders/% page like go_to_checkout/$order_id

/**
 * Implements hook_menu();
 * Callback to pass order_id to checkout fn
 */
function commerce_partial_payment_menu() {

  $items['go_to_checkout'] = array(
    'title' =&gt; 'balance',
    'description' =&gt; 'Pay order balance',
    'page callback' =&gt; 'commerce_partial_payment_redirect_to_checkout',
    'page arguments' =&gt; array(1),
    'access arguments' =&gt;  TRUE,//still have to change that, maybe see own orders permission
    'type' =&gt; MENU_CALLBACK,
  );

  return $items;
}

/*
 * Prepare checkout process and redirects to checkout/%/review 
 */
function commerce_partial_payment_redirect_to_checkout($order_id) {

  $order = commerce_order_load($order_id);
  commerce_order_status_update($order, 'checkout_review', $skip_save = FALSE, $revision = TRUE, $log = '');

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