开发者

Premium SMS billing solution [closed]

Closed. This question is off-topic. It is not currently accepting answers.
开发者_开发百科

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

Are their any good solutions for sending mobile content to users for a monthly fee? I'd like to have it so they enter a number in the web-based opt-in page and then they have to confirm a pin to confirm their subscription. I can't find any arregator that allows for monthly billing for US carriers. Any ideas?

My application is in PHP an API would be necessary and I'd like to have the payments go on their mobile phone bill (not manage myself)


If you're wanting to use an aggregator and bill to the customer's cell phone bill, you can use mBlox. If you want to bill clients yourself and just send content to them, check out Twilio (to send the texts/calls) and Braintree (to handle payments).

Whatever option you choose, you would still need to build your application to interface with these providers.


Use fortumo http://fortumo.com/

Here's sample from their 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);
  }
?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