Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

FusionCMS Paymentwall API Pingback

Initiate Mage
Joined
May 5, 2014
Messages
4
Reaction score
0
Hey all, currently i'm working with FusionCMS and FusionCMS also allows paymentwall.
I've installed and got it all on my page but the pingback somehow keeps failing. Could anyone help me? This is the error.

GET HTTP/1.1Host: divine340.noip.me
Connection: close
Accept-encoding: gzip, deflate
User-Agent: Paymentwall API

HTTP/1.0 200 OKDate: Thu, 05 Jun 2014 12:42:25 GMT
Server: Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.11
X-powered-by: PHP/5.5.11
Set-cookie: PHPSESSID=e3mkt3jsh1doegkth8gk0rl173; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
X-ua-compatible: IE=Edge,chrome=1
Content-type: text/html; charset=utf-8
Connection: close


<!DOCTYPE html>


<!--


This website is powered by
______ _ _____ __ __ _____
| ____| (_) / ____| \/ |/ ____|
| |__ _ _ ___ _ ___ _ __ | | | \ / | (___
| __| | | / __| |/ _ \| '_ \| | | |\/| |\___ \
| | | |_| \__ \ | (_) | | | | |____| | | |____) |
|_| \__,_|___/_|\___/|_| |_|\_____|_| |_|_____/


fusion.raxezdev.com


-->


<html>
<head>
<title>Divine 340</title>

<link rel="stylesheet" href="http://divine340.noip.me/application/css/default.css" type="text/css" />
<link rel="stylesheet" href="http://divine340.noip.me/application/themes/catafusion/css/cms.css" type="text/css" />
<link rel="stylesheet" href="http://divine340.noip.me/application/themes/catafusion/css/main.css" type="text/css" />

<link rel="shortcut icon" href="http://divine340.noip.me/application/themes/catafusion/images/favicon.gif" />

<!-- Search engine related -->
<meta name="description" content="Stay in touch with reality!" />
<meta name="keywords" content="" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<!-- Load scripts -->
<script src="http://divine340.noip.me/application/js/html5shiv.js"></script>
<script type="text/javascript" src="http://divine340.noip.me/application/js/jquery.min.js"></script>
<script type="text/javascript" src="http://divine340.noip.me/application/js/router.js"></script>
<script type="text/javascript" src="http://divine340.noip.me/application/js/require.js"></script>
<script type="text/javascript">


if(!window.console)
{
var console = {

log: function()
{
// Prevent stupid browsers from doing stupid things
// *cough* Internet Explorer *cough*
}
};
}


function getCookie(c_name)
{
var i, x, y, ARRcookies = document.cookie.split(";");


for(i = 0; i < ARRcookies.length;i++)
{
x = ARRcookies.substr(0,ARRcookies.indexOf("="));
y = ARRcookies.substr(ARRcookies.indexOf("=")+1);
x = x.replace(/^\s+|\s+$/g,"");

if(x == c_name)
{
return unescape(y);
}
}
}


function setCookie(c_name,value,exdays)
{
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null) ? "" : "; expires="+exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}


var Config = {
URL: "http://divine340.noip.me/",
image_path: "http://divine340.noip.me/application/themes/catafusion/images/",
CSRF: getCookie('csrf_cookie_name'),
language: "english",


UseFusionTooltip: 1,


Slider: {
interval: 5000,
effect: "",
id: "slider_bg"
},

voteReminder: 0,


Theme: {
next: "",
previous: ""
}
};


var scripts = [
"http://divine340.noip.me/application/js/ui.js",
"http://divine340.noip.me/application/js/fusioneditor.js",
"http://divine340.noip.me/application/js/flux.min.js",
"http://divine340.noip.me/application/js/jquery.placeholder.min.js",
"http://divine340.noip.me/application/js/jquery.sort.js",
"http://divine340.noip.me/application/js/jquery.transit.min.js",
"http://divine340.noip.me/application/js/language.js",
];


if(typeof JSON == "undefined")
{
scripts.push("http://divine340.noip.me/application/js/json2.js");
}


require(scripts, function()
{
$(document).ready(function()
{
Language.set("null");

UI.initialize();



});
});
</script>


</head>
<body>
<!--[if lte IE 8]>
<style type="text/css">
body {
background-image:url(images/bg.jpg);
background-position:top center;
}
</style>
<![endif]-->
<section id="wrapper">
<div id="popup_bg"></div>


<!-- confirm box -->
<div id="confirm" class="popup">
<h1 class="popup_question" id="confirm_question"></h1>


<div class="popup_links">
<a href="javascript:void(0)" class="popup_button" id="confirm_button"></a>
<a href="javascript:void(0)" class="popup_hide" id="confirm_hide" onClick="UI.hidePopup()">
Cancel
</a>
<div style="clear:both;"></div>
</div>
</div>


<!-- alert box -->
<div id="alert" class="popup">
<h1 class="popup_message" id="alert_message"></h1>


<div class="popup_links">
<a href="javascript:void(0)" class="popup_button" id="alert_button">Okay</a>
<div style="clear:both;"></div>
</div>
</div>




<a href="" ><div id="logoH"></div></a>
<header id="hand"></header>
<ul id="top_menu">
<li><a href="http://divine340.noip.me/news" direct="0">Home</a></li>
<li><a href="http://divine340.noip.me/register" direct="0">Register</a></li>
<li><a href="http://divine340.noip.me/page/connect" direct="0">How to connect</a></li>
<li><a href="http://divine340.noip.me/forum" direct="0">Forum</a></li>
<li><a href="http://divine340.noip.me/online" direct="0">Online players</a></li>
<li><a href="http://divine340.noip.me/login" direct="0">Sign in</a></li>
</ul>
<div class="MenuRight">
<a href="./register" class="JoinUs">
<div class="SignIn"></div>
<div class="SignIn2"></div>
</a>
</div>
<div id="main">
<aside id="left">
<article>
<h1 class="top">Main menu</h1>
<ul id="left_menu">
<li><a href="http://divine340.noip.me/news" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Home</a></li>
<li><a href="http://divine340.noip.me/register" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Register</a></li>
<li><a href="http://divine340.noip.me/page/connect" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">How to connect</a></li>
<li><a href="http://divine340.noip.me/forum" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Forum</a></li>
<li><a href="http://divine340.noip.me/login" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Sign in</a></li>
<li><a href="http://divine340.noip.me/online" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Online players</a></li>
<li><a href="http://divine340.noip.me/armory" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Armory</a></li>
<li><a href="http://divine340.noip.me/chatbox" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Chatbox</a></li>
<li><a href="http://divine340.noip.me/changelog" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Changelog</a></li>
<li><a href="http://divine340.noip.me/donate_wall" direct="0"><img src="http://divine340.noip.me/application/themes/catafusion/images/pin-red.png">Donate</a></li>
</ul>
</article>


<article>
<h1 class="top">User area</h1>
<section class="body">
<form action="http://divine340.noip.me/login" method="post" accept-charset="utf-8"><div style="display:none">
<input type="hidden" name="csrf_token_name" value="3ba06c25d80c0b27591fcac10a120490" />
</div>
<center id="sidebox_login">
<input type="text" name="login_username" id="login_username" value="" placeholder="Username">
<input type="password" name="login_password" id="login_password" value="" placeholder="Password">
<input type="submit" name="login_submit" value="Log in!">
</center>
</form>
</section>
</article>
<article>
<h1 class="top">Server status</h1>
<section class="body">
<div class="realm">
<div class="realm_online">
1 / 100
</div>
Cataclysm Divine

<div class="realm_bar">
<div class="realm_bar_fill" style="width:1%"></div>
</div>


<!--
Other values, for designers:


$realm->getOnline("horde")
$realm->getPercentage("horde")


$realm->getOnline("alliance")
$realm->getPercentage("alliance")


-->


</div>


<div class="side_divider"></div>
<div id="realmlist">set realmlist 5.135.148.93</div>
</section>
</article>
<article>
<h1 class="top">Shout box</h1>
<section class="body">
<script type="text/javascript">
var shoutCount = 2,
shoutsPerPage = 5,
currentShout = 0;



