vingo
Active Member
- Joined
- Oct 27, 2012
- Messages
- 464
- Reaction score
- 43
Hello everyone.
I have setup paygol properly as everything works except that it won't add the points automatically.
I believe it has something to do with Paygol intergrated php script, but Im not sure.
If i enter my ipn i get the "error: wrong ip" etc
If I change to the old paygol script I get error on paygol website saying "problem with merchants account"
I wrote to paygol and they told me to update my script which I did and it worked flawless again except for the no points being added...
I have setup paygol properly as everything works except that it won't add the points automatically.
I believe it has something to do with Paygol intergrated php script, but Im not sure.
If i enter my ipn i get the "error: wrong ip" etc
If I change to the old paygol script I get error on paygol website saying "problem with merchants account"
I wrote to paygol and they told me to update my script which I did and it worked flawless again except for the no points being added...
PHP:
<?PHP
$main_content .= '
<b>SMS DONATION</b></CENTER><br /><br />
<ol>
<li>Enter your account number.</li>
<li>Choose your payment price.</li>
<li>Click on the red Pay by mobile button.</li>
<li>Follow the instructions.</li>
<li>Your points will be added automatically.</li>
<li>DONT FORGET TO PUT IN YOUR ACCOUNT NUMBER! IF YOU DONT DO IT YOU WONT GET ANY POINTS!</li>
<li>IF YOU FORGET TO PUT IN YOUR ACCOUNT NUMBER ANY STAFF WONT GIVE YOU POINTS!</li>
</ol>
</br>
<center><b><li>100 Premium Points for 5 EUR</li>
<li>235 Premium Points for 10 EUR</li>
</center></b>
</br>
';
$main_content .= '<center>
<!-- PayGol JavaScript -->
<script src="http://www.paygol.com/micropayment/js/paygol.js" type="text/javascript"></script>
<!-- PayGol Form -->
<form name="pg_frm" method="post" action="https://www.paygol.com/pay" >
<form name="pg_frm">
<h1>Enter account number:</h1><p>
<input type="text" name="pg_custom" value=""><p>
<input type="hidden" name="pg_serviceid" value="109961">
<input type="hidden" name="pg_currency" value="EUR">
<input type="hidden" name="pg_name" value="Donations Tryera">
<input type="hidden" name="pg_custom" value="">
<!-- With Option buttons -->
<input type="radio" name="pg_price" value="1"checked>100 Donation points 5£<p>
<input type="radio" name="pg_price" value="2">235 Donation points 10£<p>
<input type="hidden" name="pg_return_url" value="http://tryera.sytes.net/?subtopic=shopsystem">
<input type="hidden" name="pg_cancel_url" value="http://tryera.sytes.net/?subtopic=latestnews">
<input type="image" name="pg_button" src="https://www.paygol.com/micropayment/buttons/en/white.png" border="0" alt="Make payments with PayGol: the easiest way!" title="Make payments with PayGol: the easiest way!" >
</form></center>';
?> [php]
[php]
<?php
/*
Note:Before starting you have to create an account at http://www.paygol.com/register?affiliatecode=T8Y7-LK0M-NY0R-Y6O3
*/
// check that the request comes from PayGol server
if(!in_array($_SERVER['REMOTE_ADDR'],
array('109.70.3.48', '109.70.3.146', '109.70.3.210'))) {
header("HTTP/1.0 403 Forbidden");
die("Error: Unknown IP");
}
// CONFIG
$your_service_id = 109961; // Your service ID from Paygol
// get the variables from PayGol system
$message_id = $_GET['message_id'];
$service_id = $_GET['service_id'];
$shortcode = $_GET['shortcode'];
$keyword = $_GET['keyword'];
$message = $_GET['message'];
$sender = $_GET['sender'];
$operator = $_GET['operator'];
$country = $_GET['country'];
$custom = $_GET['custom'];
$points = $_GET['points'];
$price = $_GET['price'];
$currency = $_GET['currency'];
//Replace these parameters by your database details
$dbhost = "localhost"; //Your database domain
$dbuser = ""; //Database username
$dbpassword = ""; //Database password
$db = ""; //Database name
if ($your_service_id == $service_id) {
//Connect to Database
$conn = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($db);
$sql = "UPDATE accounts SET premium_points = premium_points+'".mysql_real_escape_string($points)."' WHERE name = '".mysql_real_escape_string($custom)."'";
mysql_query($sql);
mysql_close($conn);
}
[php]
Everything should be setup correctly.
I can logout from phpmyadmin with the information I add under dbpassword and dbuser and the db is also correctly setup..
Any experienced user that has any idea?
@Ninja