| @@ -156,18 +156,14 @@ | ||
| 156 | 156 | 'oauth_signature_method' => $this->oauth_signature_method(), |
| 157 | 157 | 'oauth_signature' => $signature, |
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | - $end_point = $this->request_token_URL(); | |
| 161 | - if ('GET' === $method) { | |
| 162 | - $end_point .= '?' . self::build_query($parameters); | |
| 163 | - $parameters = null; | |
| 164 | - } | |
| 160 | + $end_point = $this->request_token_URL(); | |
| 161 | + $end_point .= '?' . self::build_query($parameters); | |
| 162 | + $parameters = null; | |
| 165 | 163 | |
| 166 | 164 | $response = Photonic::http($end_point, $method, $parameters); |
| 167 | - $token = $this->parse_token($response); | |
| 168 | - | |
| 169 | - return $token; | |
| 165 | + return $this->parse_token($response); | |
| 170 | 166 | } |
| 171 | 167 | |
| 172 | 168 | /** |
| 173 | 169 | * Takes an OAuth request token and exchanges it for an access token. |
| @@ -191,19 +187,14 @@ | ||
| 191 | 187 | if (isset($request_token['oauth_verifier'])) { |
| 192 | 188 | $parameters['oauth_verifier'] = $request_token['oauth_verifier']; |
| 193 | 189 | } |
| 194 | 190 | |
| 195 | - $end_point = $this->access_token_URL(); | |
| 191 | + $end_point = $this->access_token_URL(); | |
| 192 | + $end_point .= '?' . self::build_query($parameters); | |
| 193 | + $parameters = null; | |
| 196 | 194 | |
| 197 | - if ('GET' === $method) { | |
| 198 | - $end_point .= '?' . self::build_query($parameters); | |
| 199 | - $parameters = null; | |
| 200 | - } | |
| 201 | - | |
| 202 | 195 | $response = Photonic::http($end_point, $method, $parameters); |
| 203 | - $token = $this->parse_token($response); | |
| 204 | - | |
| 205 | - return $token; | |
| 196 | + return $this->parse_token($response); | |
| 206 | 197 | } |
| 207 | 198 | |
| 208 | 199 | /** |
| 209 | 200 | * Takes the response for the "Check access token", then tries to determine whether the check was successful or not. |