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


PHP Helper::hashForFrontierCharge方法代码示例

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


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

示例1: chargeAction

 public function chargeAction()
 {
     $detailDao = $this->getServiceLocator()->get('dao_apartment_details');
     $request = $this->getRequest();
     $bookingId = (int) $this->params()->fromRoute('booking_id', 0);
     $hash = $this->params()->fromRoute('hash', '');
     $itemId = $this->params()->fromRoute('item_id', 0);
     if (!$bookingId || Helper::hashForFrontierCharge($bookingId) != $hash) {
         Helper::setFlashMessage(['error' => TextConstants::ERROR_NO_ITEM]);
         return $this->redirect()->toRoute('backoffice/default', ['controller' => 'concierge', 'action' => 'view']);
     }
     /**
      * @var \DDD\Service\Frontier $service
      */
     $service = $this->getServiceLocator()->get('service_frontier');
     $data = $service->getDataForFrontierCharge($bookingId, $itemId);
     if (!$data) {
         Helper::setFlashMessage(['error' => TextConstants::ERROR_NO_ITEM]);
         return $this->redirect()->toRoute('backoffice/default', ['controller' => 'concierge', 'action' => 'view']);
     }
     $creditCards = false;
     if (isset($data['booking_data']['customer_id']) && $data['booking_data']['customer_id'] > 0) {
         /**
          * @var Card $cardService
          */
         $cardService = $this->getServiceLocator()->get('service_card');
         $creditCards = $cardService->getCustomerCreditCardsForFrontier($data['booking_data']['customer_id']);
     }
     $creditCardForm = new CreditCard();
     $currencyDao = $this->getServiceLocator()->get('dao_currency_currency');
     $currencyUtility = new Currency($currencyDao);
     $limitAmount = $currencyUtility->convert(200, 'USD', $data['booking_data']['acc_currency_sign']);
     $apartmentSpotsDao = $this->getServiceLocator()->get('dao_apartment_spots');
     $parkingSpotPriority = $apartmentSpotsDao->getApartmentParkingPrioritySpots($data['booking_data']['apartment_id_assigned']);
     $spotsPriority = [];
     foreach ($parkingSpotPriority as $key => $value) {
         if (!is_null($value)) {
             array_push($spotsPriority, $value);
         }
     }
     return array('data' => $data, 'itemId' => $itemId, 'creditCards' => $creditCards, 'creditCardForm' => $creditCardForm, 'limitAmount' => $limitAmount, 'spotsPriority' => $spotsPriority);
 }
开发者ID:arbi,项目名称:MyCode,代码行数:42,代码来源:FrontierController.php

