【问题标题】:Premium SMS billing solution [closed]高级 SMS 计费解决方案 [关闭]
【发布时间】:2011-01-19 04:19:58
【问题描述】:

他们有什么好的解决方案可以按月向用户发送移动内容吗?我想要它,以便他们在基于网络的选择加入页面中输入一个数字,然后他们必须确认一个 pin 以确认他们的订阅。我找不到任何允许为美国运营商按月计费的 arregator。有什么想法吗?

我的应用程序是 PHP 的,API 是必要的,我希望通过他们的手机账单付款(而不是自己管理)

【问题讨论】:

    标签: php sms billing


    【解决方案1】:

    如果您想使用聚合器并记入客户的手机账单,您可以使用mBlox。如果您想自己向客户收费并仅向他们发送内容,请查看Twilio(发送短信/电话)和Braintree(处理付款)。

    无论您选择什么选项,您仍然需要构建您的应用程序以与这些提供程序交互。

    【讨论】:

      【解决方案2】:

      使用fortumohttp://fortumo.com/

      这是他们的 api 示例:

      <?php
      
        //set true if you want to use script for billing reports
        //first you need to enable them in your account
        $billing_reports_enabled = false;
      
        // check that the request comes from Fortumo server
        if(!in_array($_SERVER['REMOTE_ADDR'],array('81.20.151.38', '81.20.148.122', '79.125.125.1', '209.20.83.207'))) {
          header("HTTP/1.0 403 Forbidden");
          die("Error: Unknown IP");
        }
      
        // check the signature
        $secret = ''; // insert your secret between ''
        if(empty($secret) || !check_signature($_GET, $secret)) {
          header("HTTP/1.0 404 Not Found");
          die("Error: Invalid signature");
        }
      
        $sender = $_GET['sender'];
        $message = $_GET['message'];
        $message_id = $_GET['message_id'];//unique id
        //hint:use message_id to log your messages
        //additional parameters: country, price, currency, operator, keyword, shortcode 
        // do something with $sender and $message
        $reply = "Thank you $sender for sending $message";
      
        // print out the reply
        echo($reply);
      
       //customize this according to your needs
        if($billing_reports_enabled 
          && preg_match("/Failed/i", $_GET['status']) 
          && preg_match("/MT/i", $_GET['billing_type'])) {
         // find message by $_GET['message_id'] and suspend it
        }
      
      
        function check_signature($params_array, $secret) {
          ksort($params_array);
      
          $str = '';
          foreach ($params_array as $k=>$v) {
            if($k != 'sig') {
              $str .= "$k=$v";
            }
          }
          $str .= $secret;
          $signature = md5($str);
      
          return ($params_array['sig'] == $signature);
        }
      ?>
      

      【讨论】:

        猜你喜欢
        • 2012-03-11
        • 2017-07-16
        • 1970-01-01
        • 1970-01-01
        • 2010-09-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多