Exemplo n.º 1
0
 /**
  * Set the invocation to generate XML, but not post to Intacct
  *
  * @param bool $tf true or false
  *
  * @return null
  */
 public static function setDryRun($tf = true)
 {
     self::$dryRun = $tf;
 }
Exemplo n.º 2
0
 /**
  * Create a session with the Intacct Web Services with an existing session.
  * You'll normally get the sessionid using a merge field (or injection parameter)
  * in an HTTP trigger or integration link
  *
  * @param String $sessionId      a valid Intacct session Id
  * @param String $senderId       Your Intacct partner sender id
  * @param String $senderPassword Your Intacct partner password
  *
  * @throws Exception This method returns no values, but will raise an exception if there's a connection error
  * @return null
  */
 public function connectSessionId($sessionId, $senderId, $senderPassword)
 {
     $xml = self::XML_HEADER . self::XML_SESSIONID . self::XML_FOOTER;
     $xml = str_replace("{1%}", $sessionId, $xml);
     $xml = str_replace("{4%}", $senderId, $xml);
     $xml = str_replace("{5%}", $senderPassword, $xml);
     if (is_null($this->getResponseValidation())) {
         $xml = str_replace("{6%}", "", $xml);
     } else {
         $xml = str_replace("{6%}", "<validate>" . $this->getResponseValidation() . "</validate>", $xml);
     }
     $response = api_post::execute($xml, self::DEFAULT_LOGIN_URL);
     self::validateConnection($response);
     $responseObj = simplexml_load_string($response);
     $this->sessionId = (string) $responseObj->operation->result->data->api->sessionid;
     $this->companyId = (string) $responseObj->operation->authentication->companyid;
     $this->userId = (string) $responseObj->operation->authentication->userid;
     $this->endPoint = (string) $responseObj->operation->result->data->api->endpoint;
     $this->senderId = $senderId;
     $this->senderPassword = $senderPassword;
 }