当前位置: 首页>>代码示例>>PHP>>正文


PHP Orders::set_status方法代码示例

本文整理汇总了PHP中Orders::set_status方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::set_status方法的具体用法?PHP Orders::set_status怎么用?PHP Orders::set_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Orders的用法示例。


在下文中一共展示了Orders::set_status方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Response

 /**
  * Response
  * Create the Order, Invoice and send an email to the customer
  * @param $response from the Gateway Server
  * @return order_id or false
  */
 public function Response($response)
 {
     $bank = self::getModule();
     $bankid = $bank['bank_id'];
     if (!empty($response['item_number'])) {
         // Get the indexes of the order
         $orderid = trim($response['custom']);
         if (is_numeric($orderid) && is_numeric($bankid)) {
             // Replacing the comma with the dot in the amount value.
             $amount = str_replace(",", ".", $response['amount']);
             $payment = Payments::addpayment($orderid, $response['thx_id'], $bankid, 0, $amount);
             Orders::set_status($orderid, Statuses::id("paid", "orders"));
             // Paid
             OrdersItems::set_statuses($orderid, Statuses::id("paid", "orders"));
             // Paid
             return $orderid;
         }
     }
 }
开发者ID:moay,项目名称:shineisp,代码行数:25,代码来源:Gateway.php

