From 622287ed86909c12b1d40fc1181d567fa00b8e51 Mon Sep 17 00:00:00 2001 From: adambodera Date: Fri, 6 Oct 2017 13:51:09 +0200 Subject: [PATCH] fixed bugs in Organization::getPrepaidBalanceReport() and Developer::getRevenueReport() --- Apigee/Mint/Developer.php | 18 ++++++------------ Apigee/Mint/Organization.php | 12 +++++------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/Apigee/Mint/Developer.php b/Apigee/Mint/Developer.php index d39d8c2..615f110 100644 --- a/Apigee/Mint/Developer.php +++ b/Apigee/Mint/Developer.php @@ -418,19 +418,13 @@ public function topUpPrepaidBalance($new_balance, $developer_or_company_id = nul public function getRevenueReport($report) { - $url = '/mint/organizations/' - . rawurlencode($this->config->orgName) - . '/developers/' - . rawurlencode($this->email) - . '/revenue-reports'; - $content_type = 'application/json; charset=utf-8'; - $accept_type = 'application/octet-stream; charset=utf-8'; + $url = rawurlencode($this->email) . '/revenue-reports'; + $content_type = 'application/json; charset=utf-8'; + $accept_type = 'application/octet-stream; charset=utf-8'; - $this->setBaseUrl($url); - $this->post(null, $report, $content_type, $accept_type); - $this->restoreBaseUrl(); - $response = $this->responseText; - return $response; + $this->post($url, $report, $content_type, $accept_type); + $response = $this->responseText; + return $response; } public function saveReportDefinition($report_def) diff --git a/Apigee/Mint/Organization.php b/Apigee/Mint/Organization.php index 1bf0330..b1c2aa0 100644 --- a/Apigee/Mint/Organization.php +++ b/Apigee/Mint/Organization.php @@ -699,13 +699,11 @@ public function getPrepaidBalanceReport($month, $year, $developer_id, $currency_ 'billingYear' => $year ); - $url = '/mint/organizations/' . rawurlencode($this->config->orgName) . '/prepaid-balance-reports'; - $content_type = 'application/json; charset=utf-8'; - $accept_type = 'application/octet-stream; charset=utf-8'; - $this->setBaseUrl($url); - $this->post(null, $data, $content_type, $accept_type); - $this->restoreBaseUrl(); - $response = $this->responseText; + $url = rawurlencode($this->config->orgName) . '/prepaid-balance-reports'; + $content_type = 'application/json; charset=utf-8'; + $accept_type = 'application/octet-stream; charset=utf-8'; + $this->post($url, $data, $content_type, $accept_type); + $response = $this->responseText; } catch (ResponseException $re) { if (MintApiException::isMintExceptionCode($re)) { throw new MintApiException($re);