PHPackages                             kudmni/oauth2-yandex-money - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. kudmni/oauth2-yandex-money

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

kudmni/oauth2-yandex-money
==========================

Yandex Money OAuth 2.0 Client Provider for The PHP League OAuth2-Client

0.0.3(7y ago)0564MITPHP

Since Sep 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/kudmni/oauth2-yandex-money)[ Packagist](https://packagist.org/packages/kudmni/oauth2-yandex-money)[ RSS](/packages/kudmni-oauth2-yandex-money/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

YandexMoney Provider for OAuth 2.0 Client
=========================================

[](#yandexmoney-provider-for-oauth-20-client)

This package provides Yandex Money OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

Requirements
------------

[](#requirements)

The following versions of PHP are supported.

- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM

Installation
------------

[](#installation)

To install, use composer:

```
composer require kudmni/oauth2-yandex-money

```

Usage
-----

[](#usage)

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new PrCy\OAuth2\Client\Provider\YandexMoney([
    'clientId'     => '{yandex-money-app-id}',
    'clientSecret' => '{yandex-money-app-secret}',
    'redirectUri'  => 'https://example.com/callback-url',
]);

if (!empty($_GET['error'])) {

    // Got an error, probably user denied access
    exit('Got error: ' . $_GET['error']);

} elseif (empty($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->state;
    header('Location: ' . $authUrl);
    exit;

} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    // State is invalid, possible CSRF attack in progress
    unset($_SESSION['oauth2state']);
    exit('Invalid state');

} else {

    // Try to get an access token (using the authorization code grant)
    $token = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    // Optional: Now you have a token you can look up an account data
    try {

        // We got an access token, let's now get the owner details
        $ownerDetails = $provider->getResourceOwner($token);

        // Use these details
        printf('Your account is %s', $ownerDetails->getAccount());

    } catch (Exception $e) {

        // Failed to get account details
        exit('Something went wrong: ' . $e->getMessage());

    }

    // Use this to interact with an API on the account behalf
    echo $token->accessToken;

    // Use this to get a new access token if the old one expires
    echo $token->refreshToken;

    // Number of seconds until the access token will expire, and need refreshing
    echo $token->expires;
}
```

### Refreshing a Token

[](#refreshing-a-token)

```
$provider = new PrCy\OAuth2\Client\Provider\YandexMoney([
    'clientId'     => '{yandex-money-app-id}',
    'clientSecret' => '{yandex-money-app-secret}',
    'redirectUri'  => 'https://example.com/callback-url',
]);

$grant = new PrCy\OAuth2\Client\Grant\RefreshToken();
$token = $provider->getAccessToken($grant, ['refresh_token' => $refreshToken]);
```

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/kudmni/oauth2-yandex-money/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Woody Gilk](https://github.com/shadowhand)
- [All Contributors](https://github.com/kudmni/oauth2-yandex-money/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/kudmni/oauth2-yandex-money/blob/master/LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~170 days

Total

3

Last Release

2816d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6409099?v=4)[Dmitrii Kuznetsov](/maintainers/kudmni)[@kudmni](https://github.com/kudmni)

---

Top Contributors

[![kudmni](https://avatars.githubusercontent.com/u/6409099?v=4)](https://github.com/kudmni "kudmni (5 commits)")

---

Tags

clientmoneyAuthenticationoauthoauth2authorizationyandex

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kudmni-oauth2-yandex-money/health.svg)

```
[![Health](https://phpackages.com/badges/kudmni-oauth2-yandex-money/health.svg)](https://phpackages.com/packages/kudmni-oauth2-yandex-money)
```

###  Alternatives

[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[cakedc/oauth2-cognito

Cognito OAuth 2.0 Client Provider for The PHP League OAuth2-Client

18597.7k](/packages/cakedc-oauth2-cognito)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
