Downloads
Stars
Version
BotMan driver to connect the Mobiverse USSD API with BotMan
Install Botman for Laravel before installing this driver. See the Botman documentation.
Require the gashey/botman-ussd-driver
package in your composer.json
and update your dependencies:
$ composer require gashey/botman-ussd-driver
Add the Gashey\BotmanUssdDriver\UssdServiceProvider to your providers
array:
Gashey\BotmanUssdDriver\UssdServiceProvider::class,
Add the following listener to your botman routes file:
$botman->hears(config('ussd.cancel_text', 'CANCEL'), function ($bot) {
$bot->reply('stopped');
})->stopsConversation();
You can use the Mobiverse USSD Simulator to test your application. Supply your application url as: http://your-application.com/botman
The defaults are set in config/botman/ussd.php
. Publish the config using this command:
$ php artisan vendor:publish --provider="Gashey\BotmanUssdDriver\UssdServiceProvider"
return [
"cancel_text" => "CANCEL",
"network_mapping" => array('01' => 'MTN', '02' => 'VODAFONE', '03' => 'AIRTEL-TIGO', '04' => 'AIRTEL-TIGO', '05' => 'GLO'),
];
Released under the MIT License, see LICENSE.