Skip to content

Instantly share code, notes, and snippets.

@henzard
Created February 19, 2015 07:09
Show Gist options
  • Save henzard/b21523191e510429ecf5 to your computer and use it in GitHub Desktop.
Save henzard/b21523191e510429ecf5 to your computer and use it in GitHub Desktop.
function addAccounts($Account) {
$Account->HasErrors();
$xml = $Account->printAccount();
$response = $this->token->XeroOAuth->request('PUT', $this->token->XeroOAuth->url('Accounts', 'core'), array(), $xml);
if ($this->token->XeroOAuth->response['code'] == 200) {
$accounts = $this->token->XeroOAuth->parseResponse($this->token->XeroOAuth->response['response'], $this->token->XeroOAuth->response['format']);
return $accounts->Accounts;
} else {
$this->token->outputError($response);
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment