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


PHP EnmasseHelper::doNotify方法代码示例

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


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

示例1: submitCheckOut


//.........这里部分代码省略.........
         $payGty = JModel::getInstance('payGty', 'enmasseModel')->getById($payGtyId);
         // checking gateway configuration
         if (CartHelper::checkGty($payGty) == false) {
             $msg = JText::_("PAYMENT_INCOMPLETE_MSG");
             $link = JRoute::_("index.php?option=com_enmasse&controller=shopping&task=checkout&buy4friend={$bBuy4friend}", false);
             JFactory::getApplication()->redirect($link, $msg);
         }
         // save gty info into session
         JFactory::getSession()->set('payGty', serialize($payGty));
         JFactory::getSession()->set('attribute_config', json_encode($payGty->attribute_config));
         //--------If admin set the prepay_percent of the deal to 0.00, set the order status to 'Paid' (with paid_amount is 0.00)
         if ($item->prepay_percent == 0.0) {
             $status = EnmasseHelper::$ORDER_STATUS_LIST['Paid'];
             $couponStatus = EnmasseHelper::$INVTY_STATUS_LIST['Hold'];
         } else {
             //------------------------------------
             // generate name of payment gateway file and class
             $payGtyFile = 'PayGty' . ucfirst($payGty->class_name) . '.class.php';
             $className = 'PayGty' . ucfirst($payGty->class_name);
             //---------------------------------------------------
             // get payment gateway object
             require_once JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "payGty" . DS . $payGty->class_name . DS . $payGtyFile;
             $paymentClassObj = new $className();
             $paymentReturnStatusObj = $paymentClassObj->returnStatus();
             $status = $paymentReturnStatusObj->order;
             $couponStatus = $paymentReturnStatusObj->coupon;
         }
     } else {
         //deal is free
         $payGty = "Free";
         $status = 'Unpaid';
         $couponStatus = 'Pending';
         //save the payGty as free
         JFactory::getSession()->set('payGty', 'Free');
     }
     //----------------------------------------
     //determine information of coupon receiver
     if ($bBuy4friend) {
         $deliveryDetail = array('name' => $receiverName, 'email' => $receiverEmail, 'msg' => $receiverMsg, 'address' => $receiverAddress, 'phone' => $receiverPhone);
     } else {
         $deliveryDetail = array('name' => $buyerName, 'email' => $buyerEmail, 'msg' => '', 'address' => $receiverAddress, 'phone' => $receiverPhone);
     }
     //--------------------------
     //generate order
     $dvrGty = $item->prepay_percent < 100 ? 2 : 1;
     $deliveryGty = JModel::getInstance('deliveryGty', 'enmasseModel')->getById($dvrGty);
     $user = array();
     $user['id'] = JFactory::getUser()->get('id', 0);
     $user['name'] = $buyerName;
     $user['email'] = $buyerEmail;
     $order = CartHelper::saveOrder($cart, $user, $payGty, null, $deliveryGty, $deliveryDetail, $status);
     $session =& JFactory::getSession();
     $session->set('newOrderId', $order->id);
     $orderItemList = CartHelper::saveOrderItem($cart, $order, $status);
     //-----------------------------
     // if this deal is set limited the coupon to sold out, go to invty and allocate coupons for this order
     // if not create coupons for that order
     if ($item->max_coupon_qty > 0) {
         $now = DatetimeWrapper::getDatetimeOfNow();
         $nunOfSecondtoAdd = EnmasseHelper::getMinuteReleaseInvtyFromSetting($payGty) * 60;
         $intvy = CartHelper::allocatedInvty($orderItemList, DatetimeWrapper::mkFutureDatetimeSecFromNow($now, $nunOfSecondtoAdd), $couponStatus);
     } else {
         JModel::getInstance('invty', 'enmasseModel')->generateForOrderItem($orderItemList[0]->pdt_id, $orderItemList[0]->id, $orderItemList[0]->qty, $couponStatus);
     }
     //------------------------
     //generate integration class
     $isPointSystemEnabled = EnmasseHelper::isPointSystemEnabled();
     if ($isPointSystemEnabled) {
         $integrationClass = EnmasseHelper::getPointSystemClassFromSetting();
         $integrateFileName = $integrationClass . '.class.php';
         require_once JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "pointsystem" . DS . $integrationClass . DS . $integrateFileName;
         $user = JFactory::getUser();
         $user_id = $user->get('id');
         $point = $cart->getPoint();
         if ($point > 0) {
             $integrationObject = new $integrationClass();
             $integrationObject->integration($user_id, 'paybypoint', $point);
         }
     }
     //validating is ok, flush user data
     JFactory::getApplication()->setUserState("com_enmasse.checkout.data", null);
     // --------------------------------
     // if deal is free then directly do the notify
     if ($cart->getTotalPrice() > 0) {
         //deal is not free, check if buyer must prepay a specific amount
         if ($item->prepay_percent > 0) {
             $link = JRoute::_("index.php?option=com_enmasse&controller=payment&task=gateway&orderId=" . $order->id, false);
         } else {
             //do notify for the order that not to prepay
             EnmasseHelper::doNotify($order->id);
             $link = JRoute::_("index.php?option=com_enmasse&controller=deal&task=listing");
             $msg = JText::_("PARTIAL_PAYMENT_NO_PREPAY_CHECKOUT_MSG");
             JFactory::getApplication()->redirect($link, $msg);
         }
     } else {
         //deal is free
         $link = JRoute::_("index.php?option=com_enmasse&controller=payment&task=doNotify&orderId={$order->id}", false);
     }
     JFactory::getApplication()->redirect($link);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:101,代码来源:shopping.php

