Skip to content

Instantly share code, notes, and snippets.

View levizwannah's full-sized avatar
💭
Coding

Levi Kamara Zwannah levizwannah

💭
Coding
View GitHub Profile
<?php
// initialize Mpesa
// ...autoloading
$mpesa = Mpesa::new()->configure([
"key" => "consumer key",
"secret" => "consumer secret",
"code" => "business short code",
"till" => "business till if necessary",
<?php
// initialize Mpesa
// ...autoloading
$mpesa = Mpesa::new()->configure([
"key" => "consumer key",
"secret" => "consumer secret",
"code" => "business short code",
"till" => "business till if necessary",
"initiator" => "initiator name",
@levizwannah
levizwannah / ojs-config.js
Created July 10, 2023 01:14
Configure OpenScript
/*----------------------------------
| Do OpenScript Configurations Here
|----------------------------------
*/
/**----------------------------------
* Set the default route path here
* Every route will be prefixed by
* this path.
* ----------------------------------
@levizwannah
levizwannah / stkpush-till-paybill-configure-chaining-properties.php
Last active January 30, 2023 10:26
STK push using configure and method chaining
<?php
require(__DIR__ . "/vendor/autoload.php");
use LeviZwannah\MpesaSdk\Mpesa;
$config = [
"key" => "consumer Key",
"secret" => "consumer secret",
"code" => "business short code",
"passkey" => "passkey for stk push"
@levizwannah
levizwannah / stkpush-paybill-properties.php
Last active May 8, 2023 17:33
STK push for paybill number using properties as setters
<?php
require(__DIR__ . "/vendor/autoload.php");
// or read getting started if the vendor is not available
use LeviZwannah\MpesaSdk\Mpesa;
$config = [
"key" => "consumer Key",
"secret" => "consumer secret",
@levizwannah
levizwannah / stkpush-till-properties.php
Last active January 30, 2023 10:25
STK push for Till number using properties
<?php
require(__DIR__ . "/vendor/autoload.php");
// or read getting started if the vendor is not available
use LeviZwannah\MpesaSdk\Mpesa;
$config = [
"key" => "consumer Key",
"secret" => "consumer secret",
@levizwannah
levizwannah / configure-mpesa.php
Last active August 23, 2022 02:00
Using the configure method Mpesa SDK PHP
<?php
require_once(__DIR__ . "/vendor/autoload.php");
use LeviZwannah\MpesaSdk\Mpesa;
$config = [
"key" => "Consumer Key", // consumer key
"secret" => "Consumer Secret", // consumer secret
"code" => "123456", // business short code
"env" => "live" //set environment to live or sandbox
];
@levizwannah
levizwannah / get-mpesa-subclasses.php
Last active August 18, 2022 17:07
Using the Mpesa Class to get the subclasses in Mpesa PHP SDK.
<?php
require(__DIR__ . "/vendor/autoload.php");
use LeviZwannah\MpesaSdk\Mpesa;
//default configs
$config = [
"key" => "Consumer Key",
"secret" => "Consumer Secret",
"code" => " business short code"
];
@levizwannah
levizwannah / mpesa-use.php
Last active August 18, 2022 09:37
mpesa-sdk-php-set-up
<?php
require(__DIR__ . "/vendor/autoload.php");
use LeviZwannah\MpesaSdk\Mpesa;
$config = [
"key" => "Consumer Key",
"secret" => "Consumer Secret",
"code" => "Business short code",
];