var Shoutbox = {


/**
* Load more shouts
* param number
*/
load: function(number)
{
var element = $("#the_shouts");


currentShout = number;


element.slideUp(500, function()
{
$.get(Config.URL + "sidebox_shoutbox/shoutbox/get/" + number, function(data)
{
element.html(data).slideDown(300);


if(currentShout != 0)
{
$("#shoutbox_newer").show();
}
else
{
$("#shoutbox_newer").hide();
}


if(currentShout + shoutsPerPage >= shoutCount)
{
$("#shoutbox_older").hide();
}
else
{
$("#shoutbox_older").show();
}


});
});
},


submit: function()
{
var message = $("#shoutbox_content");


if(message.val().length == 0
|| message.val().length > 255)
{
UI.alert("The message must be between 0-255 characters long!");
}
else
{
// Disable fields
message.attr("disabled", "disabled");
$("#shoutbox_submit").attr("disabled", "disabled");


$.post(Config.URL + "sidebox_shoutbox/shoutbox/submit", {message: message.val(), csrf_token_name: Config.CSRF}, function(data)
{
message.val("");
message.removeAttr("disabled");
$("#shoutbox_submit").removeAttr("disabled");
$("#shoutbox_characters_remaining").html("0 / 255");


var content = JSON.parse(data);


$("#the_shouts").prepend('<div class="shout" id="my_shout_' + content.uniqueId + '" style="display:none">'+
'<span class="shout_date">' + content.time + ' ago</span>' +
'<div class="shout_author"><a href="' + Config.URL + 'profile/' + content.id + '" data-tip="View profile">' + content.name + '</a> said:</div>' +
content.message +
'</div>');


$("#my_shout_" + content.uniqueId).slideDown(300, function()
{
Tooltip.refresh();
});
});
}
},


remove: function(field, id)
{
$(field).parent().parent().slideUp(150, function()
{
$(this).remove();
});

$.get(Config.URL + "sidebox_shoutbox/shoutbox/delete/" + id, function(data)
{
console.log(data);
});
}
};

</script>


<div id="shoutbox">
<form onSubmit="UI.alert('Please log in to shout!');return false;">
<textarea name="shoutbox_content" placeholder="Please log in to shout!" disabled="disabled"></textarea>
<div class="shout_characters_remaining"><span id="shoutbox_characters_remaining">0 / 255</span></div>
<input type="submit" id="shoutbox_submit" value="Submit message"/>
<div class="clear"></div>
</form>


<div class="side_divider"></div>


<div id="the_shouts"> <div class="shout">
<span class="shout_date">1 day ago </span>
<div class="shout_author shout_staff"><a href="http://divine340.noip.me/profile/2" data-tip="View profile"><img src="http://divine340.noip.me/application/images/icons/icon_blizzard.gif" align="absmiddle"/>  KHALDRAX</a> said:</div>
The server has been restarted. You
can<br />official log in now.


</div>
<div class="shout">
<span class="shout_date">1 day ago </span>
<div class="shout_author "><a href="http://divine340.noip.me/profile/21" data-tip="View profile"> savvask</a> said:</div>
New player here. Trying to connect
the<br />server. It seems offline.
Pliz fix it.


</div>
</div>


</div>
</section>
</article>
<article>
<h1 class="top">Top Voters of the Week</h1>
<section class="body">
<div id="toppvp">

<div class="toppvp_character">
<div style="float:right">6 votes</div>
<b>1</b>
<a data-tip="View profile" href="http://divine340.noip.me/profile/18">ganesh</a>
</div>
<div class="toppvp_character">
<div style="float:right">6 votes</div>
<b>2</b>
<a data-tip="View profile" href="http://divine340.noip.me/profile/11">prewesh</a>
</div>
<div class="toppvp_character">
<div style="float:right">6 votes</div>
<b>3</b>
<a data-tip="View profile" href="http://divine340.noip.me/profile/2">KHALDRAX</a>
</div>
<div class="toppvp_character">
<div style="float:right">3 votes</div>
<b>4</b>
<a data-tip="View profile" href="http://divine340.noip.me/profile/12">Khaldros</a>
</div>
<div class="toppvp_character">
<div style="float:right">3 votes</div>
<b>5</b>
<a data-tip="View profile" href="http://divine340.noip.me/profile/21">savvask</a>
</div>

</div>
</section>
</article>
<article>
<h1 class="top">PvP Ladder</h1>
<section class="body">
<script type="text/javascript">

var TopPvP = {


current: 0,


show: function(id)
{
$("#toppvp_realm_" + this.current).fadeOut(150, function()
{
TopPvP.current = id;
$("#toppvp_realm_" + id).fadeIn(150);
});
}
};



$(document).ready(function()
{
TopPvP.current = 0;
$("#toppvp_realm_0").fadeIn(150);
});
</script>
<div id="toppvp">
<div class="toppvp_realm" id="toppvp_realm_0" style="display:none;">
<div class="toppvp_select">
Cataclysm Divine
</div>
<div class="toppvp_data">
<br />There are no PvP stats to display<br /><br />


</div>
</div>
<div style="clear:both;"></div>
</div>
</section>
</article>
<article>
<h1 class="top">Visitors</h1>
<section class="body">
<script type="text/javascript">
var Visitors = {


show: function(link)
{
$(link).parent().fadeOut(100);
$("#all_visitors").html('<center><img src="' + Config.image_path + 'ajax.gif" /></center>').show();


$.get(Config.URL + "sidebox_visitors/visitors/getAll", function(data)
{
$("#all_visitors").fadeOut(100, function()
{
$(this).html(data).fadeIn(100);
});
});
}
}
</script>


