stephenjude/blochq-php-sdk

An SDK to easily work with the BlocHQ API

1.0.7 2023-03-15 01:30 UTC

This package is auto-updated.

Last update: 2024-12-15 05:21:35 UTC


README

Latest Version on Packagist Tests Total Downloads

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.