B2C-Billers-Csharp
This repository contains Java SDK and samples for Business to Consumer bill payments.
Prerequisites
- Interswitch Base Library dll 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 |
Samples
Check out the samples folder for sample code on all the features above. It contains all the sample code for all features.
Support Team
Still experiencing issues, quickly talk to our Engineers at Support chat or Support chat and get your issues fixed in a giffy.
B2C-Funds-Transfer-Csharp
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
using B2C_Funds_Transfer_Csharp.codec; using B2C_Funds_Transfer_Csharp.transfer; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SampleApp { class AppDriver { static void Main(string[] args) { String initiatingEntityCode = "PBL"; //test clientID and clientSecret //String clientId = "IKIA2EFBE1EF63D1BBE2AF6E59100B98E1D3043F477A"; //String clientSecret = "uAk0Amg6NQwQPcnb9BTJzxvMS6Vz22octQglQ1rfrMA="; // sandbox clientId and clientSecret String clientId = "IKIA6570778A3484D6F33BC7E4165ADCA6CF06B2860A"; String clientSecret = "DXfUwpuIvMAKN84kv38uspqGOsStgFS0oZMjU7bPwpU="; FundsTransfer transfer = new FundsTransfer(clientId, clientSecret, Interswitch.Interswitch.SANDBOX); try { BankResponse bankResponse = transfer.fetchBanks(); Bank[] bank = bankResponse.banks; // a bank array of all banks if (bank != null) { // successful Bank testBank = bank[0]; // bank at index 0 String cbnCode = testBank.cbnCode; // Central bank code String bankName = testBank.bankName; // bank name: String bankCode = testBank.bankCode; // bankcode in alphabetical form: UBA, GTB, FBN TransferRequest request = new TransferRequestBuilder(initiatingEntityCode).begin() .amount("100000") // mandatory, minor denomination .channel(FundsTransfer.LOCATION) // mandatory: ATM-1, POS-2, WEB-3, MOBILE-4, KIOSK-5, PCPOS-6, LOCATION-7, DIRECT DEBIT-8 .destinationBankCode(cbnCode)/* mandatory: To be gotten from the get all banks code (transfer.fetchBanks())*/ .toAccountNumber("0114951936") // mandatory .requestRef("60360575603527")// mandatory .senderPhoneNumber("07036913492") // optional .senderEmail("grandeur_man@yahoo.com") // optional .senderLastName("Desmond") // optional .senderOtherNames("Samuel") // optional .receiverPhoneNumber("07036913492") // optional .receiverEmail("grandeur_man@yahoo.com") // optional .receiverLastName("Desmond") // optional .receiverOtherNames("Samuel") // optional .fee("10000")// optional (minor denomination) .build(); AccountValidation validationResponse = transfer.validateAccount(request);// validate account if (validationResponse is AccountValidation) { String accountName = validationResponse.accountName; } TransferResponse response = transfer.send(request); // send transfer request if (response.error is ErrorResponse) { // NOT SUCCESSFUL String code = response.error.code; String message = response.error.message; } else if (response.responseCode.Equals("90000")) { // SUCCESS String mac = response.mac; String transactionDate = response.transactionDate; String responseCode = response.responseCode; } else { // transfer was not successful } } else { // transfer was not successful } } catch (Exception ex) { } } } } |