• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

10.41 Paygol weird problem

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...


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
 
PHP:
// 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"); 
}
This is the line that causes your script to stop because of the wrong IP.
Just try to test your script with your own post data and see where it goes wrong.
If you are unsure where it stops, just print out some numbers at different places so you now how far the script went before dying.
Also check any error logs from PHP/Apache.
 
I dont quite understand what you mean with print some numbers

I can press "buy points" enter my account number, "pay" using test mode and get the "success" message from paygol then I get returned to my account page with 0 points still
 
What do you mean I dont know anything about coding?


If I use a script provided by a guide or tutorial on this forum I get a error from Paygol saying something about "merchants account blablabla"

Paygol themselves gave me a new code to use in the paygolshop.php (not the ipn) and when I use that it works but still does not add points.


Feel free to try and help me atleast :) thanks anyhow!
 
PHP:
// 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");
}
This is the line that causes your script to stop because of the wrong IP.
Just try to test your script with your own post data and see where it goes wrong.
If you are unsure where it stops, just print out some numbers at different places so you now how far the script went before dying.
Also check any error logs from PHP/Apache.


Btw, the wrong ip message means it works?
 
It works now just had to use the code from paygol


<formname="pg_frm" method="post" action="https://www.paygol.com/pay" >
<p>
<inputtype="text" name="pg_custom" value=""><p>
<inputtype="hidden" name="pg_serviceid" value="xxxxx">
<inputtype="hidden" name="pg_currency" value="EUR">
<inputtype="hidden" name="pg_name" value="xxxxxx">

<!-- With Option buttons -->
<inputtype="radio" name="pg_price" value="1"checked>100 Donation points<p>
<inputtype="radio" name="pg_price" value="2">235 Donation points<p>
<inputtype="hidden" name="pg_return_url" value="?subtopic=shopsystem">
<inputtype="hidden" name="pg_cancel_url" value="?subtopic=latestnews">
<inputtype="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>


This has to be updated in todays paygol scripts i believe.
 
Back
Top