Контакти | Въпроси и отговори | Общи условия | Конфиденциалност
Директна връзка с оператор
Контакти

SMS code service

The SMS code service will generate and send to the end user an 6-chars SMS code when the user sends an SMS for your service. You can specify the generated SMS codes validity in the Mobio's controll panel.

After the user enters his SMS code in your site your software should make a HTTP request to Mobio's server to check if the entered code is valid.

The HTTP request should contain the following parameters:

  • servID: your service's unique ID (for example 123);
  • code: the code, entered by the user in your site (for example: А34B22);

As a reply to this request you should receive one of the following:

  • PAYBG=FAILED:Invalid request when you have set wrong value for the servID parameter;
  • PAYBG=FAILED:Invalid code when the user has entered an invalid or expired SMS code;
  • PAYBG=FAILED:Invalid IP when you are trying to check the SMS code from an unauthorized IP address;
  • PAYBG=OK when the entered code is valid;

Example script for checking the SMS codes:

<?PHP

     function mobio_checkcode($servID, $code, $debug=0) {
          $res_lines = file("http://www.mobio.bg/code/checkcode.php?servID=$servID&code=$code");
          $ret = 0;
          if($res_lines) {
               if(strstr("PAYBG=OK", $res_lines[0])) {
                    $ret = 1;
               }else{
                    if($debug)
                         echo $line."\n";
               }
          }else{
                    if($debug)
                         echo "Unable to connect to mobio.bg server.\n";
                    $ret = 0;
          }
          return $ret;
     }

     $servID = 16;
     $code = $_REQUEST["code"];

     if(mobio_checkcode($servID, $code, 0) == 1) {
          echo "Valid code";
     }else{
          echo "Invalid code";
     }

?<

Други помощни текстове в тази категория:

  1. Paynotify service (HTTP GET/POST requests communictaion)
  2. SMS code service
  3. Mobipay SMS payment