Skip to content

Instantly share code, notes, and snippets.

@levizwannah
Last active August 18, 2022 17:07
Show Gist options
  • Save levizwannah/18b15032d8fc676d5cd802d50cd94383 to your computer and use it in GitHub Desktop.
Save levizwannah/18b15032d8fc676d5cd802d50cd94383 to your computer and use it in GitHub Desktop.
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"
];
$mpesa = Mpesa::new()->configure($config);
$stk = $mpesa->stk();
$reversal = $mpesa->reversal();
$b2c = $mpesa->b2c();
// ...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment