Esempio n. 1
0
function getAvailableOrderPaymentGateways()
{
    $disabledgateways = "";
    if ($_SESSION['cart']['products']) {
        foreach ($_SESSION['cart']['products'] as $values) {
            $result = select_query("tblproducts", "gid", array("id" => $values['pid']));
            $data = mysql_fetch_array($result);
            $gid = $data['gid'];
            $result = select_query("tblproductgroups", "disabledgateways", array("id" => $gid));
            $data = mysql_fetch_array($result);
            $disabledgateways .= $data['disabledgateways'];
        }
    }
    $disabledgateways = explode(",", $disabledgateways);
    if (!function_exists("showPaymentGatewaysList")) {
        require ROOTDIR . "/includes/gatewayfunctions.php";
    }
    $gatewayslist = showPaymentGatewaysList($disabledgateways);
    foreach ($gatewayslist as $module => $vals) {
        if ($vals['type'] == "CC" || $vals['type'] == "OfflineCC") {
            if (!isValidforPath($module)) {
                exit("Invalid Gateway Module Name");
            }
            $gatewaypath = ROOTDIR . "/modules/gateways/" . $module . ".php";
            if (file_exists($gatewaypath)) {
                if (!function_exists($module . "_config") && !function_exists($module . "_link") && !function_exists($module . "_capture")) {
                    require_once $gatewaypath;
                }
            }
            if (function_exists($module . "_nolocalcc")) {
                $gatewayslist[$module]['type'] = "Invoices";
                continue;
            }
            continue;
        }
    }
    return $gatewayslist;
}
Esempio n. 2
0
     $smartyvalues['subtotal'] = formatCurrency($subtotal);
     if ($credit) {
         $smartyvalues['credit'] = formatCurrency($credit);
     }
     if ($tax) {
         $smartyvalues['tax'] = formatCurrency($tax);
     }
     if ($tax2) {
         $smartyvalues['tax2'] = formatCurrency($tax2);
     }
     if ($partialpayments) {
         $smartyvalues['partialpayments'] = formatCurrency($partialpayments);
     }
     $smartyvalues['total'] = formatCurrency($total - $partialpayments);
     $smartyvalues['invoiceitems'] = $invoiceitems;
     $gatewayslist = showPaymentGatewaysList();
     $smartyvalues['gateways'] = $gatewayslist;
     $smartyvalues['defaultgateway'] = key($gatewayslist);
 } else {
     if ($action == "quotes") {
         $ca->setTemplate("clientareaquotes");
         require ROOTDIR . "/includes/quotefunctions.php";
         $result = select_query("tblquotes", "COUNT(*)", array("userid" => $client->getID()));
         $data = mysql_fetch_array($result);
         $numitems = $data[0];
         list($orderby, $sort, $limit) = clientAreaTableInit("quote", "id", "DESC", $numitems);
         if (!in_array($orderby, array("id", "date", "duedate", "total", "stage"))) {
             $orderby = "validuntil";
         }
         $smartyvalues['orderby'] = $orderby;
         $smartyvalues['sort'] = strtolower($sort);