示例2: getReservationCard

 /**
  * @param int $id
  * @param ControllerBase $controller
  * @return array | bool
  */
 public function getReservationCard($id, ControllerBase $controller)
 {
     /**
      * @var \DDD\Dao\Booking\Booking $reservationDao
      */
     $card = false;
     /**
      *  @var $reservationDao \DDD\Dao\Booking\Booking
      *  @var $cccaDao \DDD\Dao\Finance\Ccca
      */
     $reservationDao = $this->getServiceLocator()->get('dao_booking_booking');
     $cccaDao = $this->getServiceLocator()->get('dao_finance_ccca');
     $result = $reservationDao->getTheCard($id);
     // check has frontier charge permission
     $auth = $this->getServiceLocator()->get('library_backoffice_auth');
     $router = $controller->getEvent()->getRouter();
     if ($result) {
         $card = ['id' => $result->getId(), 'bookingStatus' => $result->getBookingStatus(), 'resNumber' => $result->getResNumber(), 'name' => $result->getResNumber(), 'guest' => $result->getGuest(), 'apartmentAssignedId' => $result->getApartmentAssignedId(), 'apartmentAssigned' => $result->getApartmentAssigned(), 'building' => $result->getBuilding(), 'buildingId' => $result->getBuildingId(), 'unitNumber' => $result->getUnitNumber(), 'guest_phone' => $result->getGuestPhone(), 'travelPhone' => $result->getGuestTravelPhone(), 'dateFrom' => $result->getDateFrom() ? date(Constants::GLOBAL_DATE_FORMAT, strtotime($result->getDateFrom())) : '', 'dateTo' => $result->getDateTo() ? date(Constants::GLOBAL_DATE_FORMAT, strtotime($result->getDateTo())) : '', 'arrivalDate' => $result->getArrivalDate() ? date(Constants::GLOBAL_DATE_FORMAT . ' H:i', strtotime($result->getArrivalDate())) : '', 'departureDate' => $result->getDepartureDate() ? date(Constants::GLOBAL_DATE_FORMAT . ' H:i', strtotime($result->getDepartureDate())) : '', 'now' => Helper::getCurrenctDateByTimezone($result->getTimezone()), 'arrivalStatus' => $result->getArrivalStatus(), 'occupancy' => $result->getOccupancy(), 'guestBalance' => $result->getGuestBalance(), 'housekeepingComments' => $result->getHousekeepingComments(), 'cccaVerified' => $result->getCccaVerified(), 'parking' => $result->getParking(), 'parking_url' => $router->assemble(['res_num' => $result->getResNumber()], ['name' => 'frontier/print-parking-permits']), 'key_task' => $result->getKeyTask(), 'keyTask' => $result->getKeyTask(), 'guestEmail' => $result->getGuestEmail(), 'cccaPageStatus' => $result->getCccaPageStatus(), 'cccaPageToken' => $result->getCccaPageToken(), 'apartmentCurrencyCode' => $result->getApartmentCurrencyCode(), 'cccaPageLink' => ''];
         if (strtotime($card['now']) <= strtotime($card['dateTo']) && $result->getKiPageStatus() == ReservationTicketService::SEND_KI_PAGE_STATUS && $result->getKiPageHash()) {
             $card['keyUrl'] = 'https://' . DomainConstants::WS_SECURE_DOMAIN_NAME . '/key?code=' . $result->getKiPageHash() . '&view=0' . '&bo=' . $result->getKiPageGodModeCode();
         }
         if ($auth->hasRole(Roles::ROLE_FRONTIER_CHARGE)) {
             $card['frontierCharge'] = '/frontier/charge/' . $result->getId() . '/0/' . Helper::hashForFrontierCharge($result->getId());
         }
         if (is_null($result->getArrivalTime())) {
             $card['arrivalTime'] = date('H:i', strtotime($result->getApartmentCheckInTime()));
         } else {
             $card['arrivalTime'] = date('H:i', strtotime($result->getArrivalTime()));
         }
         /* @var $chargeAuthorizationService \DDD\Service\Reservation\ChargeAuthorization */
         $chargeAuthorizationService = $this->getServiceLocator()->get('service_reservation_charge_authorization');
         $card['creditCardsForAuthorization'] = $chargeAuthorizationService->getCreditCardsForAuthorization($id);
         // CCCA page link
         $cccaData = $cccaDao->getAllSentCcca($id);
         if ($cccaData) {
             foreach ($cccaData as $index => $row) {
                 $lastDigit = 0;
                 foreach ($card['creditCardsForAuthorization'] as $cardInfo) {
                     if ($cardInfo->getId() == $row->getCcId()) {
                         $lastDigit = $cardInfo->getLast4Digits();
                         break;
                     }
                 }
                 $card['cccaPageLink'][$index] = ['link' => 'https://' . DomainConstants::WS_SECURE_DOMAIN_NAME . '/ccca-page?token=' . $row->getPageToken(), 'lastDigit' => $lastDigit];
             }
         }
         $card['hasMoreCards'] = false;
         if (count($card['creditCardsForAuthorization']) > $cccaData->count()) {
             $card['hasMoreCards'] = true;
         }
     }
     return $card;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:58,代码来源:Frontier.php


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