/** * Return an array with the information for the new test user * @param string $siteId * @return array */ public function createTestUser($siteId = 'MCO') { // Obtain access token $result = CurlClient::post(self::API_URL . '/oauth/token', ['grant_type' => 'client_credentials', 'client_id' => $this->appId(), 'client_secret' => $this->secretKey()]); $accessToken = $result['response']['access_token']; // Obtain data $result = CurlClient::post(CurlClient::buildQuery(self::API_URL . '/users/test_user', ['access_token' => $accessToken]), ['site_id' => $siteId]); return $result['response']; }
/** * @param $id * @return MerchantOrder */ public function getMerchantOrder($id) { $uri = '/merchant_orders/' . $id; $return = CurlClient::get(CurlClient::buildQuery(self::API_URL . $uri, ['access_token' => $this->accessToken()])); return new MerchantOrder($return['response']); }