[Gesior] Problem with paygol script

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
Hello, I tried to implement paygol to my gesior website using the wladca script but when I click on the paygol image nothing happens and redirect to my index/home website. The scripts:

paygol.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.58'))) {
  header("HTTP/1.0 403 Forbidden");
  die("Error: Unknown IP");
}
// CONFIG
$your_service_id = xxxxxx;  // 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     = "xxxxxxxx"; //Database username
$dbpassword = "xxxxxxx"; //Database password
$db         = "xxxxxxx"; //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);
}
?>

buypoints.php:

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>
</ol>
</br>
<center><b><li>12 Premium Points for 3 EUR</li>
<li>26 Premium Points for 6 EUR</li>
<li>40 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">
Enter account number:<p>
<input type="text" name="pg_custom" value=""><p>
<input type="hidden" name="pg_serviceid" value="xxxxxxx">
<input type="hidden" name="pg_currency" value="EUR">
<input type="hidden" name="pg_name" value="xxxxxx">
<!-- With Option buttons -->
<input type="radio" name="pg_price" value="1"checked>12 Premium Points 3<p>
<input type="radio" name="pg_price" value="2">26 Premium Points 6<p>
<input type="radio" name="pg_price" value="3">40 Premium Points 9<p>
<input type="hidden" name="pg_return_url" value="xxxxxxxxxxxxxxxx">
<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>';
?>


Obiously the xxxxxxxxx = are real credentials of my server. I can't find the part where it redirects to paygol/pay or whatever...

Thanks!!

bump

bump

bump

last bump :(

Finally both scripts are working but it seems there is not communication between them. IPN location is well set on the paygol service. I set it up as multi price, points are well set. The db info is correct because I just copied it from config.lua info and checked it much times.

When I click on for example in "Buy 25 premium points 3.00" it redirects you to the paygol website in testing mode, once the transaction has finished, it redirects you to the shop but you still have the same points.

payg.php: ----> (I have buypoints.php with the jpg of the payments redirecting to the subtopic payments, in this case, the paygol image -> payg.php):

PHP:
<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><b>DONT FORGET TO PUT IN YOUR ACCOUNT NUMBER! IF YOU DONT DO IT YOU WONT GET ANY POINTS!</li></b>
</ol>
</br>
<center><b>
<li>25 Premium Points for 3 EUR</li>
<li>50 Premium Points for 6 EUR</li>
<li>105 Premium Points for 10 EUR</li>
</center></b>
</br>




<center><form name="pg_frm" method="post" action="https://www.paygol.com/pay" >
Enter account number:<p>
<input type="text" name="pg_custom" value=""><p>
   <input type="hidden" name="pg_serviceid" value="xxxxx">
   <input type="hidden" name="pg_currency" value="EUR">
   <input type="hidden" name="pg_name" value="xxxxxx">
   <input type="radio" name="pg_price" value="1"checked>Buy 25 premium points 3.00<p>
   <input type="radio" name="pg_price" value="2">Buy 50 premium points 5.00<p>
   <input type="radio" name="pg_price" value="3">Buy 105 premium points 10.00<p>
   <input type="hidden" name="pg_return_url" value="xxxxxxxxxxx/?subtopic=shopsystem">
   <input type="hidden" name="pg_cancel_url" value="">
   <input type="image" name="pg_button" src="https://www.paygol.com/pay-now/images/payment-button.png" boder="0" alt="Make payments with PayGol: the easiest way!" title="Make payments with PayGol: the easiest way!">
</form> </center>

paygol.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.58'))) {
  header("HTTP/1.0 403 Forbidden");
  die("Error: Unknown IP");
}
// CONFIG
$your_service_id = xxxxx;  // 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     = "xxxxxxx"; //Database username
$dbpassword = "xxxxxxx"; //Database password
$db         = "xxxxxxx"; //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);
}
Any help????
 
Last edited by a moderator:

Raggaer

Godly Member
Joined
Jul 25, 2012
Messages
1,556
Best answers
8
Reaction score
895
Location
Spain
That paygol script uses deprecated mysql_ methods. If you are using PHP 7 the script wont work.
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
That paygol script uses deprecated mysql_ methods. If you are using PHP 7 the script wont work.
I'm using PHP/7.1.1. What can I do then?
 

Ziker

