/**
  *    _final_verifications
  * just makes sure that everything is set up correctly before proceeding
  *
  * @access    private
  * @return    bool
  * @throws \EE_Error
  */
 private function _final_verifications()
 {
     // filter checkout
     $this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout);
     //verify that current step is still set correctly
     if (!$this->checkout->current_step instanceof EE_SPCO_Reg_Step) {
         EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
         return false;
     }
     // if returning to SPCO, then verify that primary registrant is set
     if (!empty($this->checkout->reg_url_link)) {
         $valid_registrant = $this->checkout->transaction->primary_registration();
         if (!$valid_registrant instanceof EE_Registration) {
             EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             return false;
         }
         $valid_registrant = null;
         foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) {
             if ($registration instanceof EE_Registration && $registration->reg_url_link() === $this->checkout->reg_url_link) {
                 $valid_registrant = $registration;
             }
         }
         if (!$valid_registrant instanceof EE_Registration) {
             // hmmm... maybe we have the wrong session because the user is opening multiple tabs ?
             if (EED_Single_Page_Checkout::$_checkout_verified) {
                 // clear the session, mark the checkout as unverified, and try again
                 EE_Registry::instance()->SSN->clear_session();
                 EED_Single_Page_Checkout::$_initialized = false;
                 EED_Single_Page_Checkout::$_checkout_verified = false;
                 $this->_initialize();
                 EE_Error::reset_notices();
                 return false;
             }
             EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
             return false;
         }
     }
     // now that things have been kinda sufficiently verified,
     // let's add the checkout to the session so that's available other systems
     EE_Registry::instance()->SSN->set_checkout($this->checkout);
     return true;
 }