示例2: panelTask

 /**
  * Execute all the registered tasks for the panel
  */
 private function panelTask()
 {
     // Get 20 Active tasks items
     $tasks = PanelsActions::getTasks(Statuses::id("active", "domains_tasks"), Statuses::id('active', 'domains'));
     try {
         // Check all the tasks saved within the Panels_Actions table.
         foreach ($tasks as $task) {
             self::doPanelsTask($task);
             // Check if all orderitem of order is complete and if is ok set order to complete
             $OrderItem = OrdersItems::getDetail($task['orderitem_id']);
             if (is_numeric($OrderItem['order_id']) && Orders::checkIfOrderItemsAreCompleted($OrderItem['order_id'])) {
                 Shineisp_Commons_Utilities::logs('Order #' . $OrderItem['order_id'] . ' has all items completed. Set order status to complete.', "tasks.log");
                 Orders::set_status($OrderItem['order_id'], Statuses::id("complete", "orders"));
             }
         }
     } catch (SoapFault $e) {
         $ISP = Isp::getActiveISP();
         Shineisp_Commons_Utilities::SendEmail($ISP['email'], $ISP['email'], null, "Task error panel message", $e->getMessage());
         return false;
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:24,代码来源:TasksController.php

示例3: activate

 /**
  * activate
  * Activate an order item
  * @param $orderItemId
  * @return true|false
  */
 public static function activate($orderItemId)
 {
     Shineisp_Commons_Utilities::log(__METHOD__ . " - Activate Detail ID #" . $orderItemId);
     $orderItemId = intval($orderItemId);
     if ($orderItemId < 1) {
         // missing order item id from arguments
         return false;
     }
     // Get OrderItem
     $ordersItem = self::find($orderItemId);
     $ordersItem = $ordersItem->toArray();
     $OrderItem = array_shift($ordersItem);
     if (!$OrderItem) {
         // order item not found
         return false;
     }
     // Get customerId related to this order
     $customerId = Orders::getCustomer($OrderItem['order_id']);
     /*
      * START ACTIVATIONS CODE
      */
     $upgrade = Orders::isUpgrade($OrderItem['order_id']);
     $upgrade_uuid = false;
     if ($upgrade !== false) {
         $orderItem = OrdersItems::getDetail($upgrade);
         Shineisp_Commons_Utilities::logs(__METHOD__ . " - OITEM::" . print_r($orderItem, true));
         $oldOrderId = $orderItem['order_id'];
         Orders::set_status($oldOrderId, Statuses::id("changed", "orders"));
         // Close the old order ::status changed
         OrdersItems::set_status($upgrade, Statuses::id("changed", "orders"));
         $upgrade_uuid = $orderItem['uuid'];
         // log
         Shineisp_Commons_Utilities::logs(__METHOD__ . " - Order changed from #" . $oldOrderId . " to #" . $OrderItem['order_id']);
     }
     if (empty($OrderItem['parameters'])) {
         Shineisp_Commons_Utilities::logs(__METHOD__ . " - Order items setup parameters empty");
         return false;
     }
     // Is this an hosting? execute panel task
     // TODO: this should call an hook or an even bound to the panel
     if (isset($OrderItem['Products']) && isset($OrderItem['Products']['type']) && $OrderItem['Products']['type'] == 'hosting') {
         Shineisp_Commons_Utilities::logs(__METHOD__ . " Hosting task queued");
         PanelsActions::AddTask($customerId, $OrderItem['detail_id'], "fullProfile", $OrderItem['parameters']);
         return true;
     }
     // Is this a domain? execute domain task
     if (isset($OrderItem['tld_id']) && intval($OrderItem['tld_id']) > 0) {
         $parameters = json_decode($OrderItem['parameters']);
         if (empty($parameters->domain)) {
             Shineisp_Commons_Utilities::logs(__METHOD__ . " Domain has been not set in the order detail #{$orderItemId}");
             return false;
         }
         // Create the domain record
         $domain = Domains::Create($parameters->domain, intval($OrderItem['tld_id']), intval($customerId), $orderItemId);
         // Create the domain task
         if (!empty($parameters->domain) && !empty($parameters->action)) {
             $domains[] = array('domain' => $parameters->domain, 'action' => $parameters->action);
             $retval = DomainsTasks::AddTasks($domains);
             Shineisp_Commons_Utilities::logs(__METHOD__ . " Domain task queued");
         }
         return $retval;
     }
 }
开发者ID:moay,项目名称:shineisp,代码行数:69,代码来源:OrdersItems.php

示例4: cleanNotPaidOrders

 /**
  * Clean all the obsolete orders without expiring date
  * Set the obsolete orders as deleted
  */
 public static function cleanNotPaidOrders()
 {
     $orders = Orders::find_all_not_paid_orders();
     foreach ($orders as $order) {
         if (empty($order['expiring_date'])) {
             // Set all the order oldest more of 1 month as deleted
             $date1 = new DateTime($order['order_date']);
             $date2 = new DateTime(date('Y-m-d'));
         } else {
             // Set the expired orders as deleted
             $date1 = new DateTime($order['order_date']);
             $date2 = new DateTime($order['expiring_date']);
         }
         $interval = $date1->diff($date2);
         if ($interval->y <= 0 || $interval->m <= 0) {
             $customer = Customers::getAllInfo($order['customer_id']);
             // Get the fastlink attached
             $link_exist = Fastlinks::findlinks($order['order_id'], $order['customer_id'], 'orders');
             if (count($link_exist) > 0) {
                 $fastlink = $link_exist[0]['code'];
             } else {
                 $fastlink = Fastlinks::CreateFastlink('orders', 'edit', json_encode(array('id' => $order['order_id'])), 'orders', $order['order_id'], $customer['customer_id']);
             }
             $customer_url = "http://" . $_SERVER['HTTP_HOST'] . "/index/link/id/{$fastlink}";
             Shineisp_Commons_Utilities::sendEmailTemplate($customer['email'], 'order_deleted', array('orderid' => $order['order_number'], ':shineisp:' => $customer, 'fullname' => $customer['fullname'], 'url' => $customer_url), null, null, null, null, $customer['language_id'], Settings::findbyParam('cron_notify'));
             // Set the order as deleted
             Orders::set_status($order['order_id'], Statuses::id('deleted', 'orders'));
         }
     }
     return true;
 }
开发者ID:moay,项目名称:shineisp,代码行数:35,代码来源:Cronjobs.php

示例5: runActivate

 /**
  * runActivate
  * run activation procedure if payment is confirmed and order is fully paid
  */
 public static function runActivate($orderid)
 {
     Shineisp_Commons_Utilities::logs(__METHOD__ . ": payment confirmed.");
     // Let's check if we have the whole invoice paid.
     $isPaid = Orders::isPaid($orderid);
     // Check to see if order is totally paid.
     // This will generate invoice or, if an invoice is still present, it will overwrite it (proforma to invoice conversion)
     if ($isPaid) {
         Shineisp_Commons_Utilities::logs(__METHOD__ . ": isPaid ok, payment has been completed 100%");
         // Set order status as "Paid"
         Orders::set_status($orderid, Statuses::id('paid', 'orders'));
         Shineisp_Commons_Utilities::logs(__METHOD__ . ": subscribed services activation starts ");
         // If we have to autosetup as soon as first payment is received, let's do here.
         Orders::activateItems($orderid, 4);
         // If automatic invoice creation is set to 1, we have to create the invoice
         $autoCreateInvoice = intval(Settings::findbyParam('auto_create_invoice_after_payment'));
         $invoiceId = intval(Orders::isInvoiced($orderid));
         if (!$invoiceId) {
             // order not invoiced?
             Shineisp_Commons_Utilities::logs(__METHOD__ . ": order not invoiced.");
             if ($autoCreateInvoice === 1) {
                 Shineisp_Commons_Utilities::logs(__METHOD__ . ": start order invoicing process.");
                 // invoice not created yet. Let's create now
                 Invoices::Create($orderid);
             }
         } else {
             Shineisp_Commons_Utilities::logs(__METHOD__ . ": invoice already created overwrite of the old invoice");
             // set invoice as paid
             Invoices::overwrite($invoiceId);
         }
     } else {
         Shineisp_Commons_Utilities::logs(__METHOD__ . ": isPaid KO, payment not completed");
         Shineisp_Commons_Utilities::logs(__METHOD__ . ": check if one or more services have been activated when a first payment is received");
         // If we have to autosetup as soon as first payment is received, let's do here.
         Orders::activateItems($orderid, 3);
     }
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:41,代码来源:Payments.php

示例6: Response

 /**
  * Response
  * Create the Order, Invoice and send an email to the customer
  * @param $response from the Gateway Server
  * @return order_id or false
  */
 public function Response($response)
 {
     $bank = self::getModule();
     $bankid = $bank['bank_id'];
     if (!empty($response['payment_status']) && $response['payment_status'] == "Completed") {
         if (!empty($response['item_number'])) {
             // Get the indexes of the order
             $orderid = trim($response['custom']);
             if (is_numeric($orderid) && is_numeric($bankid)) {
                 // Replacing the comma with the dot in the amount value.
                 $amount = str_replace(",", ".", $response['amount']);
                 Shineisp_Commons_Utilities::logs("Adding the payment information: " . $response['thx_id'], "iwbank.log");
                 $payment = Payments::addpayment($orderid, $response['thx_id'], $bankid, 0, $amount);
                 Shineisp_Commons_Utilities::logs("Set the order in the processing mode", "iwbank.log");
                 Orders::set_status($orderid, Statuses::id("paid", "orders"));
                 // Paid
                 OrdersItems::set_status($orderid, Statuses::id("paid", "orders"));
                 // Paid
                 return $orderid;
             }
         }
     }
     return false;
 }
开发者ID:kokkez,项目名称:shineisp,代码行数:30,代码来源:Gateway.php


注:本文中的Orders::set_status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。