dotlines-io/ghoori
Composer 安装命令:
composer require dotlines-io/ghoori
包简介
This is the core package for Ghoori Payment integration. Both for OnDemand and Subscription Payment Integration
关键字:
README 文档
README
This composer package can be used for Payment API Authentication & Authorization with Ghoori Platform. For the credentials, please contact with support@ghoori.com.bd or call 8809612332215
Installation
You can install the package via composer:
composer require dotlines-io/ghoori
Usage
/** * ****************************************************** * ******************* Token Fetching ******************* * *********** Contact Ghoori For Credentials *********** * ****************************************************** */ $tokenUrl = 'https://<SERVER_URL>/oauth/token'; $username = ''; $password = ''; $clientID = ''; $clientSecret = ''; $accessTokenRequest = \Dotlines\Ghoori\AccessTokenRequest::getInstance($tokenUrl, $username, $password, $clientID, $clientSecret); $tokenResponse = $accessTokenRequest->send(); echo json_encode($tokenResponse) . '<br/>'; /** * Access Token Request Response looks like below: * { * "token_type": "Bearer", * "expires_in": 3600, * "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdW.....", * "refresh_token": "def50200284b2371cad76b4d2a4e24746c44fd6a322....." * } */ /** * Access Token can be cached and reused for 1 hour * Before the end of accessToken lifetime every hour * you can use the refresh token to fetch new accessToken & refreshToken */ $accessToken = $tokenResponse['access_token']; $refreshToken = $tokenResponse['refresh_token']; /** * ****************************************************** * ******************* Refresh Token ******************* * ****************************************************** */ $refreshTokenRequest = \Dotlines\Ghoori\RefreshTokenRequest::getInstance($tokenUrl, $accessToken, $clientID, $clientSecret, $refreshToken); $tokenResponse = $refreshTokenRequest->send(); echo json_encode($tokenResponse) . '<br/>'; /** * Refresh Token Request Response looks like below: * { * "token_type": "Bearer", * "expires_in": 3600, * "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdW.....", * "refresh_token": "def50200284b2371cad76b4d2a4e24746c44fd6a322....." * } */
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 923
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-15