Добрый день, я хотел бы создать меню для моего приложения ussd, это мое первое приложение, так что я все еще немного сбит с толку.
Единственное, что я смог сделать, это вывести на экран сообщение с надписью «Добро пожаловать, дорогой клиент», но я хочу создать интерактивное меню.
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
header("Content-type: text/xml; charset=utf-8");
/**
* Here we receive the xml from the network company
*
*/
$json = file_get_contents('php://input');
$json_data = json_decode($json);
error_log($json_data->param1);
$xml = simplexml_load_string($json_data->param1) or die('Error:
Cannot create the object');
$MessageType = $xml->MessageType;
$ConversationID = $xml->ConversationID;
$SessionID = $xml->SessionID;
$TransactionID = $xml->TransactionID;
$MessageString = $xml->MessageString;
$MSISDN = $xml->MSISDN;
$Success = $xml->Success;
$IsFinal = $xml->IsFinal;
$DateTimeReceived = $xml->DateTimeReceived;
$MNO = $xml->MNO;
/**
*Here we create a xml that will send a message to the user
*
*
*/
$option1 ='1.Welcome dear customer';
$xml = new SimpleXMLElement('<UssdMessage/>');
$xml->addChild('MessageType', $MessageType);
$xml->addChild('ConversationID', $ConversationID);
$xml->addChild('SessionID', $SessionID);
$xml->addChild('TransactionID', $TransactionID);
$xml->addChild('MessageString', $option1);
$xml->addChild('MSISDN', $MSISDN);
$xml->addChild('Success', 'true');
$xml->addChild('IsFinal', 'TRUE');
$xml->addChild('DateTimeReceived', $DateTimeReceived);
$xml->addChild('MNO', $MNO);
echo $xml->asXML();