yahaay-labs/upbank-php-sdk

Unofficial PHP SDK for UpBank API

1.0.31072022 2022-07-31 08:53 UTC

This package is auto-updated.

Last update: 2024-03-29 04:39:18 UTC


README

UpBank unofficial PHP SDK for the UpBank API

Latest Version PHP Version tests Total Downloads

UpBank Developer Page

Visit https://developer.up.com.au/

Getting your UpBank Personal Access Token

Visit https://api.up.com.au/getting_started

Installation

composer require yahaay-labs/upbank-php-sdk

Usage

<?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/>";
});

Getting Records

<?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();

Testing

Adding using test is still in the works

To run the test:

composer run test

Credits

Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more info.

LICENSE

MIT license. Please see LICENSE for more info.