Exemplo n.º 1
0
 /**
  * Get session id query param
  *
  * @param SessionManagerInterface $session
  * @return string
  */
 public function getSessionIdQueryParam(SessionManagerInterface $session)
 {
     $sessionName = $session->getName();
     if ($sessionName && isset($this->sidNameMap[$sessionName])) {
         return $this->sidNameMap[$sessionName];
     }
     return self::SESSION_ID_QUERY_PARAM;
 }
Exemplo n.º 2
0
 /**
  * Validate session
  *
  * @param SessionManagerInterface $session
  * @return void
  * @throws Exception
  */
 public function validate(SessionManagerInterface $session)
 {
     if (!isset($_SESSION[self::VALIDATOR_KEY])) {
         $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment();
     } else {
         if (!$this->_validate()) {
             $session->destroy(array('clear_storage' => false));
             // throw core session exception
             throw new Exception('');
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Validate session
  *
  * @param SessionManagerInterface $session
  * @return void
  * @throws Exception
  */
 public function validate(SessionManagerInterface $session)
 {
     if (!isset($_SESSION[self::VALIDATOR_KEY])) {
         $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment();
     } else {
         try {
             $this->_validate();
         } catch (Exception $e) {
             $session->destroy(['clear_storage' => false]);
             // throw core session exception
             throw $e;
         }
     }
 }
 /**
  * Get the original customer address.
  *
  * @return CustomerAddressInterface
  */
 public function getOriginalCustomerAddress()
 {
     $address = $this->customerAddressFactory->create();
     $region = $this->customerRegionFactory->create();
     $addressData = $this->sessionManager->getOriginalCustomerAddressData();
     if ($addressData) {
         $region->setRegionId($addressData['region']['region_id'])->setRegionCode($addressData['region']['region_id'])->setRegion($addressData['region']['region']);
         $address->setId($addressData['id'])->setCustomerId($addressData['customer_id'])->setCountryId($addressData['country_id'])->setStreet($addressData['street'])->setCompany($addressData['company'])->setTelephone($addressData['telephone'])->setFax($addressData['fax'])->setPostcode($addressData['postcode'])->setCity($addressData['city'])->setFirstname($addressData['firstname'])->setLastname($addressData['lastname'])->setMiddlename($addressData['middlename'])->setPrefix($addressData['prefix'])->setSuffix($addressData['suffix'])->setVatId($addressData['vat_id'])->setIsDefaultShipping($addressData['is_default_shipping'])->setIsDefaultBilling($addressData['is_default_billing'])->setRegion($region);
     }
     return $address;
 }