yahaay-labs/upbank-php-sdk

UpBank API的非官方PHP SDK

1.0.31072022 2022-07-31 08:53 UTC

This package is auto-updated.

Last update: 2024-09-29 06:14:53 UTC


README

UpBank API的非官方PHP SDK,用于UpBank API

Latest Version PHP Version tests Total Downloads

UpBank开发者页面

访问https://developer.up.com.au/

获取UpBank个人访问令牌

访问https://api.up.com.au/getting_started

安装

composer require yahaay-labs/upbank-php-sdk

使用

<?php

require './vendor/autoload.php';

use YahaayLabs\UpBank\Client;

$access_token = "[UPBANK ACCESS TOKEN]";

$client = new Client($access_token);

//Get All Accounts in an array of objects
$accounts = $client->accounts->all()->data();

array_walk( $accounts, function($account) {
    echo "{$account->id} => {$account->attributes->displayName} <br/>";
});

获取记录

<?php

//Get All Accounts
$accounts = $client->accounts->all()->data();

//Get All Categories
$accounts = $client->categories->all()->data();

//Get All Tags
$accounts = $client->tags->all()->data();

//Get All Transactions
$accounts = $client->transactions->all()->data();

//Getting specific record
$transactionID = "[TRANSACTION ID]";
$transaction = $client->transactions->get($transactionID)->getRaw();

测试

使用测试仍在进行中

运行测试

composer run test

致谢

贡献

欢迎贡献!更多信息请参见CONTRIBUTING.md

许可协议

MIT许可。更多信息请参见LICENSE