stephenjude / blochq-php-sdk
An SDK to easily work with the BlocHQ API
1.0.7
2023-03-15 01:30 UTC
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0
- nesbot/carbon: ^2.35.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- psalm/plugin-laravel: ^1.2
- vlucas/phpdotenv: ^4.0
README
This SDK lets you perform API calls to BlocHQ APIs.
Documentation
Installation
To install the SDK in your project you need to require the package via composer:
composer require stephenjude/blochq-php-sdk
Basic Usage
You can create an instance of the SDK like so:
$blocHQ = new \Stephenjude\BlocHqPhpSdk\BlocHQ(TOKEN_HERE);
Manage Account
$blocHQ->createCollectionAccount();
$account = $blocHQ->getAccountByAccountNumber(ACCOUNT_NUMBER); $account = $blocHQ->getAccountById(ID); $account->freeze(); $account->unfreeze(); $account->close(); $account->reopen(); $account->credit(AMOUNT); // Simulation endpoint $account->debit(AMOUNT); // Simulation endpoint
Manage Transfers
$blocHQ->transferFromOrgBalance(AMOUNT, ACCOUNT_NUMBER, BANK_CODE, NARRATION, [META_DATA]);
Manage Transactions
$blocHQ->getAllTransactions(); $blocHQ->getTransactionById(TRANSACTION_ID); $blocHQ->getTransactionByReference(TRANSACTION_REFERENCE);
Manage Banks
$blocHQ->getBankList(); $blocHQ->resolveBankAccount(ACCOUNT_NUMBER, BANK_CODE);
API Reference
All API references can be found on BlocHQ documentation website.
Security
If you discover any security related issues, please email jude@pay4me.app instead of using the issue tracker.
Credits
This package uses code from and is greatly inspired by the Ohdear SDK package by Freek & Mattias Geniar.
License
The MIT License (MIT). Please see License File for more information.