thepixeldeveloper/mondo-client

PHP Mondo Bank 客户端

0.0.1 2016-03-04 21:07 UTC

README

Author Version Status Software License Packagist Version SensioLabsInsight Scrutinizer Code Quality

Mondo Bank API 客户端 - https://getmondo.co.uk/docs

此库是一个最小可行产品,仅支持基本功能。
尚不支持分页、扩展和文件上传。欢迎提交拉取请求。

安装

composer require thepixeldeveloper/mondo-client

快速开始

// Get an instance of the Guzzle client
$guzzleClient = (new Thepixeldeveloper\Mondo\GuzzleClientFactory(getenv('ACCESS_TOKEN')))->getClient();

// and create a Mondo client
$client = new Thepixeldeveloper\Mondo\Client($guzzleClient, SerializerBuilder::create()->build());

// Pass the client into the relevant Client class.
$ping = new Thepixeldeveloper\Mondo\Client\Ping($client);

// Response is of the type Thepixeldeveloper\Mondo\Response\Ping\WhoAmI
$response = $ping->whoAmI();

账户

$accounts = new Thepixeldeveloper\Mondo\Client\Accounts($client);
$accounts->getAccounts();

余额

$balance = new Thepixeldeveloper\Mondo\Client\Balance($client);
$balance->getBalanceForAccountId(123);

交易

$transactions = new Thepixeldeveloper\Mondo\Client\Transactions($client);
$transactions->getTransactionsForAccountId(123);
$transactions->getTransaction(456);

OAuth 2

我决定在 MVP 中省略认证。使用类似 League/oauth2-client 的库来获取访问令牌。

测试

使用 ... 运行 phpSpec 测试

composer test