You are here

function uc_payment_get_details in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_payment/uc_payment.module \uc_payment_get_details()
1 string reference to 'uc_payment_get_details'
uc_payment_menu in payment/uc_payment/uc_payment.module
Implements hook_menu().

File

payment/uc_payment/uc_payment.module, line 407

Code

function uc_payment_get_details($method_id, $view = 'cart', $order = NULL) {
  global $user;
  if ($view == 'cart') {
    if (!isset($_SESSION['cart_order']) || !($order = uc_order_load($_SESSION['cart_order']))) {
      $_SESSION['cart_order'] = NULL;
      $order = NULL;
    }
    if (!empty($order) && ($order->order_status != 0 || !empty($user->uid) && $user->uid != $order->uid)) {
      $order = NULL;
    }
  }
  $func = _payment_method_data($method_id, 'callback');
  if (function_exists($func)) {
    $output = $func($view . '-details', $order);
  }
  print $output;
  exit;
}