t('Balance: @balance', array('@balance' => uc_currency_format(uc_payment_balance($order)))));
if (user_access('view payments')) {
$build['view_payments'] = array(
'#markup' => ' (' . l(t('View'), 'admin/store/orders/' . $order->order_id . '/payments') . ')',
);
}
$method_name = _uc_payment_method_data($order->payment_method, 'review');
if (empty($method_name)) {
$method_name = _uc_payment_method_data($order->payment_method, 'name');
}
$build['method'] = array(
'#markup' => t('Method: @payment_method', array('@payment_method' => $method_name)),
'#prefix' => '
',
);
$func = _uc_payment_method_data($order->payment_method, 'callback');
if (function_exists($func)) {
$method_output = $func('order-view', $order);
if (!empty($method_output)) {
$build['output'] = $method_output + array(
'#prefix' => '
',
);
}
}
return $build;
case 'customer':
$method_name = _uc_payment_method_data($order->payment_method, 'review');
if (empty($method_name)) {
$method_name = _uc_payment_method_data($order->payment_method, 'name');
}
$build['method'] = array('#markup' => t('Method: @payment_method', array('@payment_method' => $method_name)));
$func = _uc_payment_method_data($order->payment_method, 'callback');
if (function_exists($func)) {
$method_output = $func('customer-view', $order);
if (!empty($method_output)) {
$build['output'] = $method_output + array(
'#prefix' => '
',
);
}
}
return $build;
case 'edit-form':
$methods = _uc_payment_method_list();
$options = array();
foreach ($methods as $id => $method) {
$options[$id] = $method['name'];
}
$form['payment']['payment_method'] = array(
'#type' => 'select',
'#title' => t('Payment method'),
'#default_value' => $order->payment_method,
'#options' => !empty($options) ? $options : array(t('None available')),
'#disabled' => empty($options),
'#ajax' => array(
'callback' => 'uc_payment_order_pane_ajax_callback',
'progress' => array('type' => 'throbber'),
'wrapper' => 'payment-details',
),
);
$form['payment']['payment_details'] = array(
'#tree' => TRUE,
'#prefix' => '