Well-Known Member
Joined
May 7, 2017
Messages
184
Best answers
6
Reaction score
50
Location
Edinburgh
Downgrade your PHP (I'd personally discourage this) or re-write your scripts to work with PHP 7 (using either mysqli or PDO)
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
Downgrade your PHP (I'd personally discourage this) or re-write your scripts to work with PHP 7 (using either mysqli or PDO)
My web and my server are 99.9% ready with 0 bugs, I've been working since January as a job for 1h/day and since Jun i've been testing everything. Everything works properly, I won't change then, my php as you would understand. The scripts that paygol provide are the same than I've used and pasted here, the only different thing is the custom (acc number, and then update the acc table to add the points), or what is the same, this 8 lines:

PHP:
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);
}
I dont have enough knowledge about mysql/php to update this lines to php 7.1.1, thats why I ask it here. Is it very hard?
 

Gesior.pl

Mega Noob&LOL 2012
Joined
Sep 18, 2007
Messages
2,033
Best answers
19
Reaction score
1,089
Location
PLand
Code updated to PHP 7:
Code:
<?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 = xxxxxx;  // 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     = "xxxxxxxx"; //Database username
$dbpassword = "xxxxxxx"; //Database password
$db         = "xxxxxxx"; //Database name
if ($your_service_id == $service_id) {
    try {
        $SQL = new PDO('mysql:host=' . $dbhost . ';dbname=' . $db, $dbuser, $dbpassword);
        $SQL->query('UPDATE accounts SET premium_points = premium_points+' . $SQL->quote($points) . ' WHERE `name` = ". $SQL->quote($custom));
    } catch (PDOException $e) {
        print "Error! Connection to database failed!<br/>";
        die();
    }
}
?>
 

Raggaer

Godly Member
Joined
Jul 25, 2012
Messages
1,556
Best answers
8
Reaction score
895
Location
Spain
As @Ziker said, google PHP PDO and change those 5 lines.

We already told you the solution, it takes 5 minutes to change the lines, I am sure learning its better than me spoon feeding you
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
As @Ziker said, google PHP PDO and change those 5 lines.

We already told you the solution, it takes 5 minutes to change the lines, I am sure learning its better than me spoon feeding you
Relax, mate. It took YOU 5 minutes to change the lines and thats why I ask for help in this community where I've been pacc some times and I help as I can. I tried to change it by myself and didn't work. Some hours after trying it, I decided to post it here since open tibia is my hobby and I wont know about programming what people of this community knows in years because my job is not related neither with computer science nor programming.

I know basic about C, XML, LUA, LINUX, PHP or SQL, fair enough to manage an open tibia server in my opinion. I dont want to be an expert about PHP just for doing this script and I don't have time. Some years ago I used Zaypay but it closed.

If you don't want to help it's okay, I won't judge you, but this forum has an utility.
 
Last edited:

Ziker

Well-Known Member
Joined
May 7, 2017
Messages
184
Best answers
6
Reaction score
50
Location
Edinburgh
Relax, mate. It took YOU 5 minutes to change the lines and thats why I ask for help in this community where I've been pacc some times and I help as I can. I tried to change it by myself and didn't work. Some hours after trying it, I decided to post it here since open tibia is my hobby and I wont know about programming what people of this community knows in years because my job is not related neither with computer science nor programming.

I know basic about C, XML, LUA, LINUX, PHP or SQL, fair enough to manage an open tibia server in my opinion. I dont want to be an expert about PHP just for doing this script and I don't have time. Some years ago I used Zaypay but it closed.

If you don't want to help it's okay, I won't judge you, but this forum has an utility.
You are both right actually. It took him 5 minutes, would take me at most 5 minutes too. But the fact is, I've learnt this and before I have, it would take me more time to deal with these things. I did learn about it, because it was my hobby back then (now it's part of my job).

I will not write it for you, because I don't believe in giving solutions. If OpenTibia is your hobby really, I believe this somewhat basic knowledge of PHP (yes, this is basic) may really help you in the future.

But I trust you can do this yourself, why? Because it's rather trivial for the code you have. No need to use PDO, I think if you are not familiar with PHP, you should rather go for mysqli as it is pretty much the same as mysql (both are procedural and expose very similar methods).

