$currency = getCurrency($clientid); $checkout = $calconly ? false : true; if ($checkout) { $gatewaysarray = array(); $result = select_query("tblpaymentgateways", "gateway", array("setting" => "name")); while ($data = mysql_fetch_array($result)) { $gatewaysarray[] = $data['gateway']; } if (!in_array($paymentmethod, $gatewaysarray)) { $apiresults = array("result" => "error", "message" => "Invalid Payment Method. Valid options include " . implode(",", $gatewaysarray)); return null; } } $apiresults['result'] = "success"; if ($type == "product") { $upgrades = SumUpPackageUpgradeOrder($serviceid, $newproductid, $newproductbillingcycle, $promocode, $paymentmethod, $checkout); $apiresults = array_merge($apiresults, $upgrades[0]); } else { if ($type == "configoptions") { $subtotal = 0; $result = select_query("tblhosting", "packageid,billingcycle", array("id" => $serviceid)); $data = mysql_fetch_array($result); $pid = $data[0]; $billingcycle = $data[1]; $configoption = getCartConfigOptions($pid, "", $billingcycle, $serviceid); $configoptions = $_REQUEST['configoptions']; if (!is_array($configoptions)) { $configoptions = array(); } foreach ($configoption as $option) { $id = $option['id'];
echo $upgrade['configname'] . ": " . $upgrade['originalvalue'] . " => " . $upgrade['newvalue'] . " (" . $upgrade['price'] . ")<br />"; } if (0 < $discount) { echo $aInt->lang("fields", "discount") . ": " . formatCurrency($GLOBALS['discount']) . "<br />"; } echo $aInt->lang("services", "upgradedue") . ": <span style=\"font-size:16px;\">" . $total . "</span>"; } } unset($_SESSION['uid']); exit; } else { if ($action == "order") { check_token("WHMCS.admin.default"); $_SESSION['uid'] = $userid; if ($type == "product") { $upgrades = SumUpPackageUpgradeOrder($id, $newproductid, $billingcycle, $promocode, $service_paymentmethod, true); } else { if ($type == "configoptions") { $upgrades = SumUpConfigOptionsOrder($id, $configoption, $promocode, $service_paymentmethod, true); } } $upgradedata = createUpgradeOrder($id, "", $promocode, $service_paymentmethod); $orderid = $upgradedata['orderid']; unset($_SESSION['uid']); echo "<s"; echo "cript language=\"javascript\">\nwindow.opener.location.href = \"orders.php?action=view&id="; echo $orderid; echo "\";\nwindow.close();\n</script>\n"; exit; } else { if (!$action) {