public static function getResponse() { include_once 'mmarket.php'; $input = trim($_REQUEST['INPUT']) ? $_REQUEST['INPUT'] : '676'; $msisdn = isset($_REQUEST['msisdn']) ? trim($_REQUEST['msisdn']) : '2348132614337'; $code = $_REQUEST['code'] ? $_REQUEST['code'] : '676'; //always the same $sessionid = isset($_REQUEST['sessionid']) ? $_REQUEST['sessionid'] : "52277817"; // find out what ussd code is running and map it to the right app /* * 776 is mhealth, 676 is mmarket */ switch ($code) { case '776': include_once 'mhealth.php'; try { $content = Mhealth::getContent($input, $sessionid, $msisdn); } catch (Exception $e) { $content = "Mhealth App"; } break; case '676': try { $content = self::putText($input); } catch (Exception $e) { $content = "MMarket App"; } break; default: break; } #$logFile = "/var/www/html/flares/flares.log"; $txt = App::requestToArray(); #echo $txt; App::logRequestToFile($txt); return $content; #return $txt; }
<?php include_once 'bootstrap.php'; if (isset($_REQUEST['clean']) && $_REQUEST['clean'] == 'clean-session') { App::logRequesToFile(App::requestToArray()); App::setCleanUpHeaders(); } else { $headers = array("Freeflow" => "FC", "Charge" => "Y", "Amount" => "10"); App::setNormalHeaders($headers); $content = App::getResponse(); App::setContent($content); } ?>