Download the PHP package njoguamos/laravel-jenga without Composer
On this page you can find all versions of the php package njoguamos/laravel-jenga. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download njoguamos/laravel-jenga
More information about njoguamos/laravel-jenga
Files in njoguamos/laravel-jenga
Package laravel-jenga
Short Description A Laravel package for setting up and interacting with Jenga V3 API.
License MIT
Homepage https://github.com/njoguamos/laravel-jenga
Informations about the package laravel-jenga
Jenga API wrapper for Laravel 9+
1. Why use this package
- To provide a way of generating jenga api
access_token
after a give period e.g every 15 minutes - To provide a fluent way of generating jenga api key pair of
private key
andpublic key
- To automate generation of jenga api
Bearer Token
- Offer a seamless gateway to interacting with Jenga API
Info Ready to get started? I have prepared a playground which you can clone and get started. It will help you test your crendentials while showinf you how to integrate this package with your laravel application.
2. Documentation
2.1 Installation
Use the Composer package manager to install this package into your Laravel project
2.2 Update your .env
variables
This package assumes that you have a JengaHQ account, and that you have Api Key
, Merchant Code
and Consumer Secret
(from Jenga)(https://developer.jengaapi.io/docs/developer-quickstart).
Copy the respective keys and place them in the .env
as show in the example below.
Note For
JENGA_LIVE_MODE
usefalse
when testing andtrue
when running live transactions
2.3 Initialising the Package
You must run install command that will publish the jenga.php
config file and create_jenga_tokens
migration
Note For security reasons,
access_token
andrefresh_token
will be encrypted using youapplication key
. You can learn more about encryption from Laravel documentation
You can go ahead and migrate the database.
2.4 Generating Bearer Token
Once you have valid credentials, run the following command.
This command will get an access_token
token from Jenga API and add them into a new record on jenga
table.
This command may fail:
- When you are not connected to the internet
- When
Api Key
orConsumer Secret
orMerchant
is/are invalid - There is a problem with jenga api endpoint
2.5 Generate Bearer Token
Frequently
The generated access_token
expires after a particular period usually after one hour
. To generate a new access_token
automatically, schedule the jenga:auth
command in the console kernel. The schedule time should be less than 15 minutes.
2.6 Clearing Expired Token
To periodically deleted expired Bearer Token
, schedule model:prune
command in the console kernel.
2.7 Generate Private and Public Keys
To generate a key pair of private and public key, run the following command.
This command will create a jenga.key
and jenga.pub.key
file in your laravel application storage folder. You can customise the directory using JENGA_KEYS_PATH
variable.
You may use --force
flag to replace existing keys. The default key size is 4096
Warning The generated keys files SHOULD NEVER be kept in source control. Make sure you add them to you gitignore file.
Note Extensions like
bcmath
,gmp
,libsodium
andopenssl
are required when generating they keys.
2.8 Ensure that you are subscribed to the API services
If you attempt to access the API and you get Not Authorized to access the API
, confirm that your account has subscribed to the respective service you are trying to access. You can do so by going to the JengaAPI Settings -> Subscriptions, then subscribe
or unsubscribe
.
3. Usage
3.1 Generating signature
To generate a signature manually, call `getSignature` method in `JengaSignature` class using the data you want to sign.
>**Info** > The data is signed in the order it is passed.3.2 Payment Gateway Checkout
To use the payment gateway, prepare the data using the backend and pass to the browser form.
Configure your frontend form. A successful response should look like like this. A customer should also receive an sms like this.3.3 Account services
- [ ] Account Balance
- [ ] Account MINI Statement
- [ ] Account Full Statement
- [ ] Opening and Closing Account Balance
3.3.5 Account Inquiry - Bank Accounts
To get account details, call the `AccountInquiry` and pass the account number and country code. If no parameters passed, the default account and country configured in [config](./config/jenga.php) will be used The response should look like this3.4 Send money
- [ ] Within Equity Bank
- [ ] To Mobile Wallets
- [ ] Real Time Gross Settlement (RTGS)
- [ ] Society for Worldwide Interbank Financial Telecommunication (SWIFT)
- [ ] Pesalink - To Bank Account
- [ ] Pesalink - To Mobile Number
3.5 Send money - IMT
- [ ] IMT Within Equity Bank
- [ ] IMT to Mobile Wallets
- [ ] IMT Pesalink - To Bank Account
- [ ] IMT Pesalink - To Bank Mobile
3.6 Receive money
- [ ] Receive Payments - Bill Payments
- [ ] Receive Payments - Merchant Payments
- [ ] Bill Validation
3.6 Receive money queries
- [ ] Get All EazzyPay Merchants
- [ ] Query Transaction Details
- [ ] Get All Billers
3.8 Airtime
- [ ] Purchase Airtime
3.9 Forex rates
Get the Equity Bank daily currency conversion rate for major currencies.
Example success response Refer to [Forex API Reference](https://developer.jengaapi.io/reference/get-forex-rates) Supported currencies | Code | Name | |------|------------------------| | KES | Kenyan Shilling | | YNG | Korean Yang | | SSP | South Sudanese Pound | | RWF | Rwandan Franc | | JPY | Japanese Yen | | USD | US Dollar | | GBP | British Pound Sterling | | EURO | European Union (EU) | | ZAR | South African Rand | | RUP | Russian Ruble |3.10 ID Search & Verification
Query the various registrar of persons in the various countries in East Africa.
Example success response Refer to [ID Search & Verification API Reference](https://developer.jengaapi.io/reference/identity-verification)3.11 MPGS direct integration
- [ ] MPGS Validate Payment
- [ ] MPGS Authenticate Payment
- [ ] MPGS Authorize Payment
- [ ] MPGS Query Payment
- [ ] MPGS Refund Payment
4. Testing
5. Changelog
Please see RELEASES for more information what has changed recently.
6. Contributing
Please see CONTRIBUTING for details.
7. Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
8. Credits
- Njogu Amos
- All Contributors
9. License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-jenga with dependencies
guzzlehttp/guzzle Version ^7.5
illuminate/contracts Version ^9.0 | ^10.0 | ^11.0
spatie/crypto Version ^2.0
spatie/laravel-package-tools Version ^1.13.0