So let's make a deal, give it a try with mysqli (the hard part I've done for you, look here: How to Convert MySQL to MySQLi PHP Code to Upgrade to PHP7 Doing the PHP MySQL MySQLi Migration - PHP MySQL to MySQLi package blog - PHP Classes) and see if you can handle this yourself. If not, post your code (modified) back here and I will fix it if it does not work.
 

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,215
Best answers
224
Reaction score
1,171
Location
Sweden
Relax, mate. It took YOU 5 minutes to change the lines and thats why I ask for help in this community where I've been pacc some times and I help as I can. I tried to change it by myself and didn't work. Some hours after trying it, I decided to post it here since open tibia is my hobby and I wont know about programming what people of this community knows in years because my job is not related neither with computer science nor programming.

I know basic about C, XML, LUA, LINUX, PHP or SQL, fair enough to manage an open tibia server in my opinion. I dont want to be an expert about PHP just for doing this script and I don't have time. Some years ago I used Zaypay but it closed.

If you don't want to help it's okay, I won't judge you, but this forum has an utility.
Merged your thread(s), not sure why you would create 2 threads for the same problem???
Did you even try the code that @Gesior.pl posted?

The reason why people don't wanna "feed" you is to make you learn thing, if we tell you how to spell "hi" will you remember that the next time?
In a way it's the basics, aka keeping up with the new versions, but idk if I would call this the basics unless you recently started with PHP or keep yourself update.

Since you are using Gesior you should use the integrated SQL functions, tbh it dosn't matter what AAC you are using - ALWAYS use the functions you are provided with.
Why? - Well if there is a problem like this, would you rather change 1 function or 100 functions? Always call the same function insted of the same class - in the case you need to modify the parameters to the class or the class itself.

If you wanna learn there are ways, we the people who help users here in the support board didn't learn everything in a day, it took years. If you know the basics you can easily find out what the problem is.
The No 1 reason I see threads created here is "oh I found an error, better post it before I read it" - tbh read the errors let's say 80% of the time the error is 100% correct and tells you where the problem is and most likely WHAT the problem is.

