You are here

function uc_credit_form_uc_cart_checkout_form_alter in Ubercart 7.3

Implements hook_form_FORM_ID_alter() for uc_cart_checkout_form().

File

payment/uc_credit/uc_credit.module, line 133
Defines the credit card payment method and hooks in payment gateways.

Code

function uc_credit_form_uc_cart_checkout_form_alter(&$form, &$form_state) {

  // Cache the CC details for use in other functions.
  if (isset($_SESSION['sescrd'])) {
    uc_credit_cache('save', $_SESSION['sescrd']);

    // Store the encrypted details to the form for processing on submit.
    $form['payment_details_data'] = array(
      '#type' => 'hidden',
      '#value' => $_SESSION['sescrd'],
    );

    // Clear the session of the details.
    unset($_SESSION['sescrd']);
  }
  unset($_SESSION['cc_pay']);
}