In our application in Lesson 16, we wrote PHP code to implement a sample University Result application. But I have not shown you how to test our application on the browser.
It is advisable to know how to test your application on the browser for a number of reasons; One, it can save you time a lot of time having to push your changes to server now and then. Two, for those learning about USSD applications, and having no intentions to go live, it is economical, because you will have to pay for the test bed. Three, test bed period may be short, which may not be enough for testing during development and for real system testing for real users.
Now, make sure your local server is running. We want to emulate a USSD gateway. Assuming that http://localhost/ussdapp/ucuresults.php is the callback URL provided to the USSD gateway, we expect that it will append some more data as query parameters. So, we assume we are the gateway and add these parameters for ourselves. We will have something like this.
http://localhost/ussdapp/ucuresults.php?serviceCode=*123%23&sessionId=1234DD34&MSISDN=0726172579&text=
So, paste this URL to your browser, and observe. %23 is URL encoding for #.
I guess you see this;
Welcome to UCURESULTS. Please reply with;
1. Register
2. Login
Now select 1as this
http://localhost/ussdapp/ucuresults.php?serviceCode=*123%23&sessionId=1234DD34&MSISDN=0726172579&text=1 and run it
I guess you see this;
Enter your registration number (Username)
Now enter the Username, say xxxx as this
http://localhost/ussdapp/ucuresults.php?serviceCode=*123%23&sessionId=1234DD34&MSISDN=0726172579&text=1*xxxx then run it then observe
I guess you see this;
Enter your first name
Continue responding to the USSD menus by separating your responses by * each time.
Repeat the process by replying by 2 to this menu
Welcome to UCURESULTS. Please reply with;
1. Register
2. Login
If your menus work well here, then they are likely to respond well when you push your code to a production server.
Note that the names of USSD parameters vary from one provider to another. So, check your provider's documentation well before you integrate you application.
Do not shy away to leave a comment.
Labels: testing USSD application on browser, tracking USSD menu levels, USSD implementation