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

Windows Gesior Shop - Dont get Point when donation with Paypal or ContenidoPago

sebbe hbk

Mapper - Hoster
Joined
Sep 1, 2009
Messages
164
Reaction score
3
Location
I ditt garage
Hello, as the title says. When players are donating on my server the are not getting any points. Either from Contenidopago or Paypal.

here is my shop.lua

Code:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 17
-- time (in seconds) between connections to SQL database by shop script
SQL_interval = 30
-- ### END OF CONFIG ###
function onThink(interval, lastExecution)
    local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';")
    if(result_plr:getID() ~= -1) then
        while(true) do
            id = tonumber(result_plr:getDataInt("id"))
            action = tostring(result_plr:getDataString("action"))
            delete = tonumber(result_plr:getDataInt("delete_it"))
            cid = getCreatureByName(tostring(result_plr:getDataString("name")))
            if isPlayer(cid) == TRUE then
                local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
                local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
                local container_id = tonumber(result_plr:getDataInt("param3"))
                local container_count = tonumber(result_plr:getDataInt("param4"))
                local add_item_type = tostring(result_plr:getDataString("param5"))
                local add_item_name = tostring(result_plr:getDataString("param6"))
                local received_item = 0
                local full_weight = 0
                if add_item_type == 'container' then
                    container_weight = getItemWeightById(container_id, 1)
                    if isItemRune(itemtogive_id) == TRUE then
                        items_weight = container_count * getItemWeightById(itemtogive_id, 1)
                    else
                        items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                    full_weight = items_weight + container_weight
                else
                    full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    if isItemRune(itemtogive_id) == TRUE then
                        full_weight = getItemWeightById(itemtogive_id, 1)
                    else
                        full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
                    end
                end
                local free_cap = getPlayerFreeCap(cid)
                if full_weight <= free_cap then
                    if add_item_type == 'container' then
                        local new_container = doCreateItemEx(container_id, 1)
                        local iter = 0
                        while iter ~= container_count do
                            doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
                            iter = iter + 1
                        end
                        received_item = doPlayerAddItemEx(cid, new_container)
                    else
                        local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
                        received_item = doPlayerAddItemEx(cid, new_item)
                    end
                    if received_item == RETURNVALUE_NOERROR then
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.')
                        db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
                        db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
                    else
                        doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
                    end
                else
                    doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
                end
            end
            if not(result_plr:next()) then
                break
            end
        end
        result_plr:free()
    end
    return TRUE
end


If you are helping me, i'l repp ;)
 
That script has nothing to do with that people aren't receiving any points when donating.
 
Whats script then?
i have able the ipn on paypal

paypal.htlm


Code:
<b>PayPal Shop System.</b><br><br>
The shop costs:<ul><li> 5 EUR (for 15 points)</li><li> 10 EUR (for 30 points)</li><li> 20 EUR (for 60 points)</li><br>

<b>Here are the steps you need to make:</b> <br>
1. A PayPal account with a required balance [5, 10 or 20 EUR] or a creditcard. <br>
2. Fill in your account number. <br>
3. Click on the Buy Now button or your creditcard brand. <br>
4. Make a transaction. <br>
5. After the transaction 15, 30 or 60 points will be automatically added to your account. <br>
6. Go to Item shop and use your points <br> <br> <br> </b>

<span style="color:red">If you recall the money, and your premiumpoints can't be recalled</span>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Zyber Donation points">
<b>Account name/login:</b> <input type="text"  name="custom" value="">

<select name="amount">
  <option value="5.00">5 EUR</option>
  <option value="10.00">10 EUR</option>
  <option value="20.00">20 EUR</option>
</select>
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://www.zyber.hopto.org/ipn/ipn.php">
<input type="hidden" name="return" value="http://www.zyber.hopto.org">
<input type="hidden" name="rm" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

and ipn.php


Code:
<?php
if ($_REQUEST['debug']) {
ini_set("display_errors", True);
error_reporting(E_ALL);
}
$mysql_host = 'localhost'; //Leave at localhost  
$mysql_user = 'xxxx'; //DB User  
$mysql_pass = 'xxxxx'; //DB Pass  
$mysql_db = 'xxxx'; //DB Name  
$file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file 
$payer_email = $_REQUEST['payer_email']; 
$ip = $_SERVER['REMOTE_ADDR'];
$ips = array('66.211.170.66', '216.113.188.202', '216.113.188.203', '216.113.188.204', '216.113.188.205', '66.135.197.163', '66.135.197.164', ' 66.135.197.162',  '66.135.197.141', '216.113.191.33');
if(!in_array($ip, $ips)) {
	print "Scammer...";
$hak = fopen("scammer.log", "a");
fwrite($hak, "$ip \r\n");
fclose($hak);
die(0);
}
$time = date("F j, Y, g:i a"); 
$paylist = array("5.00" => 15, "10.00" => 30, "20.00" => 60);

// connect db  

$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);

$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));  
$receiver_email = $_REQUEST['receiver_email'];  
$payment_status = $_REQUEST['payment_status'];  
$mc_gross = $_REQUEST['mc_gross']; 
$mc_currency = $_REQUEST['mc_currency'];
mysql_select_db($mysql_db, $db);  
if ($_REQUEST['debug']){
print $payment_status . '\n';
print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
print $receiver_email . '\n';
print $custom . '\n';
}
if ($payment_status == "Completed" && $receiver_email == "[email protected]" && isset($paylist[$mc_gross]) && $mc_currency == "EUR") {   
$somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";

$qry2 = "UPDATE accounts SET premium_points = premium_points + {$paylist[$mc_gross]} WHERE name = '$custom'";  
// Log Paypal Transaction 
$hak = fopen($file, "a"); 
fwrite($hak, $somecode); 
fclose($hak); 

$result2 = mysql_query($qry2);  
}  
else  
 {   
 echo("Error.");  
 }  
