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


PHP BFCHelper::getTotalOrderPayments方法代码示例

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


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

示例1: display

    function display($tpl = NULL, $preparecontent = false)
    {
        $document = JFactory::getDocument();
        $language = $document->getLanguage();
        // load scripts
        $document->addScript('components/com_bookingforconnector/assets/js/jquery.validate.min.js');
        $document->addScript('components/com_bookingforconnector/assets/js/additional-methods.min.js');
        // Initialise variables
        $trackorder = false;
        $state = $this->get('State');
        $actionmode = JRequest::getVar('actionmode', "");
        $item = $this->get('Item');
        $params =& $state->params;
        $this->assignRef('state', $state);
        $this->assignRef('params', $params);
        $this->assignRef('language', $language);
        $this->assignRef('item', $item);
        $this->assignRef('actionmode', $actionmode);
        if ($actionmode == "orderpayment") {
            //recupero quanti pagamenti sono stati effettuati
            $item->paymentCount = BFCHelper::getTotalOrderPayments($item->order->OrderId);
            $item->overrideAmount = JRequest::getFloat('overrideAmount');
            //sostituisco i dati dell'ordine da pagare con i dati passati e l'ordine con un suffisso in più
            /*$item = $this->get('Item');*/
            /*$item = "fet";*/
        }
        if ($actionmode == "orderpaid") {
            $trackorder = true;
        }
        if ($actionmode != '' && $actionmode != 'cancel' && $actionmode != 'donation' && $actionmode != 'orderpayment') {
            if ($item->order->Status != 5) {
                $hasPayed = $this->processPayment($actionmode, $item->order->OrderId);
                /* eccezione per setefi che pretende un url di ritorno */
            } else {
                //$hasPayed = true;
                $hasPayed = $this->processOrderPayment($actionmode, $item->order->OrderId, $language);
            }
            /*
            $link = '';
            if ($hasPayed){
             	
            }
            $app = JFactory::getApplication();
            $app->redirect($link, $msg);
            */
        }
        if ($actionmode == '' && $actionmode != 'donation') {
            if ($item->order->Status != 5) {
                $this->inizializePayment($item->order->OrderId);
            }
        }
        if ($actionmode == 'orderpaid') {
            $hasPayed = $item->order->Status == 5;
        }
        if (isset($trackorder) && $trackorder) {
            $merchants = array();
            $merchants[] = $item->order->MerchantId;
            $criteoConfig = BFCHelper::getCriteoConfiguration(4, $merchants, $item->order->OrderId);
            if (isset($criteoConfig) && isset($criteoConfig->enabled) && $criteoConfig->enabled && count($criteoConfig->merchants) > 0) {
                $document->addScript('//static.criteo.net/js/ld/ld.js');
                $document->addScriptDeclaration('window.criteo_q = window.criteo_q || []; 
				window.criteo_q.push( 
					{ event: "setAccount", account: ' . $criteoConfig->campaignid . '}, 
					{ event: "setSiteType", type: "d" }, 
					{ event: "setEmail", email: "" }, 
					{ event: "trackTransaction", id: "' . $criteoConfig->transactionid . '",  item: [' . json_encode($criteoConfig->orderdetails) . '] }
				);');
            }
            $analyticsEnabled = $this->checkAnalytics("Sales Resource List");
            if ($analyticsEnabled && $config->get('eecenabled', 0) == 1) {
                $purchaseObject = new stdClass();
                $purchaseObject->id = "" . $item->order->OrderId;
                $purchaseObject->affiliation = "" . $item->order->Label;
                $purchaseObject->revenue = "" . $item->order->TotalAmount;
                $purchaseObject->tax = 0.0;
                $allobjects = array();
                $svcTotal = 0;
                $allservices = array_values(array_filter(simpledom_load_string($order->NotesData)->xpath("//price"), function ($prc) {
                    return (string) $prc->tag == "extrarequested";
                }));
                foreach ($allservices as $svc) {
                    $svcObj = new stdClass();
                    $svcObj->id = "" . (int) $svc->priceId . " - Service";
                    $svcObj->name = (string) $svc->name;
                    $svcObj->category = "Services";
                    $svcObj->brand = $item->Name;
                    $svcObj->variant = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
                    $svcObj->price = round((double) $svc->discountedamount / (int) $svc->quantity, 2);
                    $svcObj->quantity = (int) $svc->quantity;
                    $allobjects[] = $svcObj;
                    $svcTotal += (double) $svc->discountedamount;
                }
                $mainObj = new stdClass();
                $mainObj->id = "" . $item->order->RequestedItemId . " - Resource";
                $mainObj->name = (string) BFCHelper::getItem($order->NotesData, 'nome', 'unita');
                $mainObj->variant = (string) BFCHelper::getItem($order->NotesData, 'refid', 'rateplan');
                $mainObj->category = $item->MainCategoryName;
                $mainObj->brand = $item->Name;
                $mainObj->price = $item->order->TotalAmount - $svcTotal;
                $mainObj->quantity = 1;
//.........这里部分代码省略.........
开发者ID:Bookingfor,项目名称:joomla-extension-v-2,代码行数:101,代码来源:view.html.php

示例2: bfi_payment

function bfi_payment()
{
    $hasPayed = null;
    $orderId = isset($_REQUEST['orderId']) ? $_REQUEST['orderId'] : $_REQUEST['payedOrderId'];
    $actionmode = isset($_REQUEST['actionmode']) ? $_REQUEST['actionmode'] : '';
    $paymentModel = new BookingForConnectorModelPayment();
    $item = $paymentModel->getItem($orderId);
    $order = $item->order;
    $merchantPayments = $item->merchantPayments;
    $merchantPayment = $item->merchantPayment;
    $data = explode('|', $merchantPayment->Data);
    if ($actionmode == "orderpaid") {
        $base_url = get_site_url();
        $merchant_id = $order->MerchantId;
        $modelmerchant = new BookingForConnectorModelMerchantDetails();
        $merchant = $modelmerchant->getItem($merchant_id);
        $result = isset($_REQUEST['result']) ? $_REQUEST['result'] : '';
        if ($result == "true") {
        }
        $redirecturl = $base_url . '/thanks/orderpaid/merchant-details/merchantdetails/' . $merchant->MerchantId . '-' . seoUrl($merchant->Name);
        wp_redirect($redirecturl);
        exit;
    }
    if ($actionmode == "orderpayment") {
        $item->paymentCount = BFCHelper::getTotalOrderPayments($item->order->OrderId);
    }
    if ($actionmode != '' && $actionmode != 'cancel' && $actionmode != 'donation' && $actionmode != 'orderpayment') {
        if ($item->order->Status != 5) {
            $hasPayed = processPayment($actionmode, $order, $data, $merchantPayment->SandboxMode);
        } else {
            $hasPayed = processOrderPayment($actionmode, $item->order, $language, $data);
        }
    }
    if ($actionmode == '' && $actionmode != 'donation') {
        if ($item->order->Status != 5) {
            $order = BFCHelper::setOrderStatus($orderId, 1, false, false, '');
        }
    }
    if ($actionmode == "cancel") {
        $base_url = get_site_url();
        $merchant_id = $order->MerchantId;
        $modelmerchant = new BookingForConnectorModelMerchantDetails();
        $merchant = $modelmerchant->getItem($merchant_id);
        $redirecturl = $base_url . '/cancel/orderpaid/merchant-details/merchantdetails/' . $merchant->MerchantId . '-' . seoUrl($merchant->Name);
        wp_redirect($redirecturl);
        exit;
    }
    if (isset($item->merchantPayment)) {
        $merchantPayment = $item->merchantPayment;
        $paymentSystemId = $merchantPayment->PaymentSystemId;
        $paymentSystemRef = $merchantPayment->PaymentSystemName;
        if ($actionmode == 'donation') {
        } else {
            if ($hasPayed !== null) {
                if ($hasPayed) {
                    echo '<p class="success">' . __('Payment successful', 'bfi') . '</p>';
                } else {
                    echo '<p class="error">' . __('Payment failed', 'bfi') . '</p>';
                }
            } else {
                if ($actionmode == 'cancel') {
                    echo '<p class="error">' . __('Payment failed and has been cancelled', 'bfi') . '</p>';
                }
                if ($actionmode == 'error' || $actionmode == 'errordonation') {
                    echo '<p class="error">' . __('Payment failed and has been cancelled', 'bfi') . '</p></br>';
                }
                if ($actionmode != 'errordonation' && $order != null && $paymentSystemRef != null) {
                    if ($actionmode != 'error') {
                        $output = call_user_func('payment_' . $paymentSystemRef, $order, $merchantPayment, $actionmode);
                    }
                }
            }
        }
    }
    return $output;
}
开发者ID:Bookingfor,项目名称:wordpress-plugin,代码行数:76,代码来源:bfi.php

示例3: display

 function display($tpl = NULL, $preparecontent = false)
 {
     $document = JFactory::getDocument();
     $language = $document->getLanguage();
     // load scripts
     $document->addScript('components/com_bookingforconnector/assets/js/jquery.validate.min.js');
     $document->addScript('components/com_bookingforconnector/assets/js/additional-methods.min.js');
     // Initialise variables
     $state = $this->get('State');
     $actionmode = JRequest::getVar('actionmode', "");
     $item = $this->get('Item');
     $params =& $state->params;
     $this->assignRef('state', $state);
     $this->assignRef('params', $params);
     $this->assignRef('language', $language);
     $this->assignRef('item', $item);
     $this->assignRef('actionmode', $actionmode);
     if ($actionmode == "orderpayment") {
         //recupero quanti pagamenti sono stati effettuati
         $item->paymentCount = BFCHelper::getTotalOrderPayments($item->order->OrderId);
         $item->overrideAmount = JRequest::getFloat('overrideAmount');
         //sostituisco i dati dell'ordine da pagare con i dati passati e l'ordine con un suffisso in più
         /*$item = $this->get('Item');*/
         /*$item = "fet";*/
     }
     if ($actionmode != '' && $actionmode != 'cancel' && $actionmode != 'donation' && $actionmode != 'orderpayment') {
         if ($item->order->Status != 5) {
             $hasPayed = $this->processPayment($actionmode, $item->order->OrderId);
             /* eccezione per setefi che pretende un url di ritorno */
         } else {
             //$hasPayed = true;
             $hasPayed = $this->processOrderPayment($actionmode, $item->order->OrderId, $language);
         }
         /*
         $link = '';
         if ($hasPayed){
          	
         }
         $app = JFactory::getApplication();
         $app->redirect($link, $msg);
         */
     }
     if ($actionmode == '' && $actionmode != 'donation') {
         if ($item->order->Status != 5) {
             $this->inizializePayment($item->order->OrderId);
         }
     }
     if ($actionmode == 'orderpaid') {
         $hasPayed = $item->order->Status == 5;
     }
     // assegno il riferimento dopo gli altri altrimenti non ho nessuna associazione
     $this->assignRef('hasPayed', $hasPayed);
     /*
     		$items		= $this->get('Items');
     		$pagination	= $this->get('Pagination');
     		$sortColumn 	= $state->get('list.ordering');
     		$sortDirection 	= $state->get('list.direction');
     
     // Check for errors.
     		if (count($errors = $this->get('Errors'))) {
     			JError::raiseWarning(500, implode("\n", $errors));
     			return false;
     		}
     $pagination->setAdditionalUrlParam("filter_order", $ordering);
     		$pagination->setAdditionalUrlParam("filter_order_Dir", $direction);
     
     
     $this->assignRef('items', $items);
     		$this->assignRef('pagination', $pagination);
     */
     // Display the view
     parent::display($tpl);
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:73,代码来源:view.html.php


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