bixbyte/jambopay

There is no license information available for the latest version (dev-composer) of this package.

An SDK package for intergration with the JamboPay payment gateway.

dev-composer 2018-03-27 06:20 UTC

This package is not auto-updated.

Last update: 2024-10-04 03:33:32 UTC


README

This is the unofficial php integration module for integration with the Jambopay API

All of the methods called return promises and can therefore be easily chained

INSTALLATION

Navigate to your project directory Run

composer install bixbyte\jambopay

on your CLI.

1. GETTING STARTED

$GLOBALS["LOGIN_PARAMS"]  = [
    "username" => "YOUR_USERNAME", 
    "password" => "YOUR_PASSWORD",
    "app_key"  => "YOUR_JAMBOPAY_APP_KEY"
];

The above sets the access credentials for use with the package

2. SET THE ENDPOINT URL

( Not necessary if using 192.168.11.22 [for tests] via VPN )

Example:

$GLOBALS["JAMBOPAY"]      = "YOUR_JAMBOPAY_URL";

3. STARTUP ()

Example:

include( __DIR__."/index.php" );

3. DECLARE DEPENDENCY (use jambopay)

Example:

use jambopay;

HEADERS PARAMETER

This should essentialy be left blank but can be used to inject custom headers where need arises :

`$headers` in the various methods below.

This applies for each of the methods that accepts a headers parameter.

USER METHODS

1. NAIROBI COUNTY COUNCIL PAYMENTS (jambopay\ncc)

Instantiate the class

$ncc_ubp = new jambopay\ncc\UBP();

A). UNIVERSAL BUSINESS PERMIT (jambopay\ncc\UBP())

UBP REGISTRATION

Available methods

a). .get_sbp_classes({PhoneNumber,ActivityID},$headers)

This method gets all the business categories for all businesses as classified by the Nairobi County Government.

The ActivityID (basically a class/category into which the business falls) in the response will be used on the .get_sbp_sub_classes call.

Example:

$ncc_ubp->get_sbp_classes([ 
    "PhoneNumber" => "...",
    "ActivityID"  => "..."
]);

b). __.get_sbp_sub_classes({PhoneNumber,ID},$headers)__

The above request gets you the business sub-Classes related to the Activity ID.

The sub-ClassID on the response will be used in the .get_sbp_activity_charges call.

Example:

$ncc_ubp->get_sbp_sub_classes([ 
    "PhoneNumber" => "...",
    "ID"          => "..."
]);   

c). __.get_sbp_activity_charges({PhoneNumber,subclassID},$headers)__

The ChargeID parameter in the response can be used as a filtering parameter when making subsequent calls

Example:

$ncc_ubp->get_sbp_activity_charges([ 
    "PhoneNumber" => "...",
    "subclassID"  => "..."
]);

d). .get_sbp_activity_sub_counties($headers)

This call lists all the sub-counties within Nairobi county. The client chooses this and the subsequent call in order to help determine his/her business’ approximate location.

Example:

$ncc_ubp->get_sbp_activity_sub_counties();

e). .get_sbp_wards({id},$headers)

This call lists all the wards within a given Sub-county in the County.

Example:

$ncc_ubp->get_sbp_wards([ 
        "id" => "..."
]);

