public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE) { $paymentData = explode('|', $config); /*ShopID|Separator|SecretKey|PaymentUrl */ $this->shopID = $paymentData[0]; $this->separator = $paymentData[1]; $this->SecretKey = $paymentData[2]; $this->paymentUrl = $paymentData[3]; $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->importo = number_format($order->DepositAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', ''); $this->importoForMac = intval($order->DepositAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY); if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->numord .= $this->separator . "R" . $suffixOrder; $this->importo = number_format($overrideAmount * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY, 2, ',', ''); $this->importoForMac = intval($overrideAmount * 100 * COM_BOOKINGFORCONNECTOR_CONVERSIONCURRENCY); } $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->languageId = $this->getLanguage($language); $this->url = $url; $this->urlBack = $urlBack; if ($debug) { $this->shopID = 'MYSHOP'; $this->numord = 78; $this->importo = '17,00'; $this->importoForMac = '1700'; $this->SecretKey = '3DfEO2B5Jjm4VC1Q3vEh'; } //$this->mac = $this->getMac(); $this->redirectUrl = getUrl(); }
public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE) { //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY); $paymentData = explode('|', $config); /*id|password|separator|PaymentUrl */ $this->id = $paymentData[0]; $this->separator = $paymentData[2]; $this->password = $paymentData[1]; $this->paymentUrl = $paymentData[3]; $this->trackid = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->langid = $this->getLanguage($language); $this->amt = $order->DepositAmount; $this->udf2 = $order->OrderId; $this->orderId = $order->OrderId; if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->trackid .= $this->separator . "R" . $suffixOrder; //$this->orderId .= $this->separator . "R" . $suffixOrder; $this->udf2 .= $this->separator . "R" . $suffixOrder; $this->amt = $overrideAmount; $this->udf4 = $overrideAmount; $this->suffixOrder = $suffixOrder; } $this->responseUrl = $url; $this->errorUrl = $urlBack; if ($debug) { //$this->merchantNumber = '99999999'; //$this->password = '******'; $this->paymentUrl = 'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet'; } $this->requestUrl = $this->getUrl(); }
public function __construct($config, $order, $language, $urlBack, $url, $debug = false, $donation = false) { $paymentData = explode('|', $config); /*Username|Password|Signature|Separator */ $this->Username = $paymentData[0]; $this->Password = $paymentData[1]; $this->Signature = $paymentData[2]; $this->separator = $paymentData[3]; $this->divisa = 'EUR'; $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->languageId = $this->getLanguage($language); $this->importo = intval($order->DepositAmount); $this->paymentUrl = 'https://www.paypal.com/cgi-bin/webscr'; $this->paymentUrlAPI = 'https://api-3t.paypal.com/nvp'; $this->returnurl = $url; $this->urlBack = $urlBack; $this->method = "SetExpressCheckout"; $this->version = "109.0"; $this->paymentaction = "Sale"; if ($debug) { $this->paymentUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; $this->paymentUrlAPI = 'https://api-3t.sandbox.paypal.com/nvp'; } //$this->requestUrl = $this->getUrl(); }
public function __construct($config, $order, $language, $urlok, $urlko, $suffixOrder, $overrideAmount = 0, $debug = FALSE) { $paymentData = explode('|', $config); /*MerchantID|ShopID|UserID|Password|Separator|SecretString */ $this->merchantID = $paymentData[0]; $this->shopID = $paymentData[1]; $this->userID = $paymentData[2]; $this->password = $paymentData[3]; $this->separator = $paymentData[4]; $this->SecretKey = $paymentData[5]; //$this->paymentUrl = $paymentData[3]; $this->numeroOrdine = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->totaleOrdine = intval($order->DepositAmount * 100); if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->numord .= $this->separator . "R" . $suffixOrder; $this->totaleOrdine = intval($overrideAmount * 100); } $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->languageId = $this->getLanguage($language); $this->urlOk = $urlok; $this->urlKo = $urlko; if ($debug) { $this->merchantID = '9999888'; $this->shopID = '99888'; $this->userID = '9999888_IPERTRD'; $this->numeroOrdine = 'VERXORDXPROD196'; $this->totaleOrdine = '1'; $this->password = '******'; $this->SecretKey = 'b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1b1'; $this->tipoRispostaApv = 'click'; $this->urlOk = "http://www.dominio.it/ok.html"; $this->urlKo = "http://www.dominio.it/ko.html"; } // $this->paymentUrl .= $this->getUrl(); }
public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE) { // echo "<pre>order"; // echo print_r($order); // echo "</pre>"; //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY); $paymentData = explode('|', $config); /* MerchantId|Abi|MacKey|Separator|PaymentUrl */ $this->merchant_id = $paymentData[0]; $this->abi = $paymentData[1]; $this->SecretKey = $paymentData[2]; $this->separator = $paymentData[3]; $this->paymentUrl = $paymentData[4]; $this->order_id = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->lingua = $this->getLanguage($language); $this->importo = number_format($order->DepositAmount, 2, ',', ''); //$this->order_id = $order->OrderId; if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->order_id .= $this->separator . "R" . $suffixOrder; //$this->orderId .= $this->separator . "R" . $suffixOrder; $this->importo = $overrideAmount; $this->suffixOrder = $suffixOrder; } if (empty($order->ExternalId)) { $order->ExternalId = $this->abi; } $this->urlok = $url; $this->urlko = $urlBack; $paymentDescr = "payment"; if (isset($order->donationNotes) && !empty($order->donationNotes)) { $paymentDescr = $order->donationNotes; } $paymentDescr = preg_replace('/[^A-Za-z0-9\\- ]/', '', $paymentDescr); if (strlen($paymentDescr > 120)) { $paymentDescr = substr($paymentDescr, 0, 120); } $ExternalId = $order->ExternalId; if (strlen($ExternalId > 32)) { $ExternalId = substr($ExternalId, 0, 32); } $this->items = $ExternalId . $this->FieldSeparator . $paymentDescr . $this->FieldSeparator . "1" . $this->FieldSeparator . $this->importo . $this->FieldSeparator . $this->divisa . $this->macSeparator; /*if ($debug){ $this->merchant_id = 'NCHTEST'; $this->abi = '03599'; $this->SecretKey = 'CAE5859549B7F54834040AA110A533A1'; }*/ $this->mac = $this->getMac(); }
public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = FALSE) { // echo "<pre>order"; // echo print_r($order); // echo "</pre>"; //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY); $paymentData = explode('|', $config); /* storename|ksig|Separator|PaymentUrl */ $this->storename = $paymentData[0]; $this->ksig = $paymentData[1]; $this->separator = $paymentData[2]; $this->paymentUrl = $paymentData[3]; $this->order_id = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->language = $this->getLanguage($language); $this->importo = number_format($order->DepositAmount, 2, '.', ''); $this->currentDateTime = date("Y:m:d-H:i:s"); //$this->order_id = $order->OrderId; if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->order_id .= $this->separator . "R" . $suffixOrder; //$this->orderId .= $this->separator . "R" . $suffixOrder; $this->importo = number_format($overrideAmount, 2, '.', ''); $this->suffixOrder = $suffixOrder; } $this->responseSuccessURL = $url; $this->responseFailURL = $urlBack; $paymentDescr = "payment"; if (isset($order->donationNotes) && !empty($order->donationNotes)) { $paymentDescr = $order->donationNotes; } $paymentDescr = preg_replace('/[^A-Za-z0-9\\- ]/', '', $paymentDescr); if (strlen($paymentDescr > 120)) { $paymentDescr = substr($paymentDescr, 0, 120); } if (empty($order->ExternalId)) { $this->invoicenumber = $order->ExternalId; } if (strlen($this->invoicenumber > 32)) { $this->invoicenumber = substr($this->invoicenumber, 0, 32); } $this->info = $this->invoicenumber . $this->FieldSeparator . $paymentDescr . $this->FieldSeparator . "1" . $this->FieldSeparator . $this->importo . $this->FieldSeparator . $this->divisa; /*if ($debug){ $this->merchant_id = 'NCHTEST'; $this->abi = '03599'; $this->SecretKey = 'CAE5859549B7F54834040AA110A533A1'; }*/ $this->hash = $this->getHash(); }
public function __construct($config, $order, $language, $urlBack, $url, $debug = FALSE) { $paymentData = explode('|', $config); /*ShopID|Separator|StartSecretKey|PaymentUrl */ $this->alias = $paymentData[0]; $this->separator = $paymentData[1]; $this->startSecretKey = $paymentData[2]; $this->paymentUrl = $paymentData[3]; $this->divisa = 'EUR'; $this->numord = sprintf('B%s%s%s%s', rand(1, 9999) . $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->languageId = $this->getLanguage($language); $this->importo = intval($order->DepositAmount * 100); $this->url = $url; $this->urlBack = $urlBack; if ($debug) { $this->numord = 'testCILME534'; $this->importo = 1; $this->alias = 'payment_testm_urlmac'; $this->startSecretKey = 'esempiodicalcolomac'; } $this->mac = $this->getMac(); }
public function __construct($config, $order, $language, $urlBack, $url, $suffixOrder, $overrideAmount = 0, $debug = false, $donation = false) { //$this->helper = new wsQueryHelper(COM_BOOKINGFORCONNECTOR_WSURL, COM_BOOKINGFORCONNECTOR_APIKEY); $paymentData = explode('|', $config); /*Separator|MerchantNumber|SecretString */ $this->merchantNumber = $paymentData[1]; $this->separator = $paymentData[0]; $this->password = $paymentData[2]; $this->trackid = sprintf('B%s%s%s%s', $this->separator, $order->ExternalId, $this->separator, $order->OrderId); $this->email = BFCHelper::getItem($order->CustomerData, 'email') . ""; $this->langid = $this->getLanguage($language); $this->amt = $order->DepositAmount; $this->udf1 = $order->OrderId; $this->orderId = $order->OrderId; if (isset($suffixOrder) && $suffixOrder != "" && $overrideAmount > 0) { $this->trackid .= $this->separator . "R" . $suffixOrder; //$this->orderId .= $this->separator . "R" . $suffixOrder; $this->udf1 .= $this->separator . "R" . $suffixOrder; $this->amt = $overrideAmount; $this->udf4 = $overrideAmount; $this->suffixOrder = $suffixOrder; } $this->isdonation = $donation; if ($this->isdonation) { $this->udf1 = sprintf('%s %s', $order->ExternalId, BFCHelper::getItem($order->CustomerData, 'nome')); $this->trackid = $order->ExternalId; } $this->responseUrl = $url; $this->errorUrl = $urlBack; if ($debug) { $this->merchantNumber = '99999999'; $this->password = '******'; $this->paymentUrl = 'https://test.monetaonline.it/monetaweb/hosted/init/http'; } $this->requestUrl = $this->getUrl(); }
$dateCheckin = new JDate($dateCheckin); $dateCheckout = BFCHelper::parseJsonDate($order->EndDate, 'Y-m-d'); $dateCheckout = new JDate($dateCheckout); $expirationjdate = new JDate('now -1 month'); // 3:20 PM, December 1st, 2012 $checkin = $dateCheckin->format('Ym01'); if (($dateCheckout < $expirationjdate || $dateCheckout > $jdate) && !array_key_exists($checkin, $listDateArray)) { $ratingError = 5; $showForm = false; } $selectdate = false; $name = BFCHelper::getItem($order->CustomerData, 'nome'); $email = BFCHelper::getItem($order->CustomerData, 'email'); $nation = BFCHelper::getItem($order->CustomerData, 'stato'); $city = BFCHelper::getItem($order->CustomerData, 'citta'); $unitiid = BFCHelper::getItem($order->NotesData, 'idunita', 'unita'); // controllo se l'ordine è riferito a questa risorsa if (!isset($unitiid) && $unitiid !== $resource->UnitId) { // ordine non riferito a questa risorsa $ratingError = 4; $showForm = false; } } else { // ordine inesistente o a cui non è possibile associare una recensione $ratingError = 3; $showForm = false; } } } else { //ordine non numerico $ratingError = 1;
:</strong> <?php echo BFCHelper::getItem($contacts, 'telefono1'); ?> <?php if (BFCHelper::getItem($contacts, 'telefono2') != '') { ?> - <?php echo BFCHelper::getItem($contacts, 'telefono2'); } ?> <br/> <strong><?php echo JTEXT::_('MOD_BOOKINGFORCONNECTOR_MERCHANT_FAX'); ?> :</strong> <?php echo BFCHelper::getItem($contacts, 'fax'); ?> <br/> <strong><?php echo JTEXT::_('MOD_BOOKINGFORCONNECTOR_MERCHANT_INFO'); ?> :</strong> <a class="com_bookingforconnector_resource-merchantLink" href="<?php echo JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name)); ?> "><?php echo JTEXT::_('MOD_BOOKINGFORCONNECTOR_MERCHANT_MERCHANTSHEET'); ?> </a> </p> <?php if ($XGooglePos != null && $XGooglePos != '' && ($YGooglePos != null && $YGooglePos != '')) {
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; $allobjects[] = $mainObj; $document->addScriptDeclaration('callAnalyticsEEc("addProduct", ' . json_encode($allobjects) . ', "purchase", "", ' . json_encode($purchaseObject) . ');'); } } // 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); }
$order = $this->item->order; $merchantPayments = $this->item->merchantPayments; if (isset($this->item->merchantPayment)) { $merchantPayment = $this->item->merchantPayment; $paymentSystemId = $merchantPayment->PaymentSystemId; // $paymentSystemRef = null; $paymentSystemRef = $merchantPayment->PaymentSystemName; $actionmode = $this->actionmode; $hasPayed = $this->hasPayed; //echo "<pre>"; //echo $actionmode; //echo "</pre>"; $routeOrderPayed = JRoute::_('index.php?view=orders&actionform=login&checkMode=5&orderid=' . $order->OrderId . '&email=' . BFCHelper::getItem($order->CustomerData, 'email')); if (COM_BOOKINGFORCONNECTOR_USEEXTERNALUPDATEORDERSYSTEM === "GPDati") { $dateCheckin = BFCHelper::parseJsonDate($order->StartDate); $routeOrderPayed = JRoute::_('index.php?view=orders&actionform=login&checkMode=146&externalOrderId=' . $order->ExternalId . '&customerLastname=' . BFCHelper::getItem($order->CustomerData, 'cognome') . '&checkIn=' . $dateCheckin); } ?> <?php if ($actionmode == 'donation') { ?> <?php $routeOrderPayed = JRoute::_('index.php?view=orders&actionmode=donation'); //echo "<pre>merchantPayment:<br />"; //echo print_r($merchantPayment); //echo "</pre>"; if (!empty($paymentSystemRef)) { echo $this->loadTemplate('payment_' . $paymentSystemRef); } ?> <?php
?> <?php $resource = $result->Resource; $merchant = $result->Merchant; //echo ("<pre>"); //echo (print_r($merchant)); //echo ("</pre>"); // $resourceName = BFCHelper::getLanguage($resource->Name, $this->language); $resourceName = BFCHelper::getLanguage($resource->Name, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags')); $addressData = $resource->AddressData; if ($addressData == null || $addressData == '') { $merchantAddressData = $merchant->AddressData; //echo ("<pre>"); //echo (print_r($merchant)); //echo ("</pre>"); $addressData = sprintf("%s - %s - %s (%s)", BFCHelper::getItem($merchantAddressData, 'indirizzo'), BFCHelper::getItem($merchantAddressData, 'cap'), BFCHelper::getItem($merchantAddressData, 'comune'), BFCHelper::getItem($merchantAddressData, 'provincia')); } $resourceLat = $resource->XGooglePos; $resourceLon = $resource->YGooglePos; $showResourceMap = $resourceLat != null && $resourceLon != null; // $route = JRoute::_('index.php?option=com_bookingforconnector&view=resource&resourceId=' . $resource->ResourceId . ':' . BFCHelper::getSlug($resourceName)); // $routeMerchant = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name)); $resourceImageUrl = "/media/com_bookingfor/images/default.png"; if ($resource->ImageUrl != '') { $resourceImageUrl = BFCHelper::getImageUrl('resources', $resource->ImageUrl, 'resource_list_default'); } elseif ($merchant->LogoUrl != '') { $resourceImageUrl = BFCHelper::getImageUrl('merchant', $merchant->LogoUrl, 'resource_list_default_logo'); } $stay = $resource->Stay; if ($itemId != 0) { $route = JRoute::_($uri . '&resourceId=' . $resource->ResourceId . ':' . BFCHelper::getSlug($resourceName) . '&Itemid=' . $itemId);
public function getOrderMerchantPayment($order) { $bookingTypeId = BFCHelper::getItem($order->NotesData, 'bookingTypeId'); if ($bookingTypeId != '') { $bookingType = $this->getMerchantPaymentPaymentFromService($bookingTypeId); return $bookingType; } return null; }
<?php //echo "<pre>this->params"; //echo print_r($this->params); //echo "</pre>"; $donation = $this->params['donation']; if ($donation) { echo $this->loadTemplate('donation'); } else { //else no donation $checkmode = $this->params['checkmode']; $route = JRoute::_('index.php?view=orders&checkmode=' . $checkmode); $order = $this->item; $email = ""; if (!empty($order)) { $email = BFCHelper::getItem($order->CustomerData, 'email') . ""; } $actionform = $this->actionform; ?> <?php if ($order == null && $checkmode !== 0) { ?> <?php if ($actionform == "login") { ?> <div class="alert alert-error"> <button type="button" class="close" data-dismiss="alert">×</button> <strong><?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_ORDERS_VIEW_ERROR'); ?>
<div class="clearboth"></div> <div class="row-fluid com_bookingforconnector_search-merchant-resource nominheight noborder"> <div class="row-fluid "> <div class="span8 com_bookingforconnector-merchantlist-merchant-phone minheight34 "> <?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTLIST_PHONE'); ?> : <?php echo BFCHelper::getItem($item->ContactData, 'telefono1'); ?> <!-- - <?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTLIST_FAX'); ?> : <?php echo BFCHelper::getItem($item->ContactData, 'fax'); ?> --> <?php if ($merchantSiteUrl != '') { ?> - <?php echo JHTML::link(JRoute::_('index.php?option=com_bookingforconnector&layout=redirect&view=merchantdetails&tmpl=component&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($merchant->Name), true, -1), JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTLIST_SITEGO'), 'target="_blank"'); ?> <!-- - <?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_MERCHANTS_VIEW_MERCHANTDETAILS_URL'); ?> : <a href="<?php echo $merchantSiteUrl; ?>
function display($tpl = null, $preparecontent = false) { // Initialise variables $state = $this->get('State'); $item = $this->get('Item'); $document = JFactory::getDocument(); $language = $document->getLanguage(); $params = $state->params; $app = JFactory::getApplication(); $sitename = $app->get('sitename'); $config = JComponentHelper::getParams('com_bookingforconnector'); $orderid = 0; // add stylesheet JHTML::stylesheet('components/com_bookingforconnector/assets/css/font-awesome.css'); JHTML::stylesheet('components/com_bookingforconnector/assets/bootstrap/css/bootstrap.css'); $document->addStyleSheet('components/com_bookingforconnector/assets/css/bookingfor.css'); $document->addStyleSheet('components/com_bookingforconnector/assets/css/bookingfor-responsive.css'); $document->addStyleSheet('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css'); $document->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.shorten.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.validate.min.js'); $document->addScript('components/com_bookingforconnector/assets/js/additional-methods.min.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.expander.min.js'); if (substr($language, 0, 2) != 'en') { // $document->addScript('//jquery-ui.googlecode.com/svn/tags/legacy/ui/i18n/ui.datepicker-' . substr($language,0,2) . '.js'); $document->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/i18n/datepicker-' . substr($language, 0, 2) . '.min.js?ver=1.11.4'); } $checkAnalytics = false; if (!isset($item)) { header("Location: " . JURI::root()); $app->close(); } if ($item->HasResources) { if (JRequest::getString('layout') == 'resourcesajax') { $items = $this->get('ItemsResourcesAjax'); } } if ($item->HasResources) { if (JRequest::getString('layout') == 'resources') { $items = $this->get('Items'); $checkAnalytics = true; $pagination = $this->get('Pagination'); } } if (JRequest::getString('layout') == 'packages') { $items = $this->get('ItemsPackages'); $checkAnalytics = true; $pagination = $this->get('PaginationPackages'); } if (JRequest::getString('layout') == 'package') { $items = $this->get('Package'); $checkAnalytics = true; BFCHelper::setState($items, 'packages', 'merchant'); } if (JRequest::getString('layout') == 'offers') { $items = $this->get('ItemsOffer'); $checkAnalytics = true; $pagination = $this->get('PaginationOffers'); } if (JRequest::getString('layout') == 'offer') { $items = $this->get('Offer'); $checkAnalytics = true; BFCHelper::setState($items, 'offers', 'merchant'); } if (JRequest::getString('layout') == 'onsellunits') { $items = $this->get('ItemsOnSellUnit'); $checkAnalytics = true; $pagination = $this->get('PaginationOnSellUnits'); } if (JRequest::getString('layout') == 'onsellunit') { $items = array($this->get('OnSellUnit')); $checkAnalytics = true; BFCHelper::setState($items, 'onsellunits', 'merchant'); } if (JRequest::getString('layout') == 'ratings') { $items = $this->get('ItemsRating'); $pagination = $this->get('PaginationRatings'); // load scripts $document->addScript('components/com_bookingforconnector/assets/js/jquery.expander.min.js'); } if (JRequest::getString('layout', 'default') == 'default') { $checkAnalytics = true; } if (JRequest::getString('layout', 'default') == 'thanks') { $checkAnalytics = true; } if (JRequest::getString('layout') == 'rating') { // load css $document->addStyleSheet('components/com_bookingforconnector/assets/css/jquery.rating.css'); $document->addStyleSheet('components/com_bookingforconnector/assets/css/jquery.validate.css'); // load scripts $document->addScript('components/com_bookingforconnector/assets/js/jquery.rating.pack.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.form.js'); $document->addScript('components/com_bookingforconnector/assets/js/jquery.blockUI.js'); } $listName = ""; if ($checkAnalytics) { $checkAnalytics = false; $itemType = 0; $totalItems = array(); $type = ""; switch (JRequest::getString('layout', 'default')) { case "resources": $listName = "Resources List"; $type = "Resource"; $itemType = 1; foreach ($items as $key => $value) { $obj = new stdClass(); $obj->Id = $value->ResourceId; $obj->Name = $value->Name; $totalItems[] = $obj; } break; case "packages": $listName = "Packages List"; $type = "Package"; $itemType = 1; foreach ($items as $key => $value) { $obj = new stdClass(); $obj->Id = $value->PackageId; $obj->Name = $value->Name; $totalItems[] = $obj; } break; case "offers": $listName = "Offers List"; $type = "Offer"; $itemType = 1; foreach ($items as $key => $value) { $obj = new stdClass(); $obj->Id = $value->VariationPlanId; $obj->Name = $value->Name; $totalItems[] = $obj; } break; case "onsellunits": $listName = "Sales Resources Merchant List"; $type = "Sales Resource"; $itemType = 1; foreach ($items as $key => $value) { $obj = new stdClass(); $obj->Id = $value->ResourceId; $obj->Name = $value->Name; $totalItems[] = $obj; } break; case "package": $listName = "Packages Page"; $type = "Package"; $itemType = 0; $obj = new stdClass(); $obj->Id = $items->PackageId; $obj->Name = $items->Name; $totalItems[] = $obj; break; case "offer": $listName = "Offers Page"; $type = "Offer"; $itemType = 0; $obj = new stdClass(); $obj->Id = $items->VariationPlanId; $obj->Name = $items->Name; $totalItems[] = $obj; break; case "onsellunit": $listName = "Sales Resources Merchant Page"; $type = "Sales Resource"; $itemType = 0; $obj = new stdClass(); $obj->Id = $items->ResourceId; $obj->Name = $items->Name; $totalItems[] = $obj; break; case "thanks": $itemType = 2; break; case "default": $listName = "Merchants Page"; $type = "Merchant"; $itemType = 0; $obj = new stdClass(); $obj->Id = $item->MerchantId; $obj->Name = $item->Name; $totalItems[] = $obj; break; } if ($this->checkAnalytics($listName) && $config->get('eecenabled', 0) == 1) { $checkAnalytics = true; switch ($itemType) { case 0: $value = $totalItems[0]; $obj = new stdClass(); $obj->id = "" . $value->Id . " - " . $type; $obj->name = $value->Name; $obj->category = $item->MainCategoryName; $obj->brand = $item->Name; $obj->variant = 'NS'; $document->addScriptDeclaration('callAnalyticsEEc("addProduct", [' . json_encode($obj) . '], "item");'); break; case 1: $allobjects = array(); foreach ($totalItems as $key => $value) { $obj = new stdClass(); $obj->id = "" . $value->Id . " - " . $type; $obj->name = $value->Name; $obj->category = $item->MainCategoryName; $obj->brand = $item->Name; $obj->position = $key; $allobjects[] = $obj; } $document->addScriptDeclaration('callAnalyticsEEc("addImpression", ' . json_encode($allobjects) . ', "list");'); break; case 2: $orderid = JRequest::getString('orderid'); if (!empty($orderid)) { $order = BFCHelper::getSingleOrderFromService($orderid); $purchaseObject = new stdClass(); $purchaseObject->id = "" . $order->OrderId; $purchaseObject->affiliation = "" . $order->Label; $purchaseObject->revenue = $order->TotalAmount; $purchaseObject->tax = 0.0; $allobjects = array(); $allservices = array(); $svcTotal = 0; if (!empty($order->NotesData) && !empty(simpledom_load_string($order->NotesData)->xpath("//price"))) { $allservices = array_values(array_filter(simpledom_load_string($order->NotesData)->xpath("//price"), function ($prc) { return (string) $prc->tag == "extrarequested"; })); if (!empty($allservices)) { 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 = "" . $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 = $order->TotalAmount - $svcTotal; $mainObj->quantity = 1; $allobjects[] = $mainObj; $document->addScriptDeclaration('callAnalyticsEEc("addProduct", ' . json_encode($allobjects) . ', "purchase", "", ' . json_encode($purchaseObject) . ');'); } } break; } } } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } $layout = JRequest::getString('layout', "default"); if ($layout == "thanks" || $layout == "default") { $merchants = array(); $merchants[] = $item->MerchantId; if ($layout == "thanks") { $orderid = JRequest::getString('orderid'); $criteoConfig = BFCHelper::getCriteoConfiguration(4, $merchants, $orderid); } else { if ($layout == "") { $criteoConfig = BFCHelper::getCriteoConfiguration(2, $merchants); } } if (isset($criteoConfig) && isset($criteoConfig->enabled) && $criteoConfig->enabled && count($criteoConfig->merchants) > 0) { $document->addScript('//static.criteo.net/js/ld/ld.js'); if ($layout == "thanks") { $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) . '] } );'); } else { if ($layout == "default") { $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: "viewItem", item: "' . $criteoConfig->merchants[0] . '" } );'); } } } } BFCHelper::setState($item, 'merchant', 'merchant'); $this->setBreadcrumb($item, JRequest::getString('layout')); $this->assignRef('params', $params); $this->assignRef('item', $item); $this->assignRef('items', $items); $this->assignRef('pagination', $pagination); $this->assignRef('document', $document); $this->assignRef('language', $language); $this->assignRef('sitename', $sitename); $this->assignRef('config', $config); $this->assignRef('state', $state); $this->assignRef('checkAnalytics', $checkAnalytics); $this->assignRef('analyticsListName', $listName); // Display the view parent::display($tpl, true); }
?> </div><!--/span--> </div><!--/row--> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW; ?> "> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL; ?> 12"> <span><?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_ORDERS_VIEW_PERSON'); ?> </span>: <?php echo BFCHelper::getItem($order->NotesData, 'quantita', 'persone'); ?> </div><!--/span--> </div><!--/row--> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW; ?> "> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL; ?> 12"> <span><?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_ORDERS_VIEW_DEPOSIT'); ?> </span>: <?php
$htmlmarkerpoint = "&markers=color:blue%7C" . $resourceLat . "," . $resourceLon; $indirizzo = ""; $cap = ""; $comune = ""; $provincia = ""; if (empty($resource->AddressData)) { $indirizzo = $resource->Address; $cap = $resource->ZipCode; $comune = $resource->CityName; $provincia = $resource->RegionName; } else { $addressData = $resource->AddressData; $indirizzo = BFCHelper::getItem($addressData, 'indirizzo'); $cap = BFCHelper::getItem($addressData, 'cap'); $comune = BFCHelper::getItem($addressData, 'comune'); $provincia = BFCHelper::getItem($addressData, 'provincia'); } if (empty($indirizzo) && empty($comune)) { // if (empty($merchant->AddressData)){ // $indirizzo = $merchant->Address; // $cap = $merchant->ZipCode; // $comune = $merchant->CityName; // $provincia = $merchant->RegionName; // if (empty($indirizzo)){ // $indirizzo = $resource->MrcAddress; // $cap = $resource->MrcZipCode; // $comune = $resource->MrcCityName; // $provincia = $resource->MrcRegionName; // } // }else{ $addressData = $merchant->AddressData;
<?php if ($order->Status == 20) { ?> <?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_ORDERS_VIEW_STATUS_20'); ?> <br /> <?php $ccDecr1 = BFCHelper::decrypt($order->CCdata); $ccDecr = substr($ccDecr1, 0, strrpos($ccDecr1, ">") + 1); $cc = new StdClass(); $cc->Type = BFCHelper::getItem($ccDecr, 'tipo', 'cc'); $cc->Name = BFCHelper::getItem($ccDecr, 'nome', 'cc'); $cc->Number = BFCHelper::getItem($ccDecr, 'numero', 'cc'); $cc->ExpiryMonth = BFCHelper::getItem($ccDecr, 'expmon', 'cc'); $cc->ExpiryYear = BFCHelper::getItem($ccDecr, 'expyear', 'cc'); // $cc = json_decode(substr($ccDecr, 0, strrpos($ccDecr,"}")+1)); ?> <?php echo JTEXT::_('COM_BOOKINGFORCONNECTOR_DEFAULT_FORM_CCSUBTITLE'); ?> <br /><br /> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_ROW; ?> "> <div class="<?php echo COM_BOOKINGFORCONNECTOR_BOOTSTRAP_COL; ?> 6"> <span><?php