gopague / gopague-php
Go Pague PHP 库
dev-master
2017-05-15 14:49 UTC
Requires
- php: >=7.0.1
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-09-05 10:26:31 UTC
README
要求
PHP 7.0.1 及以上版本。
Composer
您可以通过 Composer 安装绑定。运行以下命令
composer require gopague/gopague-php
要使用 go pague 类,请使用 Composer 的 自动加载
require_once('vendor/autoload.php');
依赖项
此库需要以下扩展才能正常运行
如果您使用 Composer,这些依赖项应自动处理。如果您手动安装,请确保这些扩展可用。
入门
首先,您需要设置用于登录 Go Pague API 的用户电子邮件和密码。
GoPague\Http\Client::setEmail('myemail@foo.bar') GoPague\Http\Client::setPassword('secret');
现在,您可以使用资源绑定类与 Go Pague API 进行交互。
// gets the list of banks $banks = GoPague\Bank::all();
注意:查看
资源绑定类部分以了解所有可用的类和方法。
绑定类将自动使用之前给出的电子邮件和密码在首次 API 请求之前登录和验证到 API。
但如果你想手动验证到 API,只需使用
$credential = GoPague\Http\Client::login('myemail@foo', 'secret'); // gets the list of banks $banks = GoPague\Bank::all(); // ...
您可以通过调用方法随时访问已登录用户数据
$credencial = GoPague\Http\Client::credential(); echo $credential->token; // the Authenticated Token echo $credential->userId; // the Authenticated User Id echo $credential->clientIds; // The client ids linked to the Authenticted User
资源绑定类
@todo
开发
安装依赖项
composer install
测试
如上所述安装依赖项(这将解决 PHPUnit),然后您可以运行测试套件
./vendor/bin/phpunit
许可证
GoPague PHP 库是开源软件,受 MIT 许可证 许可。