[Guide] How to setup Fortumo Mobile Payment

Angerfist

Active Member
Joined
Apr 7, 2009
Messages
190
Reaction score
40
Hello,
I was using Paygol and I see that a lot of people uses it. It is a ripp off since they take a lot of what you gain!
I started looking around and I found Fortumo! Not really sure, but I think its better!
So I started making a Script for it! And here we go​

1. Create an Account. (Since we are partners with Fortumo, you will get 5 € start-up fund using this link)

2. Start a new in
3. Select the countries you want to offer your services in and follow the service creation wizard
4. Name your service and provide us with URL’s of the scripts where payment information is forwarded and billing reports are sent to (billing report processor, see technical info below)

Consumable items are good for different in game goods and items that can be bought multiple times - gold, game items, content.
Example: Do you want to buy 1 bottle of magic potion?
Non-consumable items are things that can be bought only once. In games a non-consumable item could be an extension pack, a new level, extras or unlocks.
Example: You're about to buy a full ad-free version of this app.
5. Insert required information about you and your service
Calculation is based on your payout. In this case the bigger is your revenue share for a specific country and price point, the better will be the exchange rate (customer will receive more credits for one 2 EUR payment with 60% revenue share than for 2 x 1 EUR payments with a revenue share of 40%).
Calculation is based on end-user price. In this case exchange rate will be equal in all countries and price points (customer will receive an equal amount of credits for one 2 EUR or 2 x 1 EUR payments).
6. For countries that require operator’s approval, provide a link to marketing materials or skip this step

Please note, that you can create as many services as you want and they can be updated later.


Put this in ur root dir. and call it sms.php

PHP:
<?php
//ALL CREDITS TO AMIROSLO,ANGERFIST @ HTTP://HELLRISING.EU
//DONT REMOVE CREDIT PLEASE AND SHOW SOME RESPECT!
//EDITED PAYGOL SCRIPT TO WORK WITH FORTUMO


//Probably you have to change this depending on your database connection and files
include("config.php");

//Connect to DB
$connection = mysql_connect($host, $username, $password);
$db= mysql_select_db($dbname);

 // 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");
  }
  
a

// read the get from  system
  $sender = $_GET['sender'];//phone num.
  $amount = $_GET['amount'];//credit
  $payment_id = $_GET['payment_id'];//unique id
  $username = $_GET[custom];
  $country = $_GET[country];
  $currency = $_GET[currency];
  $operator = $_GET[operator];
  $price = $_GET[price];




//UPDATE to be VIP
$sql = "UPDATE users SET vip = '1' WHERE username = '$username'";
mysql_query($sql);

$days = 30;//Insert subscription for 30 days
$vip_ini = time();
$vip_end = time() + ($days*24*3600);

//Get id of user
$sql   = "SELECT id FROM users WHERE username='$username'";
$result= mysql_query($sql);
$row = mysql_fetch_assoc($result); 

//user id
$userid = $row[id];

//check first if user exist
$sql   = "SELECT user_id, timestamp_expire FROM user_subscriptions WHERE user_id=$userid AND subscription_id='habbo_vip' ORDER BY timestamp_expire DESC LIMIT 1";
$result = mysql_query($sql);
$total_records = mysql_num_rows($result);

if ($total_records>0){
  $row = mysql_fetch_assoc($result);
  $current_exp = $row['timestamp_expire'];
  
  //if user still have some days with subscription then add the time to his account
  if($current_exp > time()){
    $vip_end = $vip_end + ($current_exp - time());  
  }

  //delete all recrods in subscriptions table for this user
  $sql   = "DELETE FROM user_subscriptions WHERE user_id=$userid AND subscription_id='habbo_vip'";
  mysql_query($sql);
}
  
//Insert a new subscription with the corresponding time
$sql   = "INSERT INTO user_subscriptions(user_id, subscription_id, timestamp_activated, timestamp_expire) VALUES ($userid, 'habbo_vip', $vip_ini, $vip_end)";
mysql_query($sql);


?>

PHP:
<?php   
    //Get userID from username 
    $query_userid = mysql_query("SELECT id FROM users WHERE username='" . $_SESSION['username'] . "' LIMIT 1"); 
    $result_userid = mysql_fetch_assoc($query_userid);  

    //Get timestamp for account to expire(pre-set userID) 
    $query_expire= mysql_query("SELECT timestamp_expire FROM user_subscriptions WHERE user_id=" . $result_userid['id'] . " AND subscription_id='habbo_vip' ORDER BY timestamp_expire DESC LIMIT 1"); 
    $result_expire = mysql_fetch_assoc($query_expire);  
   
    //See how many days are left on subscription 
    $daysLeft = 0; 
    if ($result_expire['timestamp_expire'] > time()){ 
        $daysLeft = $result_expire['timestamp_expire'] - time(); 
        $daysLeft = round($daysLeft/86400); 
    }  

    //If no time is left on subscription set it to invalid 
    if($expiretime < time()){ 
        mysql_query("UPDATE users SET vip='0' WHERE id = " . $result_userid['id'] . " LIMIT 1"); 
        //Remove all old subscription's from userID 
        mysql_query("DELETE FROM user_subscriptions WHERE user_id=" . $result_userid['id'] . " AND subscription_id='habbo_vip'"); 
    } 

?>

Credits to Amiroslo & Angerfist
Paygol for base script and Thugie for (me.php) script improvement
 

franlley

New Member
Joined
Aug 13, 2012
Messages
8
Reaction score
0
Fortumo have bad support :(
Been waiting for few weeks, There's still no country approval.
but still, nice guide ! 10/10