f). __.prepare_payment({Year,Names,PhoneNumber,PhonePin,IDNumber,ActivityCode,ActivityName,SBPSubClassID,RelativeSize,WardName,ZoneName,AcceptedTnC,WardCode,ZoneCode,BusinessName,Pin,IDDocumentNumber,BusinessClassificationDetails,PremisesArea,NumberOfEmployees,AnnualSBPAmount,PostalCode,Town,Telephone1,Telephone2,FaxNumber,Email,PhysicalAddress,PlotNumber,Building,BuildingCategory,Floor,RoomStallNumber,ContactPersonName,ContactPersonDesignation,ContactPersonPOBox,ContactPersonPostalCode,ContactPersonTown,ContactPersonTelephone1,ContactPersonTelephone2,PaidBy,ApprovalStatus,PaymentTypeID,SBPPaymentType }, headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
BusinessIDString-
YearIntR
TransactionIDString-
NamesStringRIsaac Juma
BillNumberString-
BillStatusString-
PhoneNumberStringR254724659560
PhonePinIntR1234
IDNumberStringR1
ActivityCodeIntR
ActivityNameStringRPainting
SBPSubClassIDIntR1114
RelativeSizeStringR1
WardNameStringR
ZoneNameStringR
AcceptedTnCBooleanR1
WardCodeIntR4
ZoneCodeIntR136
BusinessNameStringRDcyntech
BusinessRegistrationNumberString-
PinStringRJJITYTU767868
VATString-JHJH2323
IDDocumentNumberStringR28734420
BusinessClassificationDetailsStringR1212
OtherBusinessClassificationDetailsString-2121
PremisesAreaStringR121
NumberOfEmployeesIntR121212
AnnualSBPAmountDouble-0
POBoxStringR8782 Nairobi
PostalCodeStringR00100
TownStringRNairobi
Telephone1StringR254717803383
Telephone2StringR254717803383
FaxNumberString-0717803383
EmailStringRijuma@webtribe.com
PhysicalAddressStringRdsfsdfsd
PlotNumberStringR343ffdf
BuildingStringR34634
BuildingCategoryStringRNon-Storey
FloorStringRn\/a
RoomStallNumberStringR12
ContactPersonNameStringRSimiyu Robert
ContactPersonDesignationStringR
ContactPersonPOBoxStringR281 Soy
ContactPersonPostalCodeStringR30105
ContactPersonTownStringR
ContactPersonTelephone1StringR0717803383
ContactPersonTelephone2StringR0717803383
ContactPersonFaxNumberString-3434
PaidByStringRSAMUEL KAHARA
ApprovalStatusInt-0
PaymentTypeIDIntR1
SBPPaymentTypeIntR1
ReceiptNumberString-
LocalReceiptNumberString-
ReferenceNumberString-
BankNameString-
BranchNameString-
Exclusions[0].IDString-ChargeID excludedfrom payment
Exclusions[1].IDString-ChargeID excluded from payment

The transactionID in the response is used to commit the transaction on the .commit_payment call.

Example:

$ncc_ubp->prepare_payment([
    "Year"            => "...",
    "Names"           => "...",
    "PhoneNumber"     => "...",
    "PhonePin"        => "...",
    "IDNumber"        => "...",
    "ActivityCode"    => "...",
    "ActivityName"    => "...",
    "SBPSubClassID"   => "...",
    "RelativeSize"    => "...",
    "WardName"        => "...",
    "ZoneName"        => "...",
    "AcceptedTnC"     => "...",WardCode,"ZoneCode,BusinessName"   => "...",
    "Pin"             => "...",
    "IDDocumentNumber"    => "...",
    "BusinessClassificationDetails"   => "...",
    "PremisesArea"    => "...",
    "NumberOfEmployees"   => "...",
    "AnnualSBPAmount" => "...",
    "PostalCode"      => "...",
    "Town"            => "...",
    "Telephone1"      => "...",
    "Telephone2"      => "...",
    "FaxNumber"       => "...",
    "Email"           => "...",
    "PhysicalAddress" => "...",
    "PlotNumber"      => "...",
    "Building"        => "...",
    "BuildingCategory"    => "...",
    "Floor"           => "...",
    "RoomStallNumber" => "...",
    "ContactPersonName"   => "...",
    "ContactPersonDesignation"    => "...",
    "ContactPersonPOBox"  => "...",
    "ContactPersonPostalCode" => "...",
    "ContactPersonTown"   => "...",
    "ContactPersonTelephone1" => "...",
    "ContactPersonTelephone2" => "...",
    "PaidBy"          => "...",
    "ApprovalStatus"  => "...",
    "PaymentTypeID"   => "...",
    "SBPPaymentType"  => "..."
]);

g). __.commit_payment({PhoneNumber,SBPPaymentType,Tendered,TransactionID,PaymentTypeID,PaidBy,PhonePin},$headers)__

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier e.g. NCC
PhoneNumberStringRAgent Phone number
SBPPaymentTypeIntR1
TenderedDoubleRConfirmation amount of the SBP total bill
TransactionIDStringRUnique ID from the POST response.
PaymentTypeIDIntR1
PaidByStringRPerson Paying for the registration
PhonePinStringRPin of the wallet being debited

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_ubp->commit_payment([
    "PhoneNumber"     => "...",
    "SBPPaymentType"  => "...",
    "Tendered"        => "...",
    "TransactionID"   => "...",
    "PaymentTypeID"   => "...",
    "PaidBy"          => "...",
    "PhonePin"        => "..."
]);

