nullodyssey/oauth2-revolut
最新稳定版本:1.0
Composer 安装命令:
composer require nullodyssey/oauth2-revolut
包简介
Revolut OAuth 2.0 Client Provider for The PHP League OAuth2-Client
关键字:
README 文档
README
This package provides Revolut OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
Installation
composer require nullodyssey/oauth2-revolut
Usage
Basic Usage
<?php use NullOdyssey\OAuth2\Client\Provider\Revolut; $provider = new Revolut([ 'clientId' => '{revolut-client-id}', 'clientSecret' => '{revolut-client-secret}', 'redirectUri' => 'https://example.com/callback-url', 'privateKey' => '/path/to/private-key.pem', 'isSandbox' => true, // Set to false for production 'version' => 1, // API version (default: 1) ]);
Handle Authorization Response
<?php // Handle the callback from Revolut if (isset($_GET['code'])) { try { // Get an access token using the authorization code $accessToken = $provider->getAccessToken('authorization_code', [ 'code' => $_GET['code'] ]); // Use the access token to make API calls $token = $accessToken->getToken(); $expires = $accessToken->getExpires(); $refreshToken = $accessToken->getRefreshToken(); // Store tokens securely for future use } catch (Exception $e) { // Handle error echo 'Error: ' . $e->getMessage(); } }
Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
clientId |
string | Yes | Your Revolut application's client ID |
clientSecret |
string | Yes | Your Revolut application's client secret |
redirectUri |
string | Yes | Your application's redirect URI |
privateKey |
string | Yes | Path to your private key file |
isSandbox |
bool | No | Whether to use sandbox environment (default: false) |
version |
int | No | API version to use (default: 1) |
Requirements
- PHP 8.3 or higher
- League OAuth2 Client
- Lcobucci JWT
Credits
License
This package is open-sourced software licensed under the MIT license.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email community@nullodyssey.dev instead of using the issue tracker.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-11