Not sure how you compare you using Zaypay (and saying it dosn't work anymore, last time I checked it does still work) and having to be a "pro" on PHP.
You really don't need to be a pro to fix things, you need to learn to read the errors as I said and check what the problem might be.
If you actually need a pro then sure, hire one but it's rare.


Tbh I don't see any reason to even open a new document on my editor to edit the same code Gesior already did, he wrote the AAC I trust that he did the correct "patch", so give it a try and report if you got any issues insted.
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
@WibbenZ Yeah, im talking with him. Atm it still doesn't work and we don't know why (all the db info is well set and the id too), is like there is not communication between both scripts but IPN is well set on paygol id service (idk if I have to set in somewhere else, following the scripts made here, I haven't). Now I'll set like some logs and see if we find something.

Look at my registration date m8, It's even older than yours. I've fixed hundreds and hundreds of errors and when I'm tired of finding the solution, I ask for help. And yes, most of them are easy to fix because they're solved here yet. Try to enter zaypay now, it doesn't work, what's more, they have like 8€ that are mine (well they, WERE mine haha).

I made two threads because first time I couldn't even enter in paygol website since they stopped using java and the script here in otland was made with java or something, after that I could make the transaction in test mode but it doesn't add points.

@Ziker

But the thing is doing that, I've to update all the mysql, isn't it? What would be the advantage? Because everything is working 100% in my server from my point of view, except this. And I have to set it up because last time I hosted a server it was helpful to pay the hosting service and the domain.

Btw, in the code of gesior there is a syntax error (or thats what system said)

PHP:
' WHERE `name` = "
to
PHP:
"' WHERE name = '"
 

Ziker

Well-Known Member
Joined
May 7, 2017
Messages
184
Best answers
6
Reaction score
50
Location
Edinburgh
@Ziker

But the thing is doing that, I've to update all the mysql, isn't it? What would be the advantage? Because everything is working 100% in my server from my point of view, except this. And I have to set it up because last time I hosted a server it was helpful to pay the hosting service and the domain.

Btw, in the code of gesior there is a syntax error (or thats what system said)

PHP:
' WHERE `name` = "
to
PHP:
"' WHERE name = '"
Not really, I don't know what kind of MySQL driver / adapter GesiorAcc use in general, but if it works just fine then it must be either mysqli or PDO (or any other compatible with PHP 7 for that matter). The script you have is probably older than current version of GesioAcc and thus is not compatible with PHP 7, it's that simple. So you only need to update the script using mysqli (easier for mysql -> mysqli conversion because of reasons I specified earlier) or PDO, but ideally the database layer included in GesiorAcc already.

The line you specified should look like this if I'm not wrong:

PHP:
$SQL->query('UPDATE accounts SET premium_points = premium_points+' . intval($points) . ' WHERE `name` = ' . $SQL->quote($custom));
but ideally it should use prepared statement (either emulated or native MySQL prepared statement).
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
Not really, I don't know what kind of MySQL driver / adapter GesiorAcc use in general, but if it works just fine then it must be either mysqli or PDO (or any other compatible with PHP 7 for that matter). The script you have is probably older than current version of GesioAcc and thus is not compatible with PHP 7, it's that simple. So you only need to update the script using mysqli (easier for mysql -> mysqli conversion because of reasons I specified earlier) or PDO, but ideally the database layer included in GesiorAcc already.

The line you specified should look like this if I'm not wrong:

PHP:
$SQL->query('UPDATE accounts SET premium_points = premium_points+' . intval($points) . ' WHERE `name` = ' . $SQL->quote($custom));
but ideally it should use prepared statement (either emulated or native MySQL prepared statement).
In gesior Acc the script of paygol was not included so I just get what I could from otland. Your line is similar of gesior wrote above, but it still doesn't add the points. If I cant fix it I think I can try contenidopago....

IPN URL: domain.net/pages/paygol.php

If I click this ^^ ^^ ^^ on my explorer: Error: Unknown IP so it seems its working. Id is well set. Db info is just a copy/paste from config.lua so it must work.

It's, like I say, like payg.php (where you enter on website to purchase) and paygol.php (the report) dont have communication between them. So wierd. I don't want to be a problem anymore...

Could be the test mode a problem for this? Maybe it is not sending report in test mode? Idk what to think yet. Thanks for ur time, really.


 

Ziker

Well-Known Member
Joined
May 7, 2017
Messages
184
Best answers
6
Reaction score
50
Location
Edinburgh
In gesior Acc the script of paygol was not included so I just get what I could from otland. Your line is similar of gesior wrote above, but it still doesn't add the points. If I cant fix it I think I can try contenidopago....

IPN URL: domain.net/pages/paygol.php

If I click this ^^ ^^ ^^ on my explorer: Error: Unknown IP so it seems its working. Id is well set. Db info is just a copy/paste from config.lua so it must work.

It's, like I say, like payg.php (where you enter on website to purchase) and paygol.php (the report) dont have communication between them. So wierd. I don't want to be a problem anymore...

Could be the test mode a problem for this? Maybe it is not sending report in test mode? Idk what to think yet. Thanks for ur time, really.

Well, there is no direct communication between these scripts and there should not be. The first one redirects user to paygol page to deal with the payment, then paygol system makes POST request to the other page (paygol.php) with information required to verify the payment has been made (in result your script called by paygol page adds user points). I don't know anything about what paygol posts there, so perhaps you should check their documentation first. It may be that the script you have is outdated (though there's no verification other than the IP check, so hard to say).

I'm afraid that without accessing the whole thing nobody will be able to help you, because it simply requires debugging the script (and since it's called by paygol only, it has to use logging to database / file to see what's happening in there). Also the code in catch block is useless (in Gesior's script), since this code is not called by user's browser, so the "print" will end up nowhere.
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
Well, there is no direct communication between these scripts and there should not be. The first one redirects user to paygol page to deal with the payment, then paygol system makes POST request to the other page (paygol.php) with information required to verify the payment has been made (in result your script called by paygol page adds user points). I don't know anything about what paygol posts there, so perhaps you should check their documentation first. It may be that the script you have is outdated (though there's no verification other than the IP check, so hard to say).

I'm afraid that without accessing the whole thing nobody will be able to help you, because it simply requires debugging the script (and since it's called by paygol only, it has to use logging to database / file to see what's happening in there). Also the code in catch block is useless (in Gesior's script), since this code is not called by user's browser, so the "print" will end up nowhere.
This is the demo scripts that paygol provide:

