B2C-Billers-Java
This repository contains Java SDK and samples for Business to Consumer bill payments.
Prerequisites
- Java JDK 6 or higher
- An environment which supports TLS 1.2
- Interswitch Base Library Click here
Welcome
Read our FAQs here
Biller
A biller is any Organization/Institution/Business that is able to exchange services for a fee. e.g Telecoms provider(Airtel, Glo, MTN), Government Body(Lagos State) etc.
Category
Billers are grouped under categories. For instance, all cable providers(DSTV, GOTV) can e grouped under a cable
Category.
Customer
An individual that has an intent and/or pays for any of the services offered by a Biller.
PaymentItem
A biller(e.g DSTV) can offer different services and hence different prices for them. Each of those services, falls under a payment-item and has a unique payment-item-code. We say that a user has intent to pay for a payment-item offered by a Biller. An example of a payment-item under DSTV is the DSTV Premium Bouquet
What this SDK provides for you
Get All Billers
1 2 |
Get a list of all billers supported on our platform. |
Get All Categorys
1 2 |
Get a list of all categorys and associated billers supported on our platform. |
Get All Billers under a Category
1 2 |
Get a list of all biilers under a particular category. |
Get Biller Payment Items
1 2 |
Get a list of all payment-items under aparticular Biller. |
Validate Customer
1 2 |
Validates a customer-id under a particular biller. |
Make payment for a customer
1 2 |
Makes a payment for a payment-item for a particular customer. |
Query the status of a transaction
1 2 |
Query the status of a transaction made in the past based on the Request Reference |
Quick start
Maven
1 2 3 4 5 6 |
<dependency> <groupId>com.interswitch</groupId> <artifactId>interswitch-java</artifactId> <version>0.0.1</version> </dependency> |
Samples
Check out the samples folder for sample code on all the features above.
Support Team
Still experiencing issues, quickly talk to our Engineers at Support chat or Support chat and get your issues fixed in a giffy.
Interswitch Funds Transfer for Java.
This repository contains Java SDK and samples for Business to Consumer funds transfer.
Prerequisites
- Java JDK 6 or higher
- An environment which supports TLS 1.2
- Interswitch Base Library Click here
What this SDK provides for you
- Fetch all banks Get a list of all banks supported on our platform.
- Account Number Validation Validates an account number against a particular bank
- Funds Transfer. Transfers funds from a senders account to receivers account.
Quick start
Maven
1 2 3 4 5 6 7 8 9 10 11 |
<dependency> <groupId>com.interswitch</groupId> <artifactId>interswitch-java</artifactId> <version>0.0.1</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.6.2</version> </dependency> |
Fetch All Banks Request
To get you started, try out our simple Fetch all banks request.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<span class="pl-k">import</span> <span class="pl-smi">com.interswitch.techquest.auth.Interswitch</span>; <span class="pl-k">import</span> <span class="pl-smi">com.interswitch.transfer.FundsTransfer</span>; <span class="pl-k">private</span> <span class="pl-k">static</span> <span class="pl-k">final</span> <span class="pl-smi">String</span> initiatingEntityCode <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>XXT<span class="pl-pds">"</span></span>; <span class="pl-k">private</span> <span class="pl-k">final</span> <span class="pl-k">static</span> <span class="pl-smi">String</span> clientId <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>IKIA6570778A3484D6F33BC7E4165ADCA6CF06B2860A<span class="pl-pds">"</span></span>; <span class="pl-k">private</span> <span class="pl-k">final</span> <span class="pl-k">static</span> <span class="pl-smi">String</span> clientSecret <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>DXfUwpuIvMAKN84kv38uspqGOsStgFS0oZMjU7bPwpU=<span class="pl-pds">"</span></span>; <span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-k">void</span> main(<span class="pl-k">String</span>[] args) { <span class="pl-smi">FundsTransfer</span> transfer <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-smi">FundsTransfer</span>(clientId, clientSecret, <span class="pl-smi">Interswitch</span><span class="pl-c1"><span class="pl-k">.</span>ENV_SANDBOX</span>); <span class="pl-k">try</span> { <span class="pl-smi">BankResponse</span> bankResponse <span class="pl-k">=</span> transfer<span class="pl-k">.</span>fetchBanks(); <span class="pl-k">Bank</span>[] bank <span class="pl-k">=</span> bankResponse<span class="pl-k">.</span>getBanks(); <span class="pl-c">// a bank array of all banks</span> <span class="pl-k">if</span> (bank <span class="pl-k">instanceof</span> <span class="pl-smi">Object</span>) { <span class="pl-c">// successful</span> <span class="pl-smi">Bank</span> testBank <span class="pl-k">=</span> bank[<span class="pl-c1">0</span>]; <span class="pl-c">// bank at index 0</span> <span class="pl-smi">String</span> cbnCode <span class="pl-k">=</span> testBank<span class="pl-k">.</span>getCbnCode(); <span class="pl-c">// Central bank code</span> <span class="pl-smi">String</span> bankName <span class="pl-k">=</span> testBank<span class="pl-k">.</span>getBankName(); <span class="pl-c">// bank name:</span> <span class="pl-smi">String</span> bankCode <span class="pl-k">=</span> testBank<span class="pl-k">.</span>getBankCode(); <span class="pl-c">// bankcode in alphabetical form: UBA, GTB, FBN</span> } } <span class="pl-k">catch</span>(<span class="pl-smi">Exception</span> ex) { <span class="pl-c">//</span> ex<span class="pl-k">.</span>printStackTrace(); } } |
Support Team
Still experiencing issues, quickly talk to our Engineers at Support chat or Support chat and get your issues fixed in a giffy.