示例2:

				<div class="text">
				<?php 
echo JTEXT::_('SHOP_CARD_TOTAL_PRICE') . ' :&nbsp;&nbsp;' . EnmasseHelper::displayCurrency($cartItem->getCount() * $item->price * $item->prepay_percent / 100 - $this->cart->getPoint());
?>
				</div>
			</div>
	</div>
	<div class="paygty-desc-table">
		<table id="instruction_table">
		  <thead>
		     <tr id="instruction_table_header"> 
		     	<td colspan="2" align="center"><?php 
echo JTEXT::_('POINT_PAY_INFO');
?>
 </td>
		     </tr>
		  </thead>
		  	<tr>		  	 	
		  	    <td><?php 
echo $this->attributeConfig->instruction;
?>
</td>
		  	</tr>
		</table>
	</div>
</div>
<?php 
$this->cart->deleteAll();
JFactory::getSession()->set('cart', null);
EnmasseHelper::doNotify($this->orderId);
开发者ID:marsa1985,项目名称:kazabiz,代码行数:30,代码来源:pay_gty.php

示例3: doNotify

 function doNotify()
 {
     $orderId = JRequest::getVar("orderId", null);
     $order = JModel::getInstance('order', 'enmasseModel')->getById($orderId);
     if ($order == null) {
         echo JTEXT::_("PAYMENT_ERROR_MSG") . $orderId;
         exit(0);
     } else {
         if ($order->status == "Unpaid") {
             EnmasseHelper::doNotify($orderId);
         }
     }
     $msg = JTEXT::_("PAYMENT_SUCCESS");
     $link = JRoute::_("index.php?option=com_enmasse&controller=deal", false);
     JFactory::getApplication()->redirect($link, $msg);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:16,代码来源:_payment.php

示例4: save

 function save()
 {
     $status = JRequest::getVar('status', '', 'post');
     $partial = JRequest::getVar('partial', 0, 'method', 'int');
     $orderData = new JObject();
     $orderData->id = JRequest::getInt('id', '', 'post');
     $orderData->description = JRequest::getVar('description', '', 'post', 'text', JREQUEST_ALLOWRAW);
     //
     $orderData->buyerid = JRequest::getInt('buyerid', '', 'post');
     $model = JModel::getInstance('order', 'enmasseModel');
     if (empty($status)) {
         if ($model->store($orderData)) {
             $msg = JText::_('SAVE_SUCCESS_MSG');
             if ($partial) {
                 $this->setRedirect('index.php?option=com_enmasse&controller=partialOrder', $msg);
             } else {
                 $this->setRedirect('index.php?option=com_enmasse&controller=' . JRequest::getVar('controller'), $msg);
             }
         } else {
             $msg = JText::_('SAVE_ERROR_MSG') . ": " . $model->getError();
             if ($orderData->id == null) {
                 $this->setRedirect('index.php?option=com_enmasse&controller=' . JRequest::getVar('controller') . '&task=add', $msg, 'error');
             } else {
                 $this->setRedirect('index.php?option=com_enmasse&controller=' . JRequest::getVar('controller') . '&task=edit&cid[0]=' . $orderData->id . '&partial=' . $partial, $msg, 'error');
             }
         }
     } else {
         //------------------------------
         //  send email and update total sold qty for each case of when change status of order
         if ($status == EnmasseHelper::$ORDER_STATUS_LIST["Paid"]) {
             EnmasseHelper::doNotify($orderData->id);
             $msg = JTEXT::_('SAVE_SUCCESS_MSG_AND_SEND_RECEIPT');
         } else {
             if ($status == EnmasseHelper::$ORDER_STATUS_LIST["Cancelled"]) {
                 $orderId = $orderData->id;
                 $order = JModel::getInstance('order', 'enmasseModel')->getById($orderId);
                 JModel::getInstance('order', 'enmasseModel')->updateStatus($order->id, 'Cancelled');
                 $orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderId);
                 for ($count = 0; $count < count($orderItemList); $count++) {
                     $orderItem = $orderItemList[$count];
                     JModel::getInstance('orderItem', 'enmasseModel')->updateStatus($orderItem->id, 'Unpaid');
                     JModel::getInstance('invty', 'enmasseModel')->freeCouponByOrderItemId($orderItem->id, 'Free');
                 }
                 $msg = JTEXT::_('SAVE_SUCCESS_MSG');
             } else {
                 if ($status == EnmasseHelper::$ORDER_STATUS_LIST["Waiting_For_Refund"]) {
                     $orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderData->id);
                     foreach ($orderItemList as $orderItem) {
                         EnmasseHelper::orderItemWaitingForRefund($orderItem);
                         sleep(1);
                     }
                     $msg = JTEXT::_('SAVE_SUCCESS_MSG_AND_SEND_REFUND');
                 } else {
                     if ($status == EnmasseHelper::$ORDER_STATUS_LIST["Refunded"]) {
                         $orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderData->id);
                         foreach ($orderItemList as $orderItem) {
                             // reduce deal quality sold
                             // only reduce when order item was delivered
                             $isDelivered = intVal($orderItem->is_delivered);
                             if ($isDelivered) {
                                 JModel::getInstance('deal', 'enmasseModel')->reduceQtySold($orderItem->pdt_id, $orderItem->qty);
                             }
                             EnmasseHelper::orderItemRefunded($orderItem);
                             sleep(1);
                         }
                         $msg = JTEXT::_('SAVE_SUCCESS_MSG');
                     } else {
                         if ($status == 'Delivered') {
                             $orderItemList = JModel::getInstance('orderItem', 'enmasseModel')->listByOrderId($orderData->id);
                             //update paid_amount of coupon to 100%
                             $model->updateToFullPaid($orderData->id);
                             JModel::getInstance("orderDeliverer", 'EnmasseModel')->updateStatus($orderData->id, "Delivered");
                             foreach ($orderItemList as $orderItem) {
                                 // update deal quality sold
                                 JModel::getInstance('deal', 'enmasseModel')->addQtySold($orderItem->pdt_id, $orderItem->qty);
                                 EnmasseHelper::orderItemDelivered($orderItem);
                                 sleep(1);
                             }
                             $msg = JTEXT::_('SAVE_SUCCESS_MSG_AND_SEND_DELIVERY');
                         }
                     }
                 }
             }
         }
         if ($partial) {
             $this->setRedirect('index.php?option=com_enmasse&controller=partialOrder', $msg);
         } else {
             $this->setRedirect('index.php?option=com_enmasse&controller=order', $msg);
         }
     }
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:91,代码来源:order.php


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