Intuitive PHP SDK Co-operative Bank Kenya API
# Co-operative Bank Kenya PHP SDK
Intuitive PHP SDK Co-operative Bank Kenya API
## Pre-requisites
### Create an application
Create or login to your account at
developer.co-opbank.co.ke
On the left panel, you can see a list of menus. Click on Applications to access the list of available applications in which case you can choose to use the default ones or create your own.
### Subscribe to API(s)
* Select the application or create your own application using steps described earlier.
* Click “Subscribe”. A pop up message appears as shown:
### Generate Keys
* Click on “Applications” on the left panel.
* Choose the application for which you want to generate keys
* Choose the appropriate environment from the tabs(production or sandbox ).
* Specify Callback URL and then click “Generate keys”. Leave other fields have default values;
## Installation
Install via composer by typing in your terminal
```cmd
composer require osenco/co-op
```
If you dont use composer you can just download this library from the releases, unzip it in your project and include the autoload.php file in your project.
```php
require_once('path/to/autoload.php');
```
## Setup
Use the `coopSetup` helper function to configure and instantiate our object
```php
$config = array(
"env" => "sandbox",
"consumerKey" => "ss0sD2ANhjvhx_rHU0a6Xf8ROdYa",
"consumerSecret" => "zOfReXCIwn1TfnEYJJJGNP6l3Tka",
"accountNumber" => "54321987654321",
"bankCode" => "011",
"branchCode" => "00011001",
"callbackURL" => "/coop/callback",
"transactionCurrency" => "KES",
);
coopSetup($config);
```
### Usage
We recommend using the following helper functions
### Check Account Balance
Account Balance Enquiry API will enable you to enquire about your own Co-operative Bank accounts' balance as at now for the specified account number
```php
$response = coopAccountBalance(
$messageReference,
$accountNumber = null,
$callback = null
);
```
### Check …