UBP RENEWAL

Available methods

a). __.get_business( {LicenseID,Year,PhoneNumber}, headers )__

This call gets the business details for the business as registered using the LicenseID (BusinessID).

The ActivityID provided in the response is to be used in the subsequent calls.

Example:

$ncc_ubp->get_business([
        "LicenseID"       => "...",
        "Year"            => "...",
        "PhoneNumber"     => "..."
]);

b). __.get_business_class_id( {ActivityID,PhoneNumber} ,headers )__

Gets the business Classes related to the ActivityID.

The ClassID on the response will be used in the subsequent calls.

Example:

$ncc_ubp->get_business_class_id([
    "ActivityID"      => "...",
    "PhoneNumber"     => "..."
]);

c). .get_business_sub_class_id({ID,PhoneNumber},$headers)

The returned SubClassID is used in the .prepare_payment call.

Example:

$ncc_ubp->get_business_sub_class_id([
    "ID"             => "...",
    "PhoneNumber"     => "..."
]);

d). __.prepare_payment({MerchantID,BusinessID,Year,PhoneNumber,PaymentTypeID,SBPSubClassID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant Identifier
BusinessIDStringRLicense ID
YearIntR2017
PhoneNumberStringRPhoneNumber of the wallet
PaymentTypeIDIntR1
SBPSubClassIDIntRID from the getsbpsubclasses call

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_ubp->prepare_payment([
    "MerchantID"          => "...",
    "BusinessID"          => "...",
    "Year"                => "...",
    "PhoneNumber"         => "...",
    "PaymentTypeID"       => "...",
    "SBPSubClassID"       => "..."
]);

e). __.commit_payment({PhoneNumber,MerchantID,TransactionID,Pin,Year,AcceptedTnC,ContactPersonName,IDDocumentNumber,Telephone1,ZoneCode,WardCode,ZoneName,WardName,PlotNumber},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
PhoneNumberStringRWallet PhoneNumber
MerchantIDStringRMerchant identifier
TransactionIDStringRUnique ID from the POST response
PinStringRWallet Pin
YearIntRYear of business permit renewal
AcceptedTnCBooleanRAccept terms and conditions, e.g. True
ContactPersonNameStringRContact Person
IDDocumentNumberStringRNumber of the ID document
Telephone1StringRTelephone1
BuildingString-
FloorString-Floor
RoomStallNumberString-Room Stall Number
ZoneCodeIntRBusiness location Zone Code
WardCodeIntRBusiness location Ward Code
ZoneNameStringRBusiness location Zone Name
WardNameStringRBusiness location Ward Name
PlotNumberStringRBusiness location Plot Number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_ubp->commit_payment([
    "PhoneNumber"         => "...",
    "MerchantID"          => "...",
    "TransactionID"       => "...",
    "Pin"                 => "...",
    "Year"                => "...",
    "AcceptedTnC"         => "...",
    "ContactPersonName"   => "...",
    "IDDocumentNumber"    => "...",
    "Telephone1"          => "...",
    "ZoneCode"            => "...",
    "WardCode"            => "...",
    "ZoneName"            => "...",
    "WardName"            => "...",
    "PlotNumber"          => "..."
]);

B). LAND RATES (jambopay\ncc\LandRates())

Instantiate the class

$ncc_land_rates = new jambopay\ncc\LandRates();
Available methods

a). __.prepare_payment({PlotNumber,PhoneNumber,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
PlotNumberStringRPlot number
PhoneNumberStringRCustomers phone number
PaymentTypeIDIntRMode of payment e.g. 1 for cash, etc

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_land_rates->prepare_payment([
    "PlotNumber"      => "...",
    "PhoneNumber"     => "...",
    "PaymentTypeID"   => "..."
]);

b). __.commit_payment({TransactionID,Amount},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
TransactionIDStringRUnique transaction reference number
AmountdecimalRtransaction amount

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_land_rates->commit_payment([
        "TransactionID"   => "...",
        "Amount"          => "..."
]);

C). PARKING (jambopay\ncc\Parking())

Instantiate the class

$ncc_parking = new jambopay\ncc\Parking();

DAILY PARKING

Available methods

a). __.get_daily_parking_items ( headers )__

