Permalink
Browse files

Support for client_secret added

  • Loading branch information...
1 parent da49ad4 commit 0c70fe6356ec5b2a07172d9f9318be58f803a8df @lennytmp lennytmp committed Apr 2, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/yamoney/ym.php
View
7 src/yamoney/ym.php
@@ -108,6 +108,8 @@ public function receiveOAuthToken($code, $redirectUri);
* Требуемые права токена: account-info
* @abstract
* @param $accessToken string токен авторизации пользователя
+ * @param $redirectUri string URI, на который OAuth-сервер передает результат авторизации
+ * @param $client_secret string cекретное слово для проверки подлинности приложения
* @return YMAccountInfoResponse возвращает экземпляр класса AccountInfoResponse
*/
public function accountInfo($accessToken);
@@ -257,11 +259,14 @@ public static function authorize($clientId, $scope = NULL, $redirectUri = NULL)
die();
}
- public function receiveOAuthToken($code, $redirectUri) {
+ public function receiveOAuthToken($code, $redirectUri, $client_secret = null) {
$paramArray['grant_type'] = 'authorization_code';
$paramArray['client_id'] = $this->clientId;
$paramArray['code'] = $code;
$paramArray['redirect_uri'] = $redirectUri;
+ if ($client_secret) {
+ $paramArray['client_secret'] = $client_secret;
+ }
$params = http_build_query($paramArray);
$curl = $this->initCurl(self::URI_YM_TOKEN, $this->certificateChain, $params);

0 comments on commit 0c70fe6

Please sign in to comment.