Ir para conteúdo

Featured Replies

Postado

Boa noite, estou com um proxima quando compro itens no meu site, o item não vai para a BP ou DP do personagem o que pode ser? Por favor ajuda.

 

 

Segue buypoints no config.php

// Shop option
$config['site']['shop_system'] = 1;
	// Option for buy points
	$config['site']['paypal_active'] = 0;
	$config['site']['zaypay_active'] = 0;
	$config['site']['dotpay_active'] = 0;
	$config['site']['daopay_active'] = 0;
	$config['site']['homepayActive'] = 0;

 

Segue retpagseguro.php

<?php

### DONT TOUCH IN THIS CODE ###
### WORKING FINE 19/08/2006 ###
###       IVENSPONTES       ###
### github.com/ivenspontes/ ###

header("access-control-allow-origin: https://pagseguro.uol.com.br");
require_once 'custom_scripts/PagSeguroLibrary/PagSeguroLibrary.php';
require 'config/config.php';

$method = $_SERVER['REQUEST_METHOD'];

if('POST' == $method){

    $type = $_POST['notificationType'];

    $notificationCode = $_POST['notificationCode'];

    if ($type === 'transaction'){

        try {
            $credentials = PagSeguroConfig::getAccountCredentials();
            $transaction = PagSeguroNotificationService::checkTransaction($credentials, $notificationCode);

            $arrayPDO['transaction_code'] = $transaction->getCode();
            $arrayPDO['name'] = $transaction->getReference();
            $arrayPDO['payment_method'] = $transaction->getPaymentMethod()->getType()->getTypeFromValue();
            $arrayPDO['status'] = $transaction->getStatus()->getTypeFromValue();
            $item = $transaction->getItems();
            $arrayPDO['item_count'] = $item[0]->getQuantity();
            $date_now = date('Y-m-d H:i:s');
            $arrayPDO['data'] = $date_now;

            try {
                $conn = new PDO('mysql:host='.$config['pagSeguro']['host'].';dbname='.$config['pagSeguro']['database'].'', $config['pagSeguro']['databaseUser'], $config['pagSeguro']['databasePass']);
                $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

                $stmt = $conn->prepare('INSERT into pagseguro_transactions SET transaction_code = :transaction_code, name = :name, payment_method = :payment_method, status = :status, item_count = :item_count, data = :data');
                $stmt->execute($arrayPDO);

                if ($arrayPDO['status'] == 'PAID') {
                    if ($config['pagSeguro']['doublePoints']) {
                        $arrayPDO['item_count'] = $arrayPDO['item_count']*2;
                    }
                    $stmt = $conn->prepare('UPDATE accounts SET premium_points = premium_points + :item_count WHERE name = :name');
                    $stmt->execute(array('item_count' => $arrayPDO['item_count'], 'name' => $arrayPDO['name']));

                    $stmt = $conn->prepare("UPDATE pagseguro_transactions SET status = 'DELIVERED' WHERE transaction_code = :transaction_code AND status = 'PAID'");
                    $stmt->execute(array('transaction_code' => $arrayPDO['transaction_code']));
                }

            } catch(PDOException $e) {
                echo 'ERROR: ' . $e->getMessage();
            }

        } catch(PagSeguroServiceException $e) {
            die($e->getMessage());
        }


    }
}

 

Segue buypoints.php

<?php

if(!$logged)

if($action == "logout")

$main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url(tibiacom/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Logout Successful</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr> </table> </div> </table></div></td></tr>';

else

$main_content .= 'Please enter your account name and your password.

<a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.


<form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Login</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr>

<table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>';

else

{

$main_content .= '  



<table width="100%" border="2" cellpadding="4" cellspacing="1">


<tbody><tr>


  <td class="white" colspan="3" bgcolor="#505050"><span class="style4"><center>Points</center></span></td>




</tr>


<tr bgcolor="#f1e0c6"><td width="35%"><b>Quantidade de Points</b></td><td width="35%"><b>Valor da Doacao</b></td></tr>


<tr bgcolor="#d4c0a1"><td><img src="./layouts/tibiacom/images/content/back-to-top.gif"> 5 Points</td><td>R$5,00</td></tr>




<tr bgcolor="#f1e0c6"><td><img src="./layouts/tibiacom/images/content/back-to-top.gif"> 10 Points</td><td>R$10,00</td></tr>


<tr bgcolor="#d4c0a1"><td><img src="./layouts/tibiacom/images/content/back-to-top.gif"> 20 Points</td><td>R$20,00</td></tr>


<tr bgcolor="#f1e0c6"><td><img src="./layouts/tibiacom/images/content/back-to-top.gif"> 40 Points</td><td>R$40,00</td></tr>


<tr bgcolor="#d4c0a1"><td><img src="./layouts/tibiacom/images/content/back-to-top.gif"> 60 Points</td><td>R$60,00</td></tr>


<tr bgcolor="#f1e0c6"><td><center><img src="./layouts/tibiacom/images/content/back-to-top.gif"> E assim por diante!!! <img src="./layouts/tibiacom/images/content/back-to-top.gif"></center></td><td><center><img src="./layouts/tibiacom/images/content/back-to-top.gif"> E assim por diante!!! <img src="./layouts/tibiacom/images/content/back-to-top.gif"></center></td></tr>


</tbody></table>


</br>

<center><table border="2"><tbody><tr border="2"><td bgcolor="#505050">


<center><font size="2"><b></b></font></center>


<div style="width: %">

<!-- INICIO FORMULARIO BOTAO PAGSEGURO -->
<form action="meu donate" method="post">
<!-- NÃO EDITE OS COMANDOS DAS LINHAS ABAIXO -->
<input type="hidden" name="currency" value="BRL" />
<input type="hidden" name="receiverEmail" value="meu e-mail" />
<input type="hidden" name="iot" value="button" />
<input type="image" src="https://stc.pagseguro.uol.com.br/public/img/botoes/doacoes/120x53-doar.gif" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" />
</form>
<!-- FINAL FORMULARIO BOTAO PAGSEGURO -->
</p>  <td class="white" colspan="3" bgcolor="#505050"><span class="style4"><center>!Atencao!:Apos o Pagamento pedimos que informe o <b>Nome do Personagem</b> por e-mail
E-mail para envio: <b>meu e-mail</b></center></span></td>
</tr>

<div></div>

<tr>

</tr>

</tbody></table></form>


</br></center>

</br><b><font size="1">Pelo PagSeguro e possivel realizar doacoes por Boletos Bancarios, Cartoes de credito e Transferencias entre contas PagSeguro. Apos efetuar a doacao aguarde o prazo de 24/48hrs para a conclusao da sua doacao.Os Coins serao entregues dentro do prazo definido ou apos a aprovacao do pagamento no PagSeguro.</b></font>'; } ?>

 

Postado
  • Autor
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- 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 Styller shop.')
db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.query("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 Styller 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 Styller 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

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo