public function testSettings() { if (!$this->doTest(__FUNCTION__)) { return; } $version = GoCoin::getVersion(); $mode = GoCoin::getApiMode(); echo '[DEBUG]: VERSION: ' . $version . "\n"; echo '[DEBUG]: API MODE: ' . $mode . "\n"; echo '[DEBUG]: CLIENT_ID: ' . CLIENT_ID . "\n"; echo '[DEBUG]: CLIENT_SECRET: ' . CLIENT_SECRET . "\n"; echo '[DEBUG]: TOKEN: ' . TOKEN . "\n"; //verify test settings $client = GoCoin::getClient(TOKEN); echo '[WARNING]: ==== Settings for [' . $mode . "] ====\n"; echo '[DEBUG]: API URL: ' . $client->options['host'] . "\n"; echo '[DEBUG]: DASHBOARD URL: ' . $client->options['dashboard_host'] . "\n"; //assertions $this->assertEquals($client->options['host'], GoCoin::PRODUCTION_HOST); $this->assertEquals($client->options['dashboard_host'], GoCoin::PRODUCTION_DASHBOARD_HOST); //verify test settings $mode = GoCoin::setApiMode('test'); $client = GoCoin::getClient(TOKEN); echo '[WARNING]: ==== Settings for [' . $mode . "] ====\n"; echo '[DEBUG]: API URL: ' . $client->options['host'] . "\n"; echo '[DEBUG]: DASHBOARD URL: ' . $client->options['dashboard_host'] . "\n"; //assertions $this->assertEquals($client->options['host'], GoCoin::TEST_HOST); $this->assertEquals($client->options['dashboard_host'], GoCoin::TEST_DASHBOARD_HOST); //make sure we're at the expected client library version $this->assertEquals($version, GoCoinTest::EXPECTED_LIBRARY_VERSION); //make sure to put the mode back to test for the rest of the tests $mode = GoCoin::setApiMode('test'); }
/** * @return the transactions that match the given criteria */ public static function getAccountTransactions($token, $account_id, $criteria = NULL) { $client = GoCoin::getClient($token); $xactions = $client->api->accounts->getAccountTransactions($account_id, $criteria); if ($xactions === FALSE) { throw new Exception($client->getError()); } else { return $xactions; } }