Exemplo n.º 1
0
 public function do_finalize($params = false)
 {
     if (empty($this->_method)) {
         $this->set_error(self::ERR_METHOD, self::s2p_t('Method not set'));
         return false;
     }
     if (!($call_result = $this->get_call_result())) {
         $this->set_error(self::ERR_CALL_RESULT, self::s2p_t('Invalid call result or previous call failed.'));
         return false;
     }
     if (!($finalize_result = $this->_method->finalize($call_result, $params))) {
         if ($this->_method->has_error()) {
             $this->copy_error($this->_method);
         } else {
             $this->set_error(self::ERR_VALIDATE_RESPONSE, self::s2p_t('Couldn\'t finalize request after call.'));
         }
         return false;
     }
     return S2P_SDK_Method::validate_finalize_result($finalize_result);
 }