diff --git a/payment/uc_payment/uc_payment.admin.inc b/payment/uc_payment/uc_payment.admin.inc index d5891e4..9dd5de2 100644 --- a/payment/uc_payment/uc_payment.admin.inc +++ b/payment/uc_payment/uc_payment.admin.inc @@ -111,90 +111,6 @@ function uc_payment_method_settings_form($form, &$form_state, $method_id) { } /** - * Selects a specific gateway when multiple gateways are available. - */ -function uc_payment_gateway_select() { - - // Find the available gateways. - $gateways = _uc_payment_gateway_list($_SESSION['uc_payment_method'], TRUE); - foreach ($gateways as $id => $gateway) { - $options[$id] = $gateway['title']; - } - - // Construct form for selection of a gateway. - $build['instructions'] = array( - '#markup' => t('Please choose a payment gateway to use for that payment.'), - ); - - $build['form'] = drupal_get_form( - 'uc_payment_gateway_select_form', - $options, - $_SESSION['uc_payment_method'], - $_SESSION['uc_payment_order_id'], - $_SESSION['uc_payment_amount'], - $_SESSION['uc_payment_data'] - ); - - return $build; -} - -/** - * Form builder: Selects a specific payment gateway. - * - * @see uc_payment_gateway_select_form_submit() - * @ingroup forms - */ -function uc_payment_gateway_select_form($form, &$form_state, $options, $method, $order_id, $amount, $data) { - $form['method'] = array( - '#type' => 'hidden', - '#value' => $method, - ); - $form['order_id'] = array( - '#type' => 'hidden', - '#value' => $order_id, - ); - $form['amount'] = array( - '#type' => 'hidden', - '#value' => $amount, - ); - $form['p_data'] = array( - '#type' => 'hidden', - '#value' => $data, - ); - $form['p_selected'] = array( - '#type' => 'select', - '#title' => t('Use gateway'), - '#options' => $options, - '#default_value' => variable_get('uc_payment_' . $method . '_gateway', ''), - ); - $form['actions'] = array('#type' => 'actions'); - $form['actions']['submit'] = array( - '#type' => 'submit', - '#value' => t('Process'), - ); - - return $form; -} - -/** - * Submit handler for uc_payment_gateway_select_form(). - * - * @see uc_payment_gateway_select_form() - */ -function uc_payment_gateway_select_form_submit($form, &$form_state) { - unset($_SESSION['uc_payment_method']); - unset($_SESSION['uc_payment_order_id']); - unset($_SESSION['uc_payment_amount']); - unset($_SESSION['uc_payment_data']); - - uc_payment_process_payment($form_state['values']['method'], $form_state['values']['order_id'], - $form_state['values']['amount'], unserialize($form_state['values']['p_data']), FALSE, - $form_state['values']['p_selected']); - - $form_state['redirect'] = 'admin/store/orders/' . $form_state['values']['order_id']; -} - -/** * Displays a list of payments attached to an order. * * @see uc_payment_by_order_form_validate() diff --git a/payment/uc_payment/uc_payment.module b/payment/uc_payment/uc_payment.module index 8755070..93d4ca1 100644 --- a/payment/uc_payment/uc_payment.module +++ b/payment/uc_payment/uc_payment.module @@ -37,13 +37,6 @@ function uc_payment_menu() { ); $items += rules_ui()->config_menu('admin/store/settings/payment'); - $items['admin/store/orders/%uc_order/payments/select/%'] = array( - 'title' => 'Select payment gateway', - 'page callback' => 'uc_payment_gateway_select', - 'access arguments' => array('view all orders'), - 'type' => MENU_CALLBACK, - 'file' => 'uc_payment.admin.inc', - ); $items['admin/store/orders/%uc_order/payments'] = array( 'title' => 'Payments', 'description' => 'Show payments made against an order.', @@ -418,14 +411,8 @@ function uc_payment_process_payment($method, $order_id, $amount, $data = NULL, $ $gateway = $gateways[$selected]; } else { - // Otherwise store the info that was passed to us in the session and - // redirect to a form where we can choose a payment gateway. - $_SESSION['uc_payment_method'] = $method; - $_SESSION['uc_payment_order_id'] = $order_id; - $_SESSION['uc_payment_amount'] = $amount; - $_SESSION['uc_payment_data'] = serialize($data); - - drupal_goto('admin/store/orders/' . $order_id . '/payments/select/' . $method); + // No gateway available. + $gateway = array($method => ''); } // Check to see if the function exists and process the payment.