bluedot-dev / laravel-unit-sdk
Unit API SDK
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.1.3
2024-01-31 13:56 UTC
Requires
- php: ^8.1|^8.2
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.5
- laravel/framework: ^9.48.0 || ^10.0.0
README
Require package
composer require bluedot-dev/laravel-unit-sdk
Publish vendor
php artisan vendor:publish --tag=bluedot-unit
Usage
BASIC
use BluedotDev\Unit\Facades\Unit; $results = Unit::getTransactions();
DATA TYPES
use BluedotDev\Unit\Facades\Unit; // GET DATA AS MODEL $result = Unit::getAccountById($accountId); // GET DATA AS ARRAY $resultAsArray = Unit::getAccountById()->toArray(); // GET DATA AS MODEL STACK IN RESPONSE CLASS $response = Unit::getTransactions(); // GET RESULT STATUS CODE $statusCode = Unit::getTokenList()->getStatusCode();
WORKING WITH LIST
use BluedotDev\Unit\Facades\Unit; $responseClass = Unit::getTransactions(); // returns Response foreach ($responseClass->result as $transaction) { dd($transaction); }
WORKING WITH MODEL
use BluedotDev\Unit\Facades\Unit; $transaction = Unit::getTransactionById($accountId, $transaction); $transactionId = $transaction->id;
AVAILABLE METHODS
Accounts
use BluedotDev\Unit\Facades\Unit; Unit::createToken(int $userId):Response Unit::getTokenList(int $userId):Response Unit::getAccounts():Response|Model Unit::createAccount(?array $data, int $customerId): Model Unit::closeAccount(?array $data, int $accountId): Model Unit::reopenAccount(int $accountId): Model Unit::freezeAccount(?array $data, int $accountId): Model Unit::unfreezeAccount(int $accountId): Model Unit::getAccountById(int $accountId): Model Unit::limits(int $accountId): Model Unit::getTransactions(...$filters):Response|model Unit::getTransactionById(string $accountId, string $transactionId):Response|model Unit::createReward(array $data, string $fundingAccountId = null):Model Unit::createFee(array $data): Model
Transactions
use BluedotDev\Unit\Facades\Unit; Unit::getTransactions(); Unit::getTransactionById(string $accountId, string $accountId);