PHP:
<form name="pg_frm" method="post" action="https://www.paygol.com/pay" >
   <input type="hidden" name="pg_serviceid" value="123">
   <input type="hidden" name="pg_currency" value="EUR">
   <input type="hidden" name="pg_name" value="DEMO">
   <input type="hidden" name="pg_custom" value="">
   <input type="hidden" name="pg_price" value="1">
   <input type="hidden" name="pg_return_url" value="http://www.paygol.com/webapps/implementation">
   <input type="hidden" name="pg_cancel_url" value="">
   <input type="image" name="pg_button" src="https://www.paygol.com/pay-now/images/payment-button.png" border="0" alt="Realiza pagos con PayGol: la forma mas facil!" title="Realiza pagos con PayGol: la forma mas facil!" >  
</form>
This should be the first script you said, like buypoints.php or whatever (as I said I put jpg in buypoints.php and then redirect to the script of the company). I changed the outdate java line that I found in otland with this.

And then, the report:

PHP:
<?php

$secret_key = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee";  // Enter secret key for your service.

// Secret key validation
if ($secret_key != $_GET['key']) {
    echo "Validation error";
    exit;
}

// get the variables from PayGol system
$transaction_id = $_GET['transaction_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'];

// Here you can do whatever you want with the variables, for instance inserting or updating data into your Database

?>
I know there is a call after transaction has finished to that report for doing whatever, but it's still comunication isn't it? Anyway, if we find the solution I could made a post with the newest system of the web because I think is the best and most complete.

EDIT: In the first script they ask you for the id, and in the report for the secret key, I tried to put in the script:

if ($secret_key == $service_id) blablabla

But this didn't work. Obiously they are different values although they are in the same service of paygol...
 
OP
bury

bury

Member
Joined
Jul 27, 2008
Messages
389
Best answers
7
Reaction score
9
I think I solved it, let me try it and I share the solution doing a new topic. Thanks.
 

Crixpx

New Member
Joined
Jan 11, 2015
Messages
66
Best answers
0
Reaction score
0
try this :D

buypoints.php


Code:
<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><b>DONT FORGET TO PUT IN YOUR ACCOUNT NUMBER! IF YOU DONT DO IT YOU WONT GET ANY POINTS!</li></b>
</ol>
</br>
<center><b>
<li>25 Premium Points for 3 EUR</li>
<li>50 Premium Points for 6 EUR</li>
<li>105 Premium Points for 10 EUR</li>
</center></b>
</br>
<center><form name="pg_frm" method="post" action="https://www.paygol.com/pay" >
Enter account number:<p>
<input type="text" name="pg_custom" value=""><p>
   <input type="hidden" name="pg_serviceid" value="xxx">
   <input type="hidden" name="pg_currency" value="EUR">
   <input type="hidden" name="pg_name" value="heroic lands">
   <input type="radio" name="pg_price" value="1"checked>Buy 25 premium points 3.00<p>
   <input type="radio" name="pg_price" value="2">Buy 50 premium points 5.00<p>
   <input type="radio" name="pg_price" value="3">Buy 105 premium points 10.00<p>
   <input type="hidden" name="pg_return_url" value="http://www.heroic-lands.com/?subtopic=shopsystem">
   <input type="hidden" name="pg_cancel_url" value="">
   <input type="image" name="pg_button" src="https://www.paygol.com/pay-now/images/payment-button.png" boder="0" alt="Make payments with PayGol: the easiest way!" title="Make payments with PayGol: the easiest way!">
</form> </center>


smsreport.php
Code:
     <?php

$secret_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";  // Enter secret key for your service.

// Secret key validation
if ($secret_key != $_GET['key']) {
    echo "Validation error";
    exit;
}

// get the variables from PayGol system
$transaction_id = $_GET['transaction_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'];

// Here you can do whatever you want with the variables, for instance inserting or updating data into your Database
$dbhost     = "127.0.0.1"; //Your database domain
$dbuser     = "root"; //Database username
$dbpassword = "xxxxxx"; //Database password
$db         = "xxxxxx"; //Database name
//Connect to Database
$conn = mysql_connect($dbhost, $dbuser, $dbpassword);
mysql_select_db($db);
$sql = "UPDATE accounts SET premium_points = premium_points+$points WHERE name = '$custom'";
mysql_query($sql);
mysql_close($conn);
?>
 

karudotpl

briall.pl
Joined
Mar 6, 2013
Messages
38
Best answers
0
Reaction score
3
Location
Poland
bump,

need to have it working.. it still not giving points to accounts...

any idea? i already tryied to edit znote script and this one but still cant earn points..
 
Top