本文整理汇总了PHP中vmRequest::getString方法的典型用法代码示例。如果您正苦于以下问题:PHP vmRequest::getString方法的具体用法?PHP vmRequest::getString怎么用?PHP vmRequest::getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmRequest
的用法示例。
在下文中一共展示了vmRequest::getString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateRecords
/**
* This is the main function which stores the order information in the database
*
* @author Ashish Solanki!
* @return boolean
*/
function updateRecords($order_number, $order_total, &$d)
{
require_once CLASSPATH . 'ps_checkout.php';
$ps_chkout = new ps_checkout();
global $order_tax_details, $afid, $VM_LANG, $auth, $my, $mosConfig_offset, $vmLogger, $vmInputFilter, $discount_factor;
$ps_vendor_id = $_SESSION["ps_vendor_id"];
$cart = $_SESSION['cart'];
require_once CLASSPATH . 'ps_payment_method.php';
$ps_payment_method = new ps_payment_method();
require_once CLASSPATH . 'ps_product.php';
$ps_product = new ps_product();
require_once CLASSPATH . 'ps_cart.php';
$ps_cart = new ps_cart();
$db = new ps_DB();
$totals = $ps_chkout->calc_order_totals($d);
extract($totals);
$timestamp = time();
//Custom
$vmLogger->debug('-- Checkout Debug--
Subtotal: ' . $order_subtotal . '
Taxable: ' . $order_taxable . '
Payment Discount: ' . $payment_discount . '
Coupon Discount: ' . $coupon_discount . '
Shipping: ' . $order_shipping . '
Shipping Tax : ' . $order_shipping_tax . '
Tax : ' . $order_tax . '
------------------------
Order Total: ' . $order_total . '
----------------------------');
// Check to see if Payment Class File exists
$payment_class = $ps_payment_method->get_field($d["payment_method_id"], "payment_class");
$d['new_order_status'] = 'P';
// This is meant to be updated by a payment modules' process_payment method
if (!class_exists($payment_class)) {
include CLASSPATH . "payment/{$payment_class}.php";
}
$_PAYMENT = new $payment_class();
// Remove the Coupon, because it is a Gift Coupon and now is used!!
if (@$_SESSION['coupon_type'] == "gift") {
$d['coupon_id'] = $_SESSION['coupon_id'];
include_once CLASSPATH . 'ps_coupon.php';
ps_coupon::remove_coupon_code($d);
}
// Get the IP Address
if (!empty($_SERVER['REMOTE_ADDR'])) {
$ip = $_SERVER['REMOTE_ADDR'];
} else {
$ip = 'unknown';
}
// Collect all fields and values to store them!
$fields = array('user_id' => $auth["user_id"], 'vendor_id' => $ps_vendor_id, 'order_number' => $order_number, 'user_info_id' => $d["ship_to_info_id"], 'ship_method_id' => @urldecode($d["shipping_rate_id"]), 'order_total' => $order_total, 'order_subtotal' => $order_subtotal, 'order_tax' => $order_tax, 'order_tax_details' => serialize($order_tax_details), 'order_shipping' => $order_shipping, 'order_shipping_tax' => $order_shipping_tax, 'order_discount' => $payment_discount, 'coupon_discount' => $coupon_discount, 'coupon_code' => @$_SESSION['coupon_code'], 'order_currency' => $GLOBALS['product_currency'], 'order_status' => 'P', 'cdate' => $timestamp, 'mdate' => $timestamp, 'customer_note' => htmlspecialchars(vmRequest::getString('customer_note', '', 'POST', 'none'), ENT_QUOTES), 'ip_address' => $ip);
// Insert the main order information
$db->buildQuery('INSERT', '#__{vm}_orders', $fields);
$result = $db->query();
$d["order_id"] = $order_id = $db->last_insert_id();
if ($result === false || empty($order_id)) {
$vmLogger->crit('Adding the Order into the Database failed! User ID: ' . $auth["user_id"]);
return false;
}
// Insert the initial Order History.
$mysqlDatetime = date("Y-m-d G:i:s", $timestamp);
$fields = array('order_id' => $order_id, 'order_status_code' => 'P', 'date_added' => $mysqlDatetime, 'customer_notified' => 1, 'comments' => '');
$db->buildQuery('INSERT', '#__{vm}_order_history', $fields);
$db->query();
/**
* Insert the Order payment info
*/
$payment_number = str_replace(array(' ', '|', '-'), '', @$_SESSION['ccdata']['order_payment_number']);
$d["order_payment_code"] = @$_SESSION['ccdata']['credit_card_code'];
// Payment number is encrypted using mySQL encryption functions.
$fields = array('order_id' => $order_id, 'payment_method_id' => $d["payment_method_id"], 'order_payment_log' => @$d["order_payment_log"], 'order_payment_trans_id' => $vmInputFilter->safeSQL(@$d["order_payment_trans_id"]));
if (!empty($payment_number) && VM_STORE_CREDITCARD_DATA == '1') {
// Store Credit Card Information only if the Store Owner has decided to do so
$fields['order_payment_code'] = $d["order_payment_code"];
$fields['order_payment_expire'] = @$_SESSION["ccdata"]["order_payment_expire"];
$fields['order_payment_name'] = @$_SESSION["ccdata"]["order_payment_name"];
$fields['order_payment_number'] = VM_ENCRYPT_FUNCTION . "( '{$payment_number}','" . ENCODE_KEY . "')";
$specialfield = array('order_payment_number');
} else {
$specialfield = array();
}
$db->buildQuery('INSERT', '#__{vm}_order_payment', $fields, '', $specialfield);
$db->query();
/**
* Insert the User Billto & Shipto Info
*/
// First: get all the fields from the user field list to copy them from user_info into the order_user_info
$fields = array();
require_once CLASSPATH . 'ps_userfield.php';
$userfields = ps_userfield::getUserFields('', false, '', true, true);
foreach ($userfields as $field) {
if ($field->name == 'email') {
$fields[] = 'user_email';
} else {
//.........这里部分代码省略.........
示例2: ps_order
$order_id = $db->f("order_id");
$d['order_id'] = $order_id;
$d['notify_customer'] = "Y";
//-------------------------------------------
// ...read the results of the verification...
// If SUCCESS = continue to process the TX...
//-------------------------------------------
if (vmRequest::getVar('ret_status') == 'SUCCESS') {
//----------------------------------------------------------------------
// If the payment_status is Completed... Get the ID for the product
// from the DB and email it to the customer.
//----------------------------------------------------------------------
$d['order_status'] = IPAYMENT_VERIFIED_STATUS;
require_once CLASSPATH . 'ps_order.php';
$ps_order = new ps_order();
$ps_order->order_status_update($d);
$mailsubject = "iPayment Transaction on your Store";
$mailbody = "Hello,\n\n";
$mailbody .= "an iPayment transaction for you has been made on your website!\n";
$mailbody .= "-----------------------------------------------------------\n";
$mailbody .= "Transaction ID: " . vmRequest::getString('ret_trx_number') . "\n";
$mailbody .= "Order ID: {$order_id}\n";
$mailbody .= "Order Status Code: " . $d['order_status'];
vmMail($mosConfig_mailfrom, $mosConfig_fromname, $debug_email_address, $mailsubject, $mailbody);
exit;
}
}
$mailsubject = "iPayment Transaction on your Site";
$mailbody = "Hello,\r\n\tan error occured while processing a iPayment transaction.\r\n\t";
vmMail($mosConfig_mailfrom, $mosConfig_fromname, $debug_email_address, $mailsubject, $mailbody);
}