?>
 
Replace

Code:
<input type="hidden" name="notify_url" value="http://www.zyber.hopto.org/ipn/ipn.php">

With this

Code:
<input type="hidden" name="notify_url" value="http://www.zyber.hopto.org/paypal/ipn/ipn.php">

It should work now. :)
 
ok, but what about contenidopago? they donate and write in the code but its says: code have aldready been used.


sms.lua:

Code:
<?php

error_reporting (1);

include('sms_conf.php');



$dbc = mysql_connect($host,$user,$pass) or die("DB conection error");
mysql_select_db($db,$dbc);

$name=$_GET['name'];
$codigo=$_POST['codigo'];


if (isset($_POST['formcodigo']))
{
$name=$_POST['name'];

$QueryString  = "LinkUrl=".urlencode((($_SERVER['HTTPS']=='on')?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$QueryString .= "&codigo=" .urlencode($codigo);
$QueryString .= "&idservicio=" .$idservicio;



if(intval(get_cfg_var('allow_url_fopen')) && function_exists('file_get_contents')) {
    $result=@file_get_contents("http://contenidopago.com/codigoval.php?".$QueryString); 
}
elseif(intval(get_cfg_var('allow_url_fopen')) && function_exists('file')) {
    if($content = @file("http://contenidopago.com/codigoval.php?".$QueryString)) 
      $result=@join('', $content);
}
elseif(function_exists('curl_init')) {
    $ch = curl_init ("http://contenidopago.com/codigoval.php?".$QueryString);
    curl_setopt ($ch, CURLOPT_HEADER, 0);
    curl_exec ($ch);

    if(curl_error($ch))
        print "Error processing request";

    curl_close ($ch);
}
else {
    print "It appears that your web host has disabled all functions for handling remote pages and as a result the BackLinks software will not function on your web page. Please contact your web host for more information.";
}


if ($result=='ok')
{
$dbc = mysql_connect($host,$user,$pass) or die("DB conection error");
mysql_select_db($db,$dbc);



if(!(empty($name)))
{
    $sql = "UPDATE accounts SET premium_points = premium_points + $puntos WHERE name = '$name'";
    $res = mysql_query($sql,$dbc);
	
    if(mysql_affected_rows() == 0)
	{
        die('This username does not exist: <font color="blue">'.$name.'</font>');	
	}
		
die("Codigo : $codigo  ok , Points added to your account");	
}
else {

  die('You did not set the user!'); 
 } 
		
}

if ($result=='no')
{
die ('This code is already in used');
}

}

$puntos=$_GET['puntos'];

$hf = fopen('http://www.contenidopago.com/validate.php',r);
$line = fgets ($hf);
$restringidas = explode('|',$line);


$ip=$_SERVER['REMOTE_ADDR'];

if(!in_array($ip,$restringidas))
	die("You are not able to use this system!");


if ($_GET['check']==1)

	{
		if ($name!='')
		{
		$sql="SELECT * FROM accounts WHERE name='$name'";
		$result=mysql_query($sql);
		 if (mysql_num_rows($result) == 0 )
		 	{
		 	die ("No existe el usuario $name");
			} 
			else 
			{
			die('ok');	
			}
		}
			
	}


if ($_GET['paypal']==1)

	{
	
	if(!(empty($name)))
		{
    	 $sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + $puntos WHERE `name` = \"".$name."\"";
    	$res = mysql_query($sql,$dbc);
   		 if(mysql_affected_rows() == 0)
        	die('This username does not exist: '.$name.'');
		}
	else
    	die('You did not set the user!');
	
	die ('ok');
	
	}


if(!(empty($name))){
    $sql = "UPDATE `accounts` SET `premium_points` = `premium_points` + $puntos WHERE `name` = \"".$name."\"";
    $res = mysql_query($sql,$dbc);
   	 if(mysql_affected_rows() == 0)
       	 die('This username does not exist: '.$name.'');
	}
else
    die('You did not set the user!');
	
die ('ok');

?>
 
I've never used Contenidopago so it's nothing I know about. Have you tried their support?
 
Code:
<?php

// EDITAR CON LOS DATOS DE TU DB MYSQL (ES)
// EDIT WITH YOUR MYSQL DB INFO (EN)
// EDIT seus dados com DB MYSQL (BR)

$host = "localhost";
$user= "xxxxx";
$pass = "xxxxxxx";
$db = "xxxxxxx"; 


// su idservicio en contenidopago.com   , se puede ver en Herramientas SMS -> Mis Herramientas  (ES)
//contenidopago.com his idservicio in, you can see SMS Tools -> My Tools (EN)
//  seu idservicio en contenidopago.com, você pode ver SMS Ferramentas -> My Tools (BR)

$idservicio=7179;  

// PUNTOS a entregar por cada codigo (ES)
//Points to be delivered under each code (EN)
// Pontos a serem entregues no âmbito de cada código (BR)

$puntos=5;

?>
 
I don't think there's any SQL queries for Contenidopago. :p Have you double checked your account settings et cetera?
 
cetera? nvm :) but in the script you dont need to write the centenidopago account info, just database login right? in the script above

Go to contenidopago web page, log in, find "tools" or "help" dunno, you will find 3 links with gesior, modern Acc, and Xampp.
 
Yea that i already download and i have put it in the www folder... but now i need sql queries to the database. Thank you for your help anyway.

No you don't.

If they don't get points only change where's "localhost" to "127.0.0.1" I had problems too and this patched it.
 
Back
Top