This call pulls the required information to determine the amount to be paid.i.e Vehicle types and Zones.

Example:

$ncc_parking->get_daily_parking_items();

b). __.prepare_payment({MerchantID,IsDaily,PlateNumber,PaymentTypeID,PhoneNumber,ZoneCodeID,ChargeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
IsDailyboolRWhether parking is daily or not e.g 1 or 0; true or false
PlateNumberstringRCar registration Number e.g. KDF888W
PaymentTypeIDIntRMode of payment e.g. 1
PhoneNumberstringRCustomer phone number
ZoneCodeIDIntRUnique id describing the parking zone e.g.10
ChargeIDIntRUnique id describing the parking charges e.g.10
DurationIDIntOUnique id describing the parking duration

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_parking->prepare_payment([
    "MerchantID"      => "...",
    "IsDaily"         => "...",
    "PlateNumber"     => "...",
    "PaymentTypeID"   => "...",
    "PhoneNumber"     => "...",
    "ZoneCodeID"      => "...",
    "ChargeID"        => "..."
]);

c). __.commit_payment({TransactionID,Amount},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
TransactionIDStringRTransaction id
PhoneNumberStringRClient Phone Number
PaidByStringRClient Name
AmountDecimalRAmount paid for parking

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_parking->commit_payment([
    "TransactionID"   => "...",
    "Amount"          => "..."
]);

SEASONAL PARKING

Available methods

a). __.get_seasonal_parking_items ( headers )__

This gets initialization data (fees and charges) to determine the amount to be paid. This includes: vehicle type and Parking duration.

Example:

$ncc_parking->get_seasonal_parking_items([
    "authorization"    => JAMBOPAY_TOKEN, 
    "app_key"          => "..."
]);

b). __.prepare_payment({MerchantID,IsDaily, PlateNumber,PaymentTypeID,PhoneNumber,ZoneCodeID,ChargeID,DurationID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
IsDailyBoolRWhether parking is daily or not
PlateNumberStringRCar plate no.
PaymentTypeIDIntRMode of payment
PhoneNumberstringRCustomer phone number
ZoneCodeIDIntRUnique id describing the parking zone
ChargeIDIntRUnique id describing the parking charges
DurationIDIntRUnique id describing the parking duration

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_parking->prepare_payment([
    "MerchantID"      => "...",
    "IsDaily"         => "...",
    "PlateNumber"     => "...",
    "PaymentTypeID"   => "...",
    "PhoneNumber"     => "...",
    "ZoneCodeID"      => "...",
    "ChargeID"        => "...",
    "DurationID"      => "..."
]);

c). __.commit_payment({MerchantID,TransactionID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
MerchantIDStringRMerchant identifier
TransactionIDStringRTransaction id
> The response parameters will contain a valid ReceiptNumber which denotes that
the transaction has been successfully commited and completed.

Example:

$ncc_parking->commit_payment([
    "TransactionID"   => "...",
    "MerchantID"      => "..."
]);

D). SACCO PARKING (jambopay\ncc\SaccoParking())

Instantiate the class

$ncc_sacco_parking = new jambopay\ncc\SaccoParking();
Available methods

a). __.get_sacco_parking_items ( headers )__

This call pulls the required information to determine the amount to be paid. This include Vehicle types and duration types.

Example:

$ncc_sacco_parking->get_sacco_parking_items([
    "authorization" => JAMBOPAY_TOKEN, 
    "app_key"       => "..."
]);

b). __.prepare_payment({SaccoName,Vehicles: [{VehicleType,Duration,RegistrationNumber}],PaymentTypeID},$headers)__

