Ejemplo n.º 1
0
	</table>	
				<?php 
if ($order->Status == 20 && !$ArchivedAsSpam) {
    $db = JFactory::getDBO();
    $uriMerchant = 'index.php?option=com_bookingforconnector&view=merchantdetails';
    $db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uriMerchant . '%') . ' AND (language=' . $db->Quote($this->language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
    $itemIdMerchant = $db->getErrorNum() ? 0 : intval($db->loadResult());
    $uriMerchant .= '&merchantId=' . $order->MerchantId . ':';
    if ($itemIdMerchant != 0) {
        $uriMerchant .= '&Itemid=' . $itemIdMerchant;
    }
    $uriMerchantthanks = $uriMerchant . '&layout=thanks';
    $uriMerchantthanksKo = $uriMerchant . '&layout=errors';
    $routeThanks = JRoute::_($uriMerchantthanks);
    $routeThanksKo = JRoute::_($uriMerchantthanksKo);
    $currentbookingTypeId = BFCHelper::getOrderMerchantPaymentId($order);
    $data = BFCHelper::getMerchantPaymentData($currentbookingTypeId);
    if (!empty($data)) {
        $cCCTypeList = array();
        $datas = explode("|", $data->Data);
        if (is_array($datas)) {
            foreach ($datas as $singleData) {
                $cCCTypeList[] = JHTML::_('select.option', $singleData, $singleData);
            }
        } else {
            $cCCTypeList[] = JHTML::_('select.option', $datas, $datas);
        }
    }
    ?>

					<form method="post" id="ccdataupdate" class="form-validate" action="<?php 
Ejemplo n.º 2
0
 public function getItem()
 {
     // Get a storage key.
     $store = $this->getStoreId('getItem');
     // Try to load the data from internal storage.
     if (isset($this->cache[$store])) {
         return $this->cache[$store];
     }
     $cultureCode = JFactory::getLanguage()->getTag();
     if (empty($item)) {
         $item = new stdClass();
     }
     /* per recuperare i dati da request prima richiamo il getState e successivamente istanzio param per avere i parametri */
     $state = $this->getState();
     /* */
     $params = $state->params;
     $currentMerchant = null;
     $currentbookingTypeId = null;
     if ($params['orderId'] != '' && strpos($params['orderId'], "donation") === false) {
         $item->order = $this->getOrderFromService($params['orderId']);
         if (empty($item->order->DepositAmount)) {
             $item->order->DepositAmount = $item->order->TotalAmount;
         }
         $currentbookingTypeId = BFCHelper::getOrderMerchantPaymentId($item->order);
         $currentMerchant = $item->order->MerchantId;
     }
     $payments = $this->getPaymentsFromService($cultureCode, $currentMerchant);
     $item->merchantPayments = $payments;
     $item->merchantPayment = null;
     if ($item->merchantPayments != null) {
         if (!empty($currentbookingTypeId)) {
             foreach ($item->merchantPayments as $merchantPayment) {
                 if ($merchantPayment->BookingTypeId == $currentbookingTypeId && $merchantPayment->IsGateway) {
                     $item->merchantPayment = $merchantPayment;
                 }
             }
         }
         /* se non ho un PaymentSystemId recuperato dall'ordine, tento di prendere il sistema di pagamento di default*/
         if (empty($item->merchantPayment)) {
             //				foreach ($item->merchantPayments as $merchantPayment) {
             //					if ($merchantPayment->IsDefault && $merchantPayment->MerchantId==$currentMerchant  && $merchantPayment->IsGateway) {
             //						$item->merchantPayment = $merchantPayment;
             //					}
             //				}
             if (!empty($item->merchantPayments)) {
                 foreach ($item->merchantPayments as $merchantPayment) {
                     if ($merchantPayment->IsDefault && $merchantPayment->IsGateway) {
                         $item->merchantPayment = $merchantPayment;
                     }
                 }
                 if (empty($item->merchantPayment)) {
                     // se non riesco a prendere il default prendo il primo gateway...
                     if ($merchantPayment->IsGateway) {
                         $item->merchantPayment = $merchantPayment;
                     }
                 }
             }
         }
     }
     // Add the items to the internal cache.
     $this->cache[$store] = $item;
     return $this->cache[$store];
 }