• 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!

[Paygol] Complete tutorial with photos and scripts!

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,444
Solutions
5
Reaction score
1,166
Location
Sweden
Hello!

I will guide you to set up paygol for your server.
This works with gesior, for me at least.
If you use ZnoteAAC use the script already installed.
And i use Uniform Server. But it will be the same for xampp but the "www" folder is called "htdocs" in xampp.

What is paygol?
Paygol is an service that allow your players to donate via SMS and phone.
It is like Zaypay but with paygol you don't need to be verified.

First of all, you need to be member on paygol. This can be done here: https://secure.paygol.com/register

And remember to read all

STEP 1: INSTALL THE SCRIPTS

First of all, create an script inside "WWW/pages" folder and name it paygol.php
When you created the script, put this code inside it:

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.58'))) {
  header("HTTP/1.0 403 Forbidden");
  die("Error: Unknown IP");
}
// CONFIG
$your_service_id = 49001;  // 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     = "YOUR PHPMYADMIN LOGIN"; //Database username
$dbpassword = "YOUR PHPMYADMIN PASSWORD"; //Database password
$db         = "YOUR SERVER DATABASE"; //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);
}

?>

Done with it, for the moment at least. Now create an second file in same folder (WWW/PAGES) and name it like paygolshop.php
When you have create that file, post this code inside:

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>280 Premium Points for 3 EUR</li>
<li>460 Premium Points for 6 EUR</li>
<li>850 Premium Points for 9 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">
 <h1>Enter account number:</h1><p>
 <input type="text" name="pg_custom" value=""><p>
 <input type="hidden" name="pg_serviceid" value="49001">
 <input type="hidden" name="pg_currency" value="EUR">
 <input type="hidden" name="pg_name" value="Premium Points">

 <!-- With Option buttons -->
 <input type="radio" name="pg_price" value="1"checked>280 Premium Points For 3 Euro<p>
 <input type="radio" name="pg_price" value="2">460 Premium Points For 6 Euro<p>
 <input type="radio" name="pg_price" value="3">850 Premium Points For 9 Euro<p>
 <input type="hidden" name="pg_return_url" value="http://YOURWEBSITE.COM/index.php?subtopic=shopsystem">
 <input type="hidden" name="pg_cancel_url" value="">
 <input type="image" name="pg_button" class="paygol" src="http://www.paygol.com/micropayment/img/buttons/125/red_en_pbm.png" border="0" alt="Make payments with PayGol: the easiest way!" title="Make payments with PayGol: the easiest way!" onClick="pg_reDirect(this.form)">
</form>  </center>'; 

?>

Done with that to for the moment.
Now, to check so the paygol.php IPN script works good, try go to http://YOURWEBSITE.com/pages/paygol.php
If it works, you should get "Error: Unknown IP"..

It it works, then lets go to step 2!

STEP 2: SET UP PAYGOL SERVICE

Okey, now you should have an paygol account. Log in to the site.
On the left menu you should see "Create service", press on it. And then choose "For any type of website"

Ok, on name you can put "Donation".
On type, take "Multi-Price"
And choose what value you want, i use EUR in this case.
After is should look like this:

0GBRkx.png


Now lets go to the box down, you can choose "Dropdown with prices" or "Options with prices". Press them to check examples.
I use "Options with prices" in this case!
Now you can write what you want the each donation named, and price and points to get.
I do like this : (Is just an example, you can choose what price and how many points the buyer will get)

NPk_78.png


Fill them how you want, and press the "Save" in the box to see how it looks.
Now lets continue, if you scroll down you will se 5 different fields.

Report email: Your Email adress:
Url Background (IPN) : http://YOURWEBSITE.com/pages/paygol.php (Note, this is important so the players get the points.)
Url Success: After an player buying some points, then he will be moved to this link. Put etc: http://YOURWEBSITE.com/?subtopic=shopsystem
Url Cancel: If the buy don't work. (If they don't got enough of money or what ever cause it) Put maybe http://YOURWEBSITE.com/?subtopic=latestnews

Ok, now it should look like:

nDLBdf.png


Now done with that, then scroll down and you will se many countries. Press on both "Select all". It should look like this now:

A_2Wwm.png


Now scroll down more and press on the yellow "Save" button.
Now you will come to an list of your services.

Your newest service will there called "Donation" and in that you will se an ID of the service, this one:

xellop.png


That service is needed in both scripts, in paygol.php here:

PHP:
$your_service_id = 49001;  // Your service ID from Paygol

Change the "49001" to your service ID.

