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


PHP EnmasseHelper::setPendingStatusByOrderId方法代码示例

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


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

示例1: notifyUrl

 function notifyUrl()
 {
     $orderId = JRequest::getVar('orderId');
     $payClass = JRequest::getVar('payClass', '');
     $className = 'PayGty' . ucfirst($payClass);
     require_once JPATH_SITE . DS . "components" . DS . "com_enmasse" . DS . "helpers" . DS . "payGty" . DS . $payClass . DS . $className . ".class.php";
     if (!call_user_func_array(array($className, "validateTxn"), array($payClass))) {
         echo JTEXT::_("PAYMENT_VALIDATION_FAILED");
         exit(0);
     } else {
         $payDta = call_user_func_array(array($className, "generatePaymentDetail"), array());
         $payDetail = json_encode($payDta);
         if ($payClass == "pagseguro") {
             header('Content-Type: text/html; charset=ISO-8859-1');
             if (isset($_POST['Referencia'])) {
                 $orderId = $_POST['Referencia'];
                 $order = JModel::getInstance('order', 'enmasseModel')->getById($orderId);
                 if ($order == null) {
                     echo JTEXT::_("PAYMENT_ERROR_MSG") . $orderId;
                     exit(0);
                 } else {
                     if ($order->status == "Unpaid") {
                         switch ($_POST['StatusTransacao']) {
                             case "Completo":
                                 //Full payment
                                 EnmasseHelper::doNotify($orderId);
                                 break;
                             case "Aguardando Pagto":
                                 //Awaiting Customer Payment
                                 EnmasseHelper::setPendingStatusByOrderId($orderId);
                                 break;
                             case "Aprovado":
                                 //Payment approved, awaiting compensation
                                 EnmasseHelper::doNotify($orderId);
                                 break;
                                 //case "Em An...": //Payment approved, under reviewing by Pagseguro
                                 //break;
                             //case "Em An...": //Payment approved, under reviewing by Pagseguro
                             //break;
                             case "Cancelado":
                                 //Cancelled
                                 EnmasseHelper::setRefundedStatusByOrderId($orderId);
                                 break;
                             default:
                                 $msg = "Muito obrigado por seu pedido!";
                                 $link = JRoute::_("index.php?option=com_enmasse&controller=deal", false);
                                 JFactory::getApplication()->redirect($link, $msg);
                                 break;
                         }
                         JModel::getInstance('order', 'enmasseModel')->updatePayDetail($orderId, $payDetail);
                     }
                 }
             } else {
                 $msg = "Muito obrigado por seu pedido!";
                 $link = JRoute::_("index.php?option=com_enmasse&controller=deal", false);
                 JFactory::getApplication()->redirect($link, $msg);
             }
         } elseif ($payClass == "payfast") {
             if (isset($_POST['payment_status'])) {
                 $flag = JRequest::getVar('flag');
                 if ($_POST['payment_status'] == "COMPLETE") {
                     $orderId = $_POST['m_payment_id'];
                     EnmasseHelper::doNotify($orderId);
                     JModel::getInstance('order', 'enmasseModel')->updatePayDetail($orderId, $payDetail);
                 }
             }
             $msg = '';
             if ($_GET['flag'] == "returnUrl") {
                 $msg = JText::_("Thank you for purchasing!");
             } else {
                 if ($_GET['flag'] == "cancelUrl") {
                     $msg = JText::_("Your payment was cancelled.");
                 }
             }
             $link = JRoute::_("index.php?option=com_enmasse&controller=deal", false);
             JFactory::getApplication()->redirect($link, $msg);
         } elseif ($payClass == "twocheckout") {
             $payGty = JModel::getInstance('payGty', 'enmasseModel')->getByClass($payClass);
             $attribute_config = json_decode($payGty->attribute_config);
             $accountNumber = $attribute_config->sid;
             $demo = $attribute_config->demo;
             if ($demo == "Y" && $_REQUEST["credit_card_processed"] == "Y") {
                 $orderId = $_REQUEST["cart_order_id"];
                 EnmasseHelper::doNotify($orderId);
                 JModel::getInstance('order', 'enmasseModel')->updatePayDetail($orderId, $payDetail);
                 $msg = JText::_("Thank you for purchasing!");
             } elseif (demo != "Y" && $_REQUEST["credit_card_processed"] == "Y") {
                 $secretWord = $attribute_config->secret_word;
                 $string_to_hash = $secretWord . $accountNumber . $_REQUEST["order_number"] . $_REQUEST["total"];
                 $check_key = strtoupper(md5($string_to_hash));
                 if ($check_key == $_REQUEST["key"]) {
                     $orderId = $_REQUEST["cart_order_id"];
                     EnmasseHelper::doNotify($orderId);
                     JModel::getInstance('order', 'enmasseModel')->updatePayDetail($orderId, $payDetail);
                     $msg = JText::_("Thank you for purchasing!");
                 } else {
                     $msg = JText::_("Can't verify your payment! Please contact Administrator!");
                 }
             }
             $link = JRoute::_("index.php?option=com_enmasse&controller=deal", false);
//.........这里部分代码省略.........
开发者ID:marsa1985,项目名称:kazabiz,代码行数:101,代码来源:_payment.php


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