bury
Active Member
- Joined
- Jul 27, 2008
- Messages
- 421
- Solutions
- 7
- Reaction score
- 25
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:
buypoints.php:
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):
paygol.php:
Any help????
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: