PHPackages                             bennito254/co-opconnect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bennito254/co-opconnect

ActiveLibrary[API Development](/categories/api)

bennito254/co-opconnect
=======================

Wrapper for the Co-op Bank API

v0.0.1(6y ago)2264MITPHPPHP &gt;=7.1.0

Since Apr 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bennito254/co-opconnect)[ Packagist](https://packagist.org/packages/bennito254/co-opconnect)[ RSS](/packages/bennito254-co-opconnect/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

CO-OP Connect
=============

[](#co-op-connect)

PHP wrapper for the Co-op Bank API at  for the sandbox only.

Support for Production API will be coming soon!

Installation
------------

[](#installation)

```
composer require bennito254/co-opconnect

```

Setup
-----

[](#setup)

Initialize the Bank class with Consumer Key, Consumer Secret and Production environment as arguments

```
$bank = \Bennito254\CoopBank\Bank($consumerKey, $consumerSecret, $env = 'sandbox'); //or live

```

Usage
-----

[](#usage)

### Account Information

[](#account-information)

#### Account Balance

[](#account-balance)

```
$accountNumber = "36001873000";
$messageReference = "Randomstr1ng";
$balance = $bank->account()->balance($accountNumber, $messageReference);

```

#### Exchange Rates

[](#exchange-rates)

```
$messageReference = "Randomstr1ng";
$fromCurrency = "KES";
$toCurrency = "USD";
$rate = $bank->account()->exchangeRate($messageReference, $fromCurrency, $toCurrency);

```

#### Account Number Validation

[](#account-number-validation)

```
$messageReference = "Randomstr1ng";
$accountNumberToCheck = "36001873000";
$rate = $bank->account()->validation($messageReference, $accountNumberToCheck);

```

### Send Money

[](#send-money)

#### Send To M-Pesa

[](#send-to-m-pesa)

```
$mpesa_destination = [
    'ReferenceNumber'   => 'Rand0mStrseing',
    'MobileNumber'      => "0716483805",
    'Amount'            => 10,
    'Narration'         => 'Awesome sendoff'
];
$response = $bank->sendMoney()->sendToMpesa('36001873000', 'newRandomString', 'https://dev.bennito254.com/cb.php', 'KES', 10, $mpesa_destination, 'Send to Bennito');

```

#### Send via PesaLink

[](#send-via-pesalink)

```
$pesalink_destination = [
    'ReferenceNumber'   => 'Rand0mStringss',
    'AccountNumber'     => "54321987654321",
    'BankCode'          => "11",
    'Amount'            => 10,
    'TransactionCurrency'   => 'KES',
    'Narration'         => 'Awesome sendoff'
];
$response = $bank->sendMoney()->pesalinkSendToAccount('36001873000', 'newRandomString', 'https://dev.bennito254.com/cb.php', 'KES', 10, $pesalink_destination, 'Send to Bennito');

```

#### Send to Another Account

[](#send-to-another-account)

```
$account_destination = [
    'ReferenceNumber'   => 'Rand0mStringasss',
    'AccountNumber'     => "54321987654321",
    'Amount'            => 10,
    'TransactionCurrency'   => 'KES',
    'Narration'         => 'Awesome sendoff'
];
$response = $bank->sendMoney()->accountToAccount('36001873000', 'benniastweo23', 'https://dev.bennito254.com/cb.php', 'KES', 10, $account_destination, 'Send to Bennito');

```

#### Simulate Transaction

[](#simulate-transaction)

```
$simulation = [
    'MessageReference'      => 'jkgasjkfgsaf',
    'MessageDateTime'       => '2020-04-06T10:19:07.100Z',
    'ServiceName'           => '',
    'NotificationCode'      => '',
    'PaymentRef'            => 'REF000012323',
    'AccountNumber'         => '823547857835434',
    'Amount'                => "12000.00",
    'TransactionDate'       => '20190301165420',
    'EventType'             => 'DEBIT',
    'Currency'              => 'KES',
    'ExchangeRate'          => '1',
    'Narration'             => 'Supplier payments',
    'CustMemo'              => [
        'CustMemoLine1' => '785347855 75',
        'CustMemoLine2' => '',
        'CustMemoLine3' => ''
    ],
    'ValueDate'             => '20190301',
    'EntryDate'             => '20190301',
    'TransactionId'         => '8963478382745'
];
$response = $bank->sendMoney()->INSSimulation($simulation);

```

### Account Statements

[](#account-statements)

#### Mini Statement

[](#mini-statement)

```
$accountNumber = '36001873000';
$messageReference = 'randomString';
$bank->statements()->miniStatement($accountNumber, $messageReference);

```

#### Full Statement

[](#full-statement)

```
$accountNumber = '36001873000';
$messageReference = 'randomString';
$startDate = "2020-03-01";
$endDate = "2020-04-01";
$bank->statements()->miniStatement($accountNumber, $messageReference, $startDate, $endDate);

```

### Transactions

[](#transactions)

#### Latest Transactions

[](#latest-transactions)

```
$accountNumber = '36001873000';
$messageReference = 'randomString';
$numberOfTransactions = "10";
$bank->transactions()->accountTransactions($accountNumber, $messageReference, $numberOfTransactions);

```

#### Transaction Status

[](#transaction-status)

```
$messageReference = 'ExistingRandomString';
$bank->transactions()->transactionStatus($messageReference);

```

Licence
-------

[](#licence)

MIT Licence

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/687082c4c697d13f21c03c1443459e16897bc94c98e6eb87fa87def757336504?d=identicon)[bennito254](/maintainers/bennito254)

---

Top Contributors

[![bennito254](https://avatars.githubusercontent.com/u/6911766?v=4)](https://github.com/bennito254 "bennito254 (9 commits)")

---

Tags

apico-op bankco-op api

### Embed Badge

![Health badge](/badges/bennito254-co-opconnect/health.svg)

```
[![Health](https://phpackages.com/badges/bennito254-co-opconnect/health.svg)](https://phpackages.com/packages/bennito254-co-opconnect)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[get-stream/stream-chat

A PHP client for Stream Chat (https://getstream.io/chat/)

301.8M2](/packages/get-stream-stream-chat)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
