[Setup]Fortumo Mobile Payment [Automatic]
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
NOT TESTED!
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 App Payments Service
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)
http://developers.fortumo.com/attachments/step1.png
http://developers.fortumo.com/attachments/step2.png
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
http://developers.fortumo.com/attachments/step3.png
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
http://i.imgur.com/qPJ9h.png
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 Code:
<?php
//ALL CREDITS TO AMIROSLO @ HTTP://HABBOZONE.ORG
//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 Code:
<?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 me Amiroslo &
Paygol for base script and Thugie for (me.php) script improvement
Re: [Setup]Fortumo Mobile Payment [Automatic]
Interesting.
I didn't tested it yet, but it looks very helpful!
Re: [Setup]Fortumo Mobile Payment [Automatic]
Re: [Setup]Fortumo Mobile Payment [Automatic]
Re: [Setup]Fortumo Mobile Payment [Automatic]
Common people! Almost 200views and still nothing?
Re: [Setup]Fortumo Mobile Payment [Automatic]
You said it sends an url back with info, is the username from the url as well?
If it's then there are exploits in your system.
Re: [Setup]Fortumo Mobile Payment [Automatic]
dont get it. what info from which url?
Re: [Setup]Fortumo Mobile Payment [Automatic]
Quote:
Originally Posted by
Amiroslo
Common people! Almost 200views and still nothing?
You don't need to 'bump' a tutorial, that's just begging for posts.
But this tutorial is OK I guess and should help some people.
Re: [Setup]Fortumo Mobile Payment [Automatic]
Re: [Setup]Fortumo Mobile Payment [Automatic]
Was bored checked out the me.php rewrote it had a mistake it used $username instead username from SESSION.. doubt it works.
And cleaned it up a bit added LIMIT 1 in placed it should be. stuff like that.
PHP Code:
<?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'");
}
?>
Re: [Setup]Fortumo Mobile Payment [Automatic]
Thanks, updated first post
Re: [Setup]Fortumo Mobile Payment [Automatic]
Please use [php] tags instead [code]
Re: [Setup]Fortumo Mobile Payment [Automatic]
Re: [Setup]Fortumo Mobile Payment [Automatic]
Thanks for sharing, Amir. You did good. :thumbup1: