Skip to content

Instantly share code, notes, and snippets.

@levizwannah
Last active July 31, 2023 14:03
Show Gist options
  • Save levizwannah/7443c6f12dd744cd9e69d706caa4b12d to your computer and use it in GitHub Desktop.
Save levizwannah/7443c6f12dd744cd9e69d706caa4b12d to your computer and use it in GitHub Desktop.
<?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",
"credential" => "security credential"
]);
$reversal = $mpesa->reversal();
// or
$mpesa = Mpesa::new()->configure([
"key" => "consumer key",
"secret" => "consumer secret",
"code" => "business short code",
"till" => "till number if necessary"
]);
$reversal = $mpesa->reversal();
$reversal->initiator("initiator name")
->credential("security credential");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment