Skip to content

njoguamos/laravel-jenga-playground

Repository files navigation

cover

Documentation

This repository offers a great starting point for testing your Jenga API. This repo implements Jenga API wrapper for Laravel by @njoguamos.

Prerequisite

Before cloning this repository, ensure you have the following from JengaHQ

  1. You have created an account with JengaHQ. Register account here
  2. You have a merchantCode, consumerSecret and Api-Key. Learn how to generate these credentials
  3. You have subscribed to JengaAPI subscriptions. Without subscription, requests may fail.
  4. You have added a bank account in your JengaHQ dashboard. This account can be real bank account or demo bank account.

Installation

Clone the repo

git clone git@github.com:njoguamos/laravel-jenga-playground.git

Create .env file

cp .env.example .env  

Generate application key

php artisan key:generate

Update you .env variables

# Database connection
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_jenga_playground
DB_USERNAME=root
DB_PASSWORD=

# Jenga Credenatials
JENGA_LIVE_MODE=false
JENGA_MERCHANT_CODE=
JENGA_API_KEY=
JENGA_CONSUMER_SECRET=

# Optional
JENGA_DEFAULT_ACC=
JENGA_DEFAULT_WALLET=
JENGA_COUNTRY_CODE=

Migrate database

php artisan migrate

Generate njoguamos/laravel-jenga ssl keys

php artisan jenga:keys

Copy public key to your JengaHq dashboard

 pbcopy < ./storage/jenga.pub.key

Automatically generate bearer token

Open your application in a new shell and run the following command. This command will generate Bearer token every five minutes.

php artisan schedule:work 

Server the application

vite build && php artisan serve

Open the application http://127.0.0.1:8000 in a browser