HOW TO USE THE COOPERATIVE BANK KENYA API USING JAVA

cooperative bank Kenya

Installation

Requirements

Others

Usage

Initialization

Bank bank = new Bank("CONSUMER KEY", "CONSUMER_SECRET", Constants.sandbox );

Account Balance

AccountBalance response = bank.getAccountBalance("MESSAGE REFERENCE", "ACCOUNT NUMBER");

Account Full Statement

AccountFullStatement response = bank.getAccountFullStatement("MESSAGE REFERENCE", "ACCOUNT NUMBER", "STARTDATE", "ENDDATE");

Account Mini Statement

AccountMiniStatement response = bank.getAccountMiniStatement("MESSAGE REFERENCE", "ACCOUNT NUMBER");

Account Transactions

AccountTransactions response = bank.getAccountTransactions("MESSAGE REFERENCE", "ACCOUNT NUMBER", NUMBER OF TRANSACTIONS);

Account Validation

AccountValidation response = bank.validateAccount("MESSAGE REFERENCE", "ACCOUNT NUMBER" );

Exchange rate

ExchangeRate response = bank.getExchangeRate("MESSAGE REFERENCE", "FROM CURRENCY CODE", "TO CURRENCY CODE" );

Internal Funds Transfer Account ToAccount

ArrayList<DestinationIftAccountToAccount> list = new ArrayList<>();
list.add(new DestinationIftAccountToAccount("REFERENCE NUMBER", "ACCOUNT NUMBER","AMOUNT" , "TRANSACTION CURRENCY", "NARRATION"));
IftAccountToAccount response = bank.transferIftAccountToAccount("MESSAGE REFERENCE", "CALLBACK URL", new Source("ACCOUNT NUMBER", "AMOUNT", "TRANSACTION CURRENCY", "NARRATION"), list);

PesaLink To Account

ArrayList<DestinationPesaLinkToAccount> list = new ArrayList<>();
list.add(new DestinationPesaLinkToAccount("REFERENCE NUMBER", "ACCOUNT NUMBER","AMOUNT" , "TRANSACTION CURRENCY", "NARRATION"));
PesaLinkToAccount response = bank.transferFromPesaLinkToAccount("MESSAGE REFERENCE", "CALLBACK URL", new Source("ACCOUNT NUMBER", "AMOUNT", "TRANSACTION CURRENCY", "NARRATION"), list);

PesaLink To Phone

ArrayList<DestinationPesaLinkSendToPhone> list = new ArrayList<>();
list.add(new DestinationPesaLinkSendToPhone("REFERENCE NUMBER", "PHONENUMBER","AMOUNT" , "TRANSACTION CURRENCY", "NARRATION"));
PesaLinkSendToPhone response = bank.transferFromPesaLinkToPhone("MESSAGE REFERENCE", "CALLBACK URL", new Source("ACCOUNT NUMBER", "AMOUNT", "TRANSACTION CURRENCY", "NARRATION"), list);

Send To Mpesa

ArrayList<DestinationMpesa> list = new ArrayList<>();
list.add(new DestinationMpesa("REFERENCE NUMBER", "PHONENUMBER","AMOUNT" , "TRANSACTION CURRENCY", "NARRATION"));
SendToMpesa response = bank.sendToMpesa("MESSAGE REFERENCE", "CALLBACK URL", new Source("ACCOUNT NUMBER", "AMOUNT", "TRANSACTION CURRENCY", "NARRATION"), list);

Transaction Status

TransactionStatus response = bank.checkTransactionStatus("MESSAGE REFERENCE");

Going Live

Other SDKS

Help & Support

Product Design | Software Development

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Fun with BigQuery and R — Building a Google Analytics Alternate

Diving into a new Framework. From Ruby on Rails to ASP .Net — C#

A look back on OCaml since 2011

How to enable Magento 2 In-Store Pickup?

How to Ignore a Collider on a GameObject

Provisioning an Alibaba Cloud Kubernetes (ACK) Multi-AZ Kubernetes Cluster Using Terraform

From Architecture to Code: Analysis of the Latest Trends in Software Development

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Isaac Sichangi

Isaac Sichangi

Product Design | Software Development

More from Medium

Debugging Concurrent Systems with a Model Checker

We’re proud to sponsor Babel.js in 2022 — and you should too!

Akka/Scala Based Data Generator to model UE mobility events

Transform operator in web flux