Acceptable Parameters

ParameterRequiredTypeDescription
SaccoNameRStringname of sacco
VehiclesArray fields
VehicleTypeRint
DurationRint
RegistrationNumberRstring
PaymentTypeIDRintMode of payment e.g. 1 - cash

The transactionID from the response is used in the .commit_payment call.

Example:

$params = [       
            "SaccoName"  =>  "..." , 
            "Vehicles" =>  [
                "vehicleType"       => "...",
                "Duration"          => "...",
                "RegistrationNumber" => "..."
            ], 
            "PaymentTypeID"    => "..." 
];

$ncc_sacco_parking->prepare_payment($params);

c). __.commit_payment({},$headers)__

Acceptable Parameters

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

ParameterTypeRequiredDescription
TransactionIDStringR Transaction id

Example:

$params = [       
            "TransactionID"   => "..." 
        ];

$ncc_sacco_parking->commit_payment($params);

D). HOUSE RENT (.house_rent)

Instantiate the class

$ncc_house_rent = new jambopay\ncc\HouseRent();
Available methods

a). __.get_estates ( headers )__

This call gets a list of estates with houses and markets that belong to Nairobi County

Example:

$ncc_house_rent->get_estates();

b). __.get_residences ( { ID }, headers ))__

This call gets the list of residences within an estate using the EstateID

Example:

$ncc_house_rent->get_residences([
    "ID"          => "..."
]);

c). __.prepare_payment({TransactionID,Names,Amount,Adjustment,Currentbalance,CustomerNames,LastBillMonth,MonthlyOtherCharges,MonthlyRent,OtherArrears,PhysicalAddress,RentArrears},$headers)__

Acceptable Parameters

OutputTypeDescription
TransactionIDstringUnique transaction reference number
NamesstringTenant names
AmountdecimalAmount to pay
Adjustmentdecimalany adjustment accrued in payment
CurrentbalancedecimalCurrent balance
CustomerNamesstringCustomer names
LastBillMonthDateTimeLast month bill was paid
MonthlyOtherChargesdecimalOther monthly charges
MonthlyRentdecimalMonthly rent
OtherArrearsdecimalOther arrears
PhysicalAddressdecimalPhysical address
RentArrearsdecimalRent arrears
RentDueDateDateTimeRent due date
UHNstringUnique house number

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_house_rent->prepare_payment([
    "TransactionID"   => "...",
    "Names"           => "...",
    "Amount"          => "...",
    "Adjustment"      => "...",
    "Currentbalance"  => "...",
    "CustomerNames"   => "...",
    "LastBillMonth"   => "...",
    "MonthlyOtherCharges"     => "...",
    "MonthlyRent"     => "...",
    "OtherArrears"    => "...",
    "PhysicalAddress" => "...",
    "RentArrears"     => "...",
]);

d). __.commit_payment({TransactionID,Amount},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number
AmountdecimalRAmount to pay
> The response parameters will contain a valid ReceiptNumber which denotes that
the transaction has been successfully commited and completed.

Example:

$ncc_house_rent->commit_payment([
    "TransactionID"   => "...",
    "Amount"          => "..."
]);

D). E-CONSTRUCTION (jambopay\ncc\EConstruction())

Instantiate the class

$ncc_e_construction = new jambopay\ncc\EConstruction();
Available methods

a). __.prepare_payment({InvoiceNumber,PaymentTypeID,PhoneNumber,PaidBy},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
InvoiceNumberstringRinvoice number
PaymentTypeIDintRMode of payment
PhoneNumberstringRThe client's phone number
PaidBystringRThe name of the client
> The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_e_construction->prepare_payment([
    "InvoiceNumber" => "...",
    "PaymentTypeID" => "..."
]);

b). __.commit_payment({TransactionID,PhoneNumber},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDstringRUnique transaction reference number
PhoneNumberstringRUser phone number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_e_construction->commit_payment([
    "TransactionID"   => "...",
    "PhoneNumber"      => "..."
]);

E). LIQUOR (jambopay\ncc\Liquor())

