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


PHP BFCHelper::prepareOrderData方法代码示例

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


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

示例1: sendOrder

function sendOrder($formData)
{
    $formData['orderType'] = 'a';
    $formData['cultureCode'] = $GLOBALS['bfi_lang'];
    $customer = RSFormHelper::getCustomerData($formData);
    $suggestedStay = json_decode(stripslashes($formData['staysuggested']));
    $req = json_decode(stripslashes($formData['stayrequest']), true);
    //  $suggestedStay = json_decode($_SESSION['search.params']['suggestedstay']);
    //  $req = array('resourceId' => $_SESSION['search.params']['resourceId'], 'checkin' => $formData['checkin']['date'], 'checkout' =>$formData['checkout']['date'] , 'duration' => $_SESSION['search.params']['duration'], 'paxages' => '['.implode(',', $_SESSION['search.params']['paxages']).']', 'extras' => $_SESSION['search.params']['extras'], 'packages' => $_SESSION['search.params']['packages'], 'pricetype' => $_SESSION['search.params']['pricetype'], 'rateplanId' => $_SESSION['search.params']['rateplanId'], 'state' => 'booking' , 'variationPlanId' => $_SESSION['search.params']['variationPlanId'], 'gotCalculator' => false);
    $redirect = $formData['Redirect'];
    $redirecterror = $formData['Redirecterror'];
    $isgateway = $formData['isgateway'];
    $otherData = "paxages:" . str_replace("]", "", str_replace("[", "", $req['paxages'])) . "|" . "checkin_eta_hour:" . $formData['checkin_eta_hour'];
    $ccdata = null;
    if (RSFormHelper::canAcquireCCData($formData)) {
        $ccdata = json_encode(RSFormHelper::getCCardData($formData));
        $ccdata = BFCHelper::encrypt($ccdata);
    }
    $orderData = BFCHelper::prepareOrderData($formData, $customer, $suggestedStay, $otherData, $ccdata);
    $orderData['pricetype'] = $req['pricetype'];
    //  $orderData['label'] = 'developerdemo';
    $orderData['label'] = $formData['label'];
    $processOrder = null;
    /*
    		if(!empty($isgateway) && ($isgateway =="true" ||$isgateway =="1")){
    			$processOrder=false;
    		}
    */
    $order = BFCHelper::setOrder($orderData['customerData'], $orderData['suggestedStay'], $orderData['creditCardData'], $orderData['otherNoteData'], $orderData['merchantId'], $orderData['orderType'], $orderData['userNotes'], $orderData['label'], $orderData['cultureCode'], $processOrder, $orderData['pricetype']);
    if (empty($order)) {
        $order = "";
        $redirect = $redirecterror;
    }
    if (!empty($order)) {
        if (!empty($isgateway) && ($isgateway == "true" || $isgateway == "1")) {
            wp_redirect(get_site_url() . '/payment/?orderId=' . $order->OrderId);
            exit;
        } else {
            $numAdults = 0;
            $persons = explode("|", $suggestedStay->Paxes);
            foreach ($persons as $person) {
                $totper = explode(":", $person);
                $numAdults += (int) $totper[1];
            }
            $startDate = DateTime::createFromFormat('Y-m-d', BFCHelper::parseJsonDate($order->StartDate, 'Y-m-d'));
            $endDate = DateTime::createFromFormat('Y-m-d', BFCHelper::parseJsonDate($order->EndDate, 'Y-m-d'));
            $redirect = $redirect . '?act=Order&orderid=' . $order->OrderId . '&merchantid=' . $order->MerchantId . '&OrderType=' . $order->OrderType . '&OrderTypeId=' . $order->OrderTypeId . '&totalamount=' . $order->TotalAmount * 100 . '&startDate=' . $startDate->format('Y-m-d') . '&endDate=' . $endDate->format('Y-m-d') . '&numAdults=' . $numAdults;
            wp_redirect($redirect);
            exit;
        }
    }
}
开发者ID:Bookingfor,项目名称:wordpress-plugin,代码行数:52,代码来源:bfi.php

示例2: sendScalarRequest

 function sendScalarRequest()
 {
     $formData = $_POST['form'];
     $customer = RSFormHelper::getCustomerData($formData);
     $redirect = $formData['Redirect'];
     // create otherData (string)
     $otherData = "adulti:" . RSFormHelper::getOptionsFromSelect($formData, 'TotPersons') . "|" . "bambini:" . RSFormHelper::getOptionsFromSelect($formData, 'Totchildrens') . "|" . "etabambini:" . $formData['ChildrenAge'] . "|" . "tipologiastruttura:" . RSFormHelper::getOptionsFromSelect($formData, 'merchantcategory') . "|" . "trattamento:" . RSFormHelper::getOptionsFromSelect($formData, 'treatments') . "|" . "maxrisposte:" . RSFormHelper::getOptionsFromSelect($formData, 'Maxresponse') . "|" . "accettazione:" . RSFormHelper::getOptionsFromSelect($formData, 'accettazione');
     $suggestedStay = null;
     // create SuggestedStay
     if ($formData['CheckIn'] != null && $formData['CheckOut'] != null) {
         $sStay = array('CheckIn' => DateTime::createFromFormat('d/m/Y', $formData['CheckIn'])->format('Y-m-d\\TH:i:sO'), 'CheckOut' => DateTime::createFromFormat('d/m/Y', $formData['CheckOut'])->format('Y-m-d\\TH:i:sO'));
         $suggestedStay = new stdClass();
         foreach ($sStay as $key => $value) {
             $suggestedStay->{$key} = $value;
         }
         $otherData .= "|" . "CheckIn:" . DateTime::createFromFormat('d/m/Y', $formData['CheckIn'])->format('Y-m-d') . "|" . "CheckOut:" . DateTime::createFromFormat('d/m/Y', $formData['CheckOut'])->format('Y-m-d');
     }
     $orderData = BFCHelper::prepareOrderData($formData, $customer, $suggestedStay, $otherData, null);
     $orderData['processOrder'] = true;
     $orderData['label'] = $this->formlabel;
     $order = BFCHelper::setOrder($orderData['customerData'], $orderData['suggestedStay'], $orderData['creditCardData'], $orderData['otherNoteData'], $orderData['merchantId'], $orderData['orderType'], $orderData['userNotes'], $orderData['label'], $orderData['cultureCode']);
     /*if (isset($order))
     			$thankYouMessage = "Grazie";
     		else
     		$thankYouMessage = "Errore invio dati";*/
     if (empty($order)) {
         $order = "";
     }
     echo json_encode($order);
     $app = JFactory::getApplication();
     $app->redirect($redirect, false);
     $app->close();
 }
开发者ID:Bookingfor,项目名称:joomla-extension,代码行数:33,代码来源:controller.php


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