There are <b>2</b> visitors online <span>(<a href="javascript:void(0)" onClick="Visitors.show(this)">who?</a>)</span>
<div id="all_visitors" style="margin-top:10px;display:none;"></div>
</section>
</article>
<article>
<h1 class="top">Lottery</h1>
<section class="body">
<section id="current-lottery-status" class="sidebox_info">
<div style="text-align:center;margin-top:10px;margin-bottom:10px;">
<img src="http://divine340.noip.me/application/themes/catafusion/images/ajax.gif" />
</div>
</section>


<script>
jQuery(function () {
$.get(Config.URL + "sidebox_current_lottery/status", function (r) {
$("#current-lottery-status").html(r);
});
});
</script>


</section>
</article>
</aside>


<aside id="right">
<section id="slider_bg" style="display:none;">
<div id="slider_frame"></div>
<div id="slider">
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/7.jpg" title="Which side do you choose?"/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/8.jpg" title="Vote and be rewarded"/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/9.jpg" title="Can you gather up a team and defeat the bosses?"/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/10.jpg" title="Sit and rule over Azeroth"/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/6.jpg" title="Enter Divine340 and battle the most dangerous bosses"/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/11.jpg" title=""/></a>
<a href="http://divine340.noip.me/"><img src="http://divine340.noip.me/application/themes/catafusion/images/slides/12.jpg" title=""/></a>
</div>
</section>


<div id="content_ajax"><article>
<h1 class="top">Permission denied</h1>
<section class="body">
<center style='margin:10px;font-weight:bold;'>You must be signed in to view this page!</center>
</section>
</article></div>
</aside>


<div class="clear"></div>
</div>
<footer>
<a href="http://raxezdev.com/fusioncms" id="logo" target="_blank"></a>
<a href="http://www.djokx.com/" id="DjokxF" target="_blank"></a>
<p>© Copyright 2013 Divine 340</p>
</footer>
</section>
</body>
</html>


and right here is the pingback script i use.
<?php

class Pingback extends MX_Controller
{
private $ipsWhitelist = array(
'174.36.92.186',
'174.36.96.66',
'174.36.92.187',
'174.36.92.192',
'174.37.14.28'
);


private $secret;
private $key;
private $params;
private $signature;
private $currency;
private $uid;


/**
* Load the config options
*/
public function __construct()
{
parent::__construct();


$this->load->config('donate');
}


/**
* Handle the pingback request
*/
public function index()
{
$this->key = $this->config->item('paymentwall_key');
$this->currency = $this->input->get('currency');
$this->uid = $this->input->get('uid');


$this->params = array(
'uid' => $this->uid,
'currency' => $this->currency,
'type' => $this->input->get('type'),
'ref' => $this->input->get('ref')
);


$this->secret = $this->config->item('paymentwall_secret_key');


// Calculate the signature
$this->signature = $this->calculatePingbackSignature();


// Make sure it's really PaymentWall that is sending the data
if(in_array($_SERVER['REMOTE_ADDR'], $this->ipsWhitelist)
&& $this->input->get('sig') == $this->signature)
{
$this->process();
}
else
{
if(in_array($_SERVER['REMOTE_ADDR'], $this->ipsWhitelist))
{
die("WRONG SIGNATURE");
}
else
{
die("WRONG IP");
}


die("Permission denied");
}
}


/**
* Proceed with the payment processing
*/
private function process()
{
// Update account with donation points
$this->db->query("UPDATE `account_data` SET `dp` = `dp` + ? WHERE `id` = ?", array($this->currency, $this->uid));


// Update the monthly income logs
$this->updateMonthlyIncome();


die("OK");
}


/**
* Calculate the signature value
* return String
*/
private function calculatePingbackSignature()
{
$str = '';


foreach($this->params as $k => $v)
{
$str .= "$k=$v";
}


$str .= $this->secret;


return md5($str);
}


/**
* Keep track of the monthly income
*/
private function updateMonthlyIncome()
{
$query = $this->db->query("SELECT COUNT(*) AS `total` FROM monthly_income WHERE month=?", array(date("Y-m")));


$row = $query->result_array();


if($row[0]['total'])
{
$this->db->query("UPDATE monthly_income SET amount = amount + ".$this->currency." WHERE month=?", array(date("Y-m")));
}
else
{
$this->db->query("INSERT INTO monthly_income(month, amount) VALUES(?, ?)", array(date("Y-m"), floor($this->currency)));
}
}
}

i'd appreciate if anyone could help!
 
Back
Top