digikraaft/mono-php

PHP Implementation of Mono API

v1.1.0 2022-02-16 10:22 UTC

This package is auto-updated.

Last update: 2024-05-16 15:55:54 UTC


README

run-tests Build Status Scrutinizer Code Quality Code Intelligence Status License: MIT

This package provides an expressive and convenient way to interact with the Mono API.

IMPORTANT NOTICE

Please note that the Mono API is not currently in private beta, this package is a pre-lease and therefore may not be stable enough for production. Use at your discretion!

We will continue to update this package as new features are being added to the Mono API.

Installation

You can install the package via composer:

composer require digikraaft/mono-php

Usage

All APIs documented in Mono's API Reference are currently supported by this package.

Authentication

Before using any of the endpoints, you will have to authenticate the current account with the endpoint account/auth :

<?php 

include_once('vendor/autoload.php');


use Digikraaft\Mono\Mono;


Mono::setSecretKey('TEST_1234abcd');

$codeFromMonoConnect = "5eadinitaewqwuis";

$account = Account::authenticate($codeFromMonoConnect);

$accountId = $account->data->id;

Available Methods

A list of the available methods are documented below:

Account

  • authenticate(string $codeFromConnect) : Array|Object
  • bvnLookup($params = null) : Array|Object
  • details(string $accountId) : Array|Object
  • fetchStatement(string $accountId, array $filters) : Array|Object
  • identity(string $accountId) : Array|Object
  • income(string $accountId) : Array|Object
  • listTransactions(string $accountId, array $filters) : Array|Object
  • pollStatementPdfStatus(string $accountId, string $jobId) : Array|Object
  • reAuthorise(string $accountId, ?array $params = null) : Array|Object
  • sync(string $accountId, ?array $params = null) : Array|Object
  • unlink(string $accountId, ?array $params = null) : Array|Object

Mono

  • getSecretKey(): string
  • setSecretKey(string $secretKey)
  • coverage() : Array|Object

Payment

  • initiate(array $params) : Array|Object
  • onetimeDebitStatus(string $paymentId) : Array|Object
  • recurringDebitStatus(string $paymentId) : Array|Object

Plan

  • create(array $params) : Array|Object
  • delete(string $paymentId) : Array|Object
  • list(string $paymentId) : Array|Object
  • update(string $paymentId, array $params) : Array|Object

Wallet

  • balance() : Array|Object

This package returns the exact response from the Mono API but as the stdClass type.

Testing

composer test

More Good Stuff

Check here for more awesome free stuff!

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email hello@digikraaft.ng instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.