You are here

function uc_payment_get_details in Ubercart 5

Same name and namespace in other branches
  1. 6.2 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
Implementation of hook_menu().

File

payment/uc_payment/uc_payment.module, line 524

Code

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