Also you need to change in paygolshop.php, here:

PHP:
<input type="hidden" name="pg_serviceid" value="49001">[PHP]

Same here, change the 49001 to your service ID.

Now remember so you have fill the DB information in paygol.php, here:

[PHP]
//Replace these parameters by your database details
$dbhost     = "localhost"; //Your database domain
$dbuser     = "YOUR PHPMYADMIN LOGIN"; //Database username
$dbpassword = "YOUR PHPMYADMIN PASSWORD"; //Database password
$db         = "YOUR SERVER DATABASE"; //Database name

And last thing, change in paygolshop.php this line:

PHP:
<input type="hidden" name="pg_return_url" value="http://YOURWEBSITE.COM/index.php?subtopic=shopsystem">

To your ip adress or domain you use.

Now you should be able to enter http://YOURWEBSITE.COM/index.php?subtopic=paygolshop

I hope this will help some out at least, thanks for me.
 
Thanks man <3 love you
But on paygolshop.php it has different prices any chance you could add me Skype ill pm you




Sorry i made a big mistake thought i edited it but ov not solved.
 
Last edited:
You can just edit the text in paygolshop.php
 
Thanks bro, rep!
 
Last edited:
i don't know why i don't receive the points automatically, can u help me?
It is because I am using the paygol in Test mode?
 
i don't know why i don't receive the points automatically, can u help me?
It is because I am using the paygol in Test mode?

It don't matter if you use test mode or not.
You did something wrong at the installation, check so the connections to db is 100% correct.
Also look the step when you create a new service on paygol.com, you need to locate the ipn file correct there also. That part is most important also.
 
I don´t understand the
Url Background (IPN) : http://YOURWEBSITE.com/pages/paygol.php (Note, this is important so the players get the points.)
Url Success: After an player buying some points, then he will be moved to this link. Put etc: http://YOURWEBSITE.com/?subtopic=shopsystem
Url Cancel: If the buy don't work. (If they don't got enough of money or what ever cause it) Put maybe http://YOURWEBSITE.com/?subtopic=latestnews
part im using znote aac and I don´t have a ?subtopic=shopsystem in my server shall I add it either way or can you help me please. if you know what the problem is
 
Last edited:
im using znote aac and I don´t have a ?subtopic=shopsystem in my server shall I add it either way or can you help me please. if you know what the problem is

Like i wrote in the main post, ''If you use ZnoteAAC use the script already installed.''
 
This only work for gesior acc.

Actually, no. It's just an ipn script, all you have to edit is this line:

SQL:
 $sql = "UPDATE accounts SET premium_points = premium_points+'".mysql_real_escape_string($points)."' WHERE name = '".mysql_real_escape_string($custom)."'";

Whereas the rest is "official" paygol code and it works on any engine, you just need to know how to use it properly.



http://www.paygol.com/micropayment/implementation
 
Last edited:
i have problem, with this,,,
it was work with me fine, but when i restart the accounts, it got debuged,
When the player donate, he get his points and i dont get my money :O
 
i have this error when i enter http//mywepsite/?subtopic=paygolshop.php

PHP:
Error occured!
Error ID: CRITICAL ERROR
More info: Cannot load page paygolshop.php, invalid file name [contains illegal characters].

File: C:\UniServer\www\system/load.compat.php   Line: 23
File: C:\UniServer\www/index.php   Line: 33

i use gesior https://github.com/gesior/Gesior2012..._rev_3703+.zip - version for TFS 0.4 rev. 3703+

so please help
 
i have this error when i enter http//mywepsite/?subtopic=paygolshop.php

PHP:
Error occured!
Error ID: CRITICAL ERROR
More info: Cannot load page paygolshop.php, invalid file name [contains illegal characters].

File: C:\UniServer\www\system/load.compat.php   Line: 23
File: C:\UniServer\www/index.php   Line: 33

i use gesior https://github.com/gesior/Gesior2012..._rev_3703 .zip - version for TFS 0.4 rev. 3703+

so please help

Read the error message: Cannot load page paygolshop.php, invalid file name [contains illegal characters].


_CorneX_ I need help, I put http://localhost/paygol_ipn.php and it says: Error: Unknown IP, but it says forever.


And in http://localhost/paygolshop.php it says : Notice: Undefined variable: main_content in C:\xampp\htdocs\paygolshop.php on line 24

You can't communicate with Paygol if your website is offline.
 
i did some thing else and made it work
and made it appear in the buypoints page
in gesior 2012
 
Back
Top