0) { $record['noDownloads'] = 0; $record['expire'] = time()+$config['dnLoadExpire']; $where = 'id = '.$_GET['reset']; $update = $db->update($glob['dbprefix']."CubeCart_Downloads", $record, $where); httpredir($glob['adminFile'].'?_g=orders/orderBuilder&edit='.$_GET['edit']); } if (isset($_POST['cart_order_id']) && !isset($_POST['prodRowsSubmit']) && $_POST['customer_id']>0) { $cache = new cache(); $cache->clearCache(); // ORDER INVENTORY if (count($_POST['prodName'])>0) { for ($i=0;$i<=count($_POST['prodName']);$i++) { if ((!empty($_POST['prodName'][$i]) && !empty($_POST['quantity'][$i]) && !empty($_POST['price'][$i])) || $_POST['delId'][$i] == 1) { $newOrderInv['name'] = $db->mySQLSafe($_POST['prodName'][$i]); $newOrderInv['productCode'] = $db->mySQLSafe($_POST['productCode'][$i]); $newOrderInv['product_options'] = $db->mySQLSafe($_POST['product_options'][$i]); $newOrderInv['quantity'] = $db->mySQLSafe($_POST['quantity'][$i]); $newOrderInv['price'] = $db->mySQLSafe($_POST['price'][$i]); $newOrderInv['cart_order_id'] = $db->mySQLSafe($_POST['cart_order_id']); if ($_POST['delId'][$i] == 1) { $where = "id = ".$db->mySQLSafe($_POST['id'][$i]); $delete = $db->delete($glob['dbprefix']."CubeCart_order_inv", $where); } else if ($_POST['id'][$i]>0) { $where = "id = ".$db->mySQLSafe($_POST['id'][$i]); $update = $db->update($glob['dbprefix']."CubeCart_order_inv", $newOrderInv, $where); } else { $insert = $db->insert($glob['dbprefix']."CubeCart_order_inv", $newOrderInv); } } } } // ORDER SUMMARY $newOrderSum['cart_order_id'] = $db->mySQLSafe($_POST['cart_order_id']); $newOrderSum['customer_id'] = $db->mySQLSafe($_POST['customer_id']); $newOrderSum['name'] = $db->mySQLSafe($_POST['name']); $newOrderSum['add_1'] = $db->mySQLSafe($_POST['add_1']); $newOrderSum['add_2'] = $db->mySQLSafe($_POST['add_2']); $newOrderSum['town'] = $db->mySQLSafe($_POST['town']); $newOrderSum['county'] = $db->mySQLSafe($_POST['county']); $newOrderSum['postcode'] = $db->mySQLSafe($_POST['postcode']); $newOrderSum['country'] = $db->mySQLSafe($_POST['country']); $newOrderSum['name_d'] = $db->mySQLSafe($_POST['name_d']); $newOrderSum['companyName'] = $db->mySQLSafe($_POST['companyName']); $newOrderSum['companyName_d'] = $db->mySQLSafe($_POST['companyName_d']); $newOrderSum['add_1_d'] = $db->mySQLSafe($_POST['add_1_d']); $newOrderSum['add_2_d'] = $db->mySQLSafe($_POST['add_2_d']); $newOrderSum['town_d'] = $db->mySQLSafe($_POST['town_d']); $newOrderSum['county_d'] = $db->mySQLSafe($_POST['county_d']); $newOrderSum['postcode_d'] = $db->mySQLSafe($_POST['postcode_d']); $newOrderSum['country_d'] = $db->mySQLSafe($_POST['country_d']); $newOrderSum['phone'] = $db->mySQLSafe($_POST['phone']); $newOrderSum['mobile'] = $db->mySQLSafe($_POST['mobile']); $newOrderSum['subtotal'] = $db->mySQLSafe($_POST['subtotal']); $newOrderSum['discount'] = $db->mySQLSafe($_POST['discount']); $newOrderSum['prod_total'] = $db->mySQLSafe($_POST['prod_total']); $newOrderSum['total_tax'] = $db->mySQLSafe($_POST['total_tax']); $newOrderSum['total_ship'] = $db->mySQLSafe($_POST['total_ship']); // removed as this is done further down $newOrderSum['status'] = $db->mySQLSafe($_POST['status']); $newOrderSum['email'] = $db->mySQLSafe($_POST['email']); $newOrderSum['comments'] = $db->mySQLSafe($_POST['comments']); $newOrderSum['customer_comments'] = $db->mySQLSafe($_POST['customer_comments']); $newOrderSum['ship_date'] = $db->mySQLSafe($_POST['ship_date']); $newOrderSum['shipMethod'] = $db->mySQLSafe($_POST['shipMethod']); $newOrderSum['gateway'] = $db->mySQLSafe($_POST['gateway']); $newOrderSum['courier_tracking'] = $db->mySQLsafe($_POST['courier_tracking']); if (isset($_GET['edit'])) { $where = "cart_order_id = ".$db->mySQLSafe($_GET['edit']); $update = $db->update($glob['dbprefix']."CubeCart_order_sum", $newOrderSum, $where); if (isset($_POST['card_number'])) { $cardData = array( 'card_type' => $_POST['card_type'], 'card_number' => $_POST['card_number'], 'card_expire' => $_POST['card_expire'], 'card_valid' => $_POST['card_valid'], 'card_issue' => $_POST['card_issue'], ); if (function_exists('mcrypt_module_open')) { require "classes".CC_DS."cart".CC_DS."encrypt.inc.php"; $crypt = new encryption($keyArray); $record['offline_capture'] = "'".base64_encode($crypt->encrypt(serialize($cardData)))."'"; } $db->update($glob['dbprefix'].'CubeCart_order_sum', $record, array('customer_id' => $orderSum['customer_id'], 'cart_order_id' => $orderSum['cart_order_id'])); } if ($update == true) { $msg .= "
".sprintf($lang['admin']['orders_updated_successfully'],$_GET['edit'])."
"; }/* else { $msg .= "".sprintf($lang['admin']['orders_update_failed'], $_GET['edit'])."
"; } */ } else { $newOrderSum['ip'] = $db->mySQLSafe(get_ip_address()); $newOrderSum['time'] = $db->mySQLSafe(time()); $insert = $db->insert($glob['dbprefix']."CubeCart_order_sum", $newOrderSum); if ($_POST['customer_id']>0) { $record['noOrders'] = "noOrders + 1"; $where = "customer_id = ".$_POST['customer_id']; $update = $db->update($glob['dbprefix']."CubeCart_customer", $record, $where); } if ($insert == true) { $msg .= "".sprintf($lang['admin']['orders_add_success'],$_POST['cart_order_id'])."
"; // send email confirmation $order->newOrderEmail($_POST['cart_order_id']); } else { $msg .= "".sprintf($lang['admin']['orders_add_fail'],$_POST['cart_order_id'])."
"; } } // update order status email etc $order->orderStatus($_POST['status'], $_POST['cart_order_id'], true); if ($_POST['cart_order_id']!==$_GET['edit']) { httpredir($glob['adminFile']."?_g=orders/orderBuilder&edit=".$_POST['cart_order_id']); } } if (isset($_GET['edit'])) { $orderSum = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_order_sum WHERE cart_order_id = ".$db->mySQLSafe($_GET['edit'])); $orderInv = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_order_inv WHERE cart_order_id = ".$db->mySQLSafe($_GET['edit'])); } if (count($orderInv) < 1 && !empty($_GET['edit'])) { $msg .= "".sprintf($lang['admin']['orders_no_products'], $_GET['edit'])."
"; } $customers = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_customer WHERE `type` > 0 ORDER BY lastName, firstName ASC"); $countries = $db->select("SELECT * FROM ".$glob['dbprefix']."CubeCart_iso_countries"); if ($countries == true) { $countriesArray = array(); for($i=0;$i<=count($countries);$i++){ $countriesArray[$countries[$i]['id']] = $countries[$i]['printable_name']; } } if(isset($_GET['PayPal-Pro']) && !empty($_GET['PayPal-Pro'])) { // Get Module Config $module = fetchDbConfig("PayPal_Pro"); $basePPPath = "modules".CC_DS."altCheckout".CC_DS."PayPal_Pro".CC_DS."wpp-".$module['mode'].CC_DS; $order_id = $_GET['edit']; $ppfunction = ereg_replace("[^A-Za-z]", "", $_GET['PayPal-Pro']); switch($ppfunction) { case "doCapture": require($basePPPath."DoCaptureReceipt.php"); break; case "doAuth": case "doReAuth": require($basePPPath."DoReauthorizationReceipt.php"); break; case "doRefund": require($basePPPath."RefundReceipt.php"); break; case "doVoidAuth": require($basePPPath."DoVoidReceipt.php"); break; } } require($glob['adminFolder'].CC_DS."includes".CC_DS."header.inc.php"); ?>
Single Integrated Label SheetsPayPal Website Payments Pro Functionality
The functions below are specifically for orders purchased with PayPal Express Checkout without the need to login to your PayPal account.
Void Authorization ID: `".$authorizationID."`
Message to customer:
| Details | Action |
|
Time: Action: Transaction Id: 0) { ?>Amount: Notes: |
";
switch ($results[$i]['gateway']) {
case "PayPal Website Payments Pro (Authorization)":
case "PayPal Website Payments Pro (Order)":
if($results[$i]['amount'] > $results[$i]['remainder']) {
$links .= "Capture | ";
$action = true;
// reauth only possible if the initial auth is three days old or more
$threeDaysAgo = time()-259200;
if($results[$i]['time']<$threeDaysAgo) {
$links .= "ReAuthorize | ";
}
if($results[$i]['gateway']=="PayPal Website Payments Pro (Order)") {
$links .= "Authorize | ";
}
$links .= "Void | ";
echo substr($links,0,-2)."";
if($_GET['form']=="doCaptureForm".$results[$i]['id'] && !isset($_POST['order_capture'])) {
echo " "; echo doCaptureForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra'], $results[$i]['remainder']); } elseif($_GET['form']=="doVoidForm".$results[$i]['id'] && !isset($_POST['order_void'])) { echo " "; echo doVoidForm ($results[$i]['trans_id'], $results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doReAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo " "; echo doReAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo " "; echo doAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } } break; case "PayPal Website Payments Pro (Sale)": case "PayPal Website Payments Pro (DoCapture)": if($results[$i]['amount'] > $results[$i]['remainder']) { echo " "; if($_GET['form']=="doRefundForm".$results[$i]['id'] && !isset($_POST['order_refund'])) { echo " "; echo doRefundForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } $action = true; } break; /* case "PayPal Website Payments Pro (DoRefund)": echo " "; break; */ case "PayPal Website Payments Pro (DoAuthorization)": $action = true; $links .= "Capture | "; $links .= "ReAuthorize | "; $links .= "Void | "; echo substr($links,0,-2).""; if($_GET['form']=="doCaptureForm".$results[$i]['id'] && !isset($_POST['order_capture'])) { echo " "; echo doCaptureForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra'], $results[$i]['remainder']); } elseif($_GET['form']=="doVoidForm".$results[$i]['id'] && !isset($_POST['order_void'])) { echo " "; echo doVoidForm ($results[$i]['trans_id'], $results[$i]['id'], $results[$i]['extra']); } elseif($_GET['form']=="doReAuthForm".$results[$i]['id'] && !isset($_POST['order_auth'])) { echo " "; echo doReAuthForm($results[$i]['trans_id'],$results[$i]['amount'],$results[$i]['id'], $results[$i]['extra']); } break; /* case "PayPal Website Payments Pro (DoVoid)": echo " "; break; */ } if($action==false) echo " Complete ";
?> |