Available methods

Instantiate the class

$ncc_liquor = new jambopay\ncc\Liquor();

a). __.prepare_payment({ Date,LicenseNumber,PhoneNumber,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
DateDateTimeRdate
LicenseNumberStringRLicense number
PhoneNumberStringRCustomer
PaymentTypeIDint?RMode of payment

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_liquor->prepare_payment([
    "Date"            => "...",
    "LicenseNumber"   => "...",
    "PhoneNumber"     => "...",
    "PaymentTypeID"   => "..."
]);

b). __.commit_payment({TransactionID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_liquor->commit_payment([
    "TransactionID"   => "..."
]);

E). MISCELLANEOUS (jambopay\ncc\Miscellaneous())

Available methods

Instantiate the class

$ncc_misc = new jambopay\ncc\Miscellaneous();

a). __.prepare_payment({PhoneNumber,BillNumber,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
PhoneNumberstringRCustomer phone number
BillNumberstringRUnique Bill reference number gotten from county
PaymentTypeIDintRMode of payment

The transactionID from the response is used in the .commit_payment call.

Example:

$ncc_misc->prepare_payment([
    "PhoneNumber"     => "...",
    "BillNumber"      => "...",
    "PaymentTypeID"   => "..."
]);

b). __.commit_payment({TransactionID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$ncc_misc->commit_payment([
    "TransactionID"   => "..."
]);

2. NAIROBI WATER PAYMENTS (jambopay\NairobiWater())

Instantiate the class

$nairobi_water = new jambopay\NairobiWater();

a). __.get_bill({AccountNumber},$headers)__

This call pulls the applicable charges for Nairobi Water.

Example:

$nairobi_water->get_bill([
    "AccountNumber"   => "..."
]);

b). __.prepare_payment({AccountNumber,PhoneNumber,Names,Amount,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
AccountNumberStringRNairobi Water customer account number
PhoneNumberStringRUser phone number
NamesStringRCustomer account names
AmountdecimalRTransaction amount
PaymentTypeIDint?RMode of payment

The transactionID from the response is used in the .commit_payment call.

Example:

$nairobi_water->prepare_payment([
    "AccountNumber"   => "...",
    "PhoneNumber"     => "...",
    "Names"           => "...",
    "Amount"          => "...",
    "PaymentTypeID"   => "..."
]);

c). __.commit_payment({TransactionID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$nairobi_water->commit_payment([
    "TransactionID"   => "..."
]);

3. NATIONAL HOSPITAL INSURANCE FUND PAYMENTS (jambopay\NHIF())

Instantiate the class

$nhif = new jambopay\NHIF();

a). __.prepare_payment({AccountNumber,IsCorporate,PhoneNumber,Amount,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
AccountNumberStringRCustomer account number at NHIF i.e. member number
IsCorporateBoolRWhether transaction is corporate or individual, use False
PhoneNumberStringRCustomers phone number
PenaltyDecimalOAmount to pay as penalty.
AmountDecimalRTransaction amount.
PaymentTypeIDIntRMode of payment e.g. 1 for cash, etc

The transactionID from the response is used in the .commit_payment call.

Example:

$nhif->prepare_payment([
    "AccountNumber"   => "...",
    "IsCorporate"     => "...",
    "PhoneNumber"     => "...",
    "Amount"          => "...",
    "PaymentTypeID"   => "..."
]);

b). __.commit_payment({TransactionID,PhoneNumber,Amount},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number
PhoneNumberStringRCustomers phone number
AmountdecimalRTransaction amount

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$nhif->commit_payment([
    "TransactionID"   => "...",
    "PhoneNumber"     => "...",
    "Amount"          => "..."
]);

4. KASNEB PAYMENTS (jambopay\Kasneb())

Instantiate the class

$kasneb = new jambopay\Kasneb();

a). __.prepare_payment({PhoneNumber,BillNumber,PaidBy,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterDescription
PhoneNumberThe phone number of the individual making the payment
BillNumberThe bill number or invoice number to which payment is to be made
PaidByThe names of the individual making the payment
PaymentTypeIDThe type of payment being made. For all agents we request this be defaulted to 1 which stands for cash transactions

The transactionID from the response is used in the .commit_payment call.

Example:

$kasneb->prepare_payment([
    "PhoneNumber"     => "...",
    "BillNumber"      => "...",
    "PaidBy"          => "...",
    "PaymentTypeID"   => "..."
]);

b). __.commit_payment({PhoneNumber,TransactionID,ExaminationCenterID,Tendered},$headers)__

Acceptable Parameters

ParameterDescription
PhoneNumberThe phone number of the individual making the payment
TransactionIDThis is the unique identifier for the payment to be processed. This value comes from the previous output from a property with the same name
ExaminationCenterIDNull able parameter. Only applies to payments that have an exam center applied to them.
TenderedThis is an optional parameter denoting the total amount of money given by the client. It is either same to or more than the Amount field and can be used to compute change owed to the client

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$kasneb->commit_payment([
    "TransactionID"       => "...",
    "PhoneNumber"         => "...",
    "Tendered"            => "...",
    "ExaminationCenterID" => "..."
]);

5. JAMBOPAY WALLET PAYMENTS (jambopay\Wallet())

Instantiate the class

$wallet = new jambopay\Wallet();

a). __.prepare_payment({PhoneNumber,Amount,PaymentTypeID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
PhoneNumberstringRUser phone number
AmountdecimalRTransaction amount
PaymentTypeIDIntRMode of payment.e.g. 1 for cash, 2 for cheque, etc

The transactionID from the response is used in the .commit_payment call.

Example:

$wallet->prepare_payment([
    "PhoneNumber"   => "...",
    "Amount"        => "...",
    "PaymentTypeID" => "..."
]);

b). __.commit_payment({TransactionID,PhoneNumber},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number
PhoneNumberStringRUser phone number

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$wallet->commit_payment([
    "TransactionID"   => "...",
    "PhoneNumber"     => "..."
]);

6. __JAMBOPAY PAYMENT REPORTS (jambopay\Reports(reporting_stream [ e.g. parking, saccoparking, rent,nhif,ubp]))__

>>> INITIALIZE THE QUERY OBJECT

e.g

For Parking

$parking_report = new jambopay\Reports("parking");

a). __.get_transactions({},$headers)__

Acceptable parameters

ParameterTypeRequiredDescription
PlateNumberstringOId of the business
IndexintOZero based index of the pages of the transactions to return- each page has 30 transactions
TransactionIDstringOUnique transaction reference number
StartDateDateOLeast date to fetch transactions from
EndDateDateOLatest date to fetch transactions
UserIDstringOUnique user id
TransactionStatusbyteOState of the transaction (prepared-0 or completed-1)

Sample Usage ( for ncc parking )

$parking_report->get_transactions( );

7. KENYA POWER & LIGHTING Co. PAYMENTS (jambopay\KPLC())

Instantiate the class

$kplc = new jambopay\KPLC();

a). __.prepare_payment({PhoneNumber,Amount,PaymentTypeID,MeterNumber,MerchantID},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
PhoneNumberstringRUser phone number
AmountdecimalRTransaction amount
PaymentTypeIDIntRMode of payment.e.g. 1 for cash, 2 for cheque, etc
MeterNumberIntRThe client's meter number
MerchantIDIntR'KPLC' in this case

The transactionID from the response is used in the .commit_payment call.

Example:

$kplc->prepare_payment([
    "PhoneNumber"   => "...",
    "Amount"        => "...",
    "PaymentTypeID" => "...",
    "MeterNumber"   => "...",
    "MerchantID"    => "KPLC"
]);

b). __.commit_payment({TransactionID,PhoneNumber,Tendered,Pin},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number
PhoneNumberStringRUser phone number
TenderedIntRThe amount that has been given by the client
PinStringRThe initiator's access password/PIN

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$kplc->commit_payment([
    "TransactionID"   => "...",
    "PhoneNumber"     => "...",
    "Tendered"        => "...",
    "Pin"             => "..."
]);

8. OFFSTREET PARKING PAYMENTS ( jambopay\OffStreetParking(bool liveServer = false))

This endpoint requires initialization before it's use. The main purpose for this is to specify whether or not to use the live endpoint.

To initialize the endpoint use

$offstreet_parking = new jambopay\OffStreetParking(`use_live_server`);

Either

$offstreet_parking = new jambopay\OffStreetParking(true);

or

$offstreet_parking = new jambopay\OffStreetParking(false);

a). __.validate_attendant({PhoneNumber},$headers)__

This method helps to check the validity of an attendant by their telephone number

Example:

$offstreet_parking->validate_attendant([
    PhoneNumber => "..."
]);

b). __.book_vehicle({PlateNumber,attPhoneNumber},$headers)__

This method helps to book in a vehicle to the system by the plate number

Example:

$offstreet_parking->book_vehicle([
    "PlateNumber"     => "...",
    "attPhoneNumber"  => "..."
]);

9. STARTIMES PAYMENTS (jambopay\Startimes())

Instantiate the class

**$startimes = new jambopay\Startimes();**

a). __.prepare_payment({PhoneNumber,Amount,PaymentTypeID,SmartCardCode,CustomerCode},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
PhoneNumberstringRUser phone number
AmountdecimalRTransaction amount
PaymentTypeIDIntRMode of payment.e.g. 1 for cash, 2 for cheque, etc
SmartCardCodeIntRThe client's smartcard number
CustomerCodeIntRThe designated customer code

The transactionID from the response is used in the .commit_payment call.

Example:

$startimes->prepare_payment([
    "PhoneNumber"   => "...",
    "Amount"        => "...",
    "PaymentTypeID" => "...",
    "SmartcardCode" => "...",
    "CustomerCode"  => "..."
]);

b). __.commit_payment({TransactionID,PhoneNumber,Tendered},$headers)__

Acceptable Parameters

ParameterTypeRequiredDescription
TransactionIDStringRUnique transaction reference number
PhoneNumberStringRUser phone number
TenderedIntRThe amount that has been given by the client

The response parameters will contain a valid ReceiptNumber which denotes that the transaction has been successfully commited and completed.

Example:

$startimes->commit_payment([
    "TransactionID"   => "...",
    "PhoneNumber"     => "...",
    "Tendered"        => "..."
]);

GLOBAL METHODS

Instantiate the class

$global = new jambopay\JambopayGeneric('stream');

__$global->prepare_payment({},$headers)__

__$global->commit_payment({},$headers)__

The above methods can be invoked directly for any payment channel (apart from offstreetparking) as long as the relevant payment stream is passed.

Below is a table of the relevant payment streams

TargetStream
E-Constructioneconstruction
House Rentrent
Jambopay Walletwallet
KASNEBkasneb
Kisumu Water & Seweragekiwasco
Kenya Power & Lightingkplc
Land Rateslandrate
Liquorliquor
Miscellaneousmisc
Nairobi Waternairobiwater
NHIFnhif
NCC - OffStreet Parkingoffstreetparking
Parkingparking
Sacco Parkingsaccoparking
Unified Business Permitsbp

Below is a table of applicable MerchantID's

TargetMerchantID
Nairobi CountyNCC
Trans Nzoia CountyTNC
An example sacco_parking prepare_payment request
$params = [   
        "Stream"      =>"saccoparking"
        "SaccoName"   => "" , 
        "Vehicles"    => [ 
                "vehicleType"        => "",
                "Duration"           => "",
                "RegistrationNumber" => ""
            ] 
        ], 
        "PaymentTypeID" => ""            
    ];
$JamboPay_saccoparking = new jambopay\JambopayGeneric('saccoparking');    
$JamboPayWildCard->prepare_payment($params);

OR

$JamboPayWildCard_any = new jambopay\JambopayGeneric();
$JamboPayWildCard_any->prepare_payment($params);

When using the latter, ensure that you have a "Stream" defined in the parameters object that you pass into the method rather than passing it to the constructor.