Ir para conteúdo

Pagserguro


fredpadua

Posts Recomendados

Galera preciso de um tutorial de como colocar

pra quando comprar points no site (Gesior)

cair na minha account do pagseguro.

 

Outro é a entrega de points + itens sozinhos.

 

 

(Tutoriais completos, pq n tenho ideia de como vou colocar isso.)

 

 

Valendo 2 +REP

Link para o comentário
Compartilhar em outros sites

bem tem um totorial aqui de como entregar pontos automaticamente usando pagseguro.

 

ai vai o link

http://www.xtibia.com/forum/topic/147461-gesior-acc-pagseguro-entregando-pontos-automaticamente/

Editado por Exchange
Link para o comentário
Compartilhar em outros sites

va e htdocs e crie um arquivo com o nome de pagseguro.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('.$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" >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.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><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><br/><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 .= '
<form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml">
<input type="hidden" name="email_cobranca" value="'. $config['pagseguro']['email']. '">
<input type="hidden" name="tipo" value="CP">
<input type="hidden" name="moeda" value="BRL">[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]<input type="hidden" name="item_id_1" value="1">
<input type="hidden" name="item_descr_1" value="' . $config['pagseguro']['produtoNome'] . '">[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]<input type="hidden" name="item_valor_1" value="'. $config['pagseguro']['produtoValor'] .'">
<input type="hidden" name="item_frete_1" value="0">
<input type="hidden" name="item_peso_1" value="0">
<input type="hidden" name="ref_transacao" value="'.$account_logged->getCustomField("name").'">
<table border="0" cellpadding="4" cellspacing="1" width="100%" id="#estilo"><tbody>
<tr bgcolor="#505050" class="white">
	<th colspan="2"><strong>Escolha a quantidade de pontos que deseja comprar</strong></th>
</tr>
<tr>
	<td width="10%">Sua conta</td>
	<td><strong>'.$account_logged->getCustomField("name").'</strong></td>
</tr>
<tr>
	<td width="10%">Pontos</td>
	<td>
	<input name="item_quant_1" type="text" value="1" size="5" maxlength="5">
	</td>
	</tr>
<tr>
	<td colspan="2">
		<input type="image" src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/carrinhoproprio/btnFinalizar.jpg" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" />
	</td>
	</tr>
</tbody></table></form><p style="text-align: right; font-size: 10px">created by <a href="http://otland.net/members/tatu+hunter/" target="_blank">tatu hunter</a></p>'; } ?>

 

htdocs crie um arquivo com o nome de retpagseguro.php

 

retpagseguro.php

[code]
<?php
include('config-and-functions.php');
// Aqui vai seu Token
define('TOKEN', $config['pagseguro']['token']);
// Incluindo o arquivo da biblioteca
include('retorno.php');
// Função que captura os dados do retorno
function retorno_automatico ( $VendedorEmail, $TransacaoID, $Referencia, $TipoFrete, $ValorFrete, $Anotacao, $DataTransacao, $TipoPagamento, $StatusTransacao, $CliNome, $CliEmail, $CliEndereco, $CliNumero, $CliComplemento, $CliBairro, $CliCidade, $CliEstado, $CliCEP, $CliTelefone, $produtos, $NumItens) {
global $config;
if(strtolower($StatusTransacao) == 'aprovado') {
	$account_logged = $ots->createObject('Account');
	$account_logged->find($Referencia);
	if($account_logged->isLoaded()) {
		$pontos = $account_logged->getCustomField("premium_points");
		$account_logged->setCustomField("premium_points", $pontos + $produtos[0]['ProdQuantidade']);
		$nome = $Referencia.'-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt';
		if(file_exists('logsPagseguro/'.$nome))
			$nome = $Referencia.'-2-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt';
		$arquivo = fopen('logsPagseguro/'.$nome, "w+");
		$dados = "Conta: ".$Referencia."\n";
		$dados = "Email: ".$CliEmail."\n";
		$dados .= "Total de Points: ".$produtos[0]['ProdQuantidade']."\n";
		$dados .= "Hora da Transação: ". date('d-m-Y H:i:s', $_SERVER['REQUEST_TIME'])."";
		fwrite($arquivo, $dados);
		fclose($arquivo);
	}
}
}
// A partir daqui, é só HTML:
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title></title>
</head>
<body>
 <h1>Pedido em processamento</h1>
 <p>Recebemos seu pedido e estamos aguardando pela
 confirmação do pagamento. Obrigado por comprar conosco.</p>
</body>
</html>

 

va em config.php e adicione isso como voce ve ali tem o e-mail e token coloque seu e-mail do pagseguro e a token que sera gerada la.

 

// Sistema automatico Pagseguro by tatu_hunter
// Seu email cadastrado no pagseguro
$config['pagseguro']['email'] = 'contato@tornadox.com.br';[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]// Nome do Produto
$config['pagseguro']['produtoNome'] = 'Pontos VIP';[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]// Valor unitario do produto ou seja valor de cada ponto
// Exemplo de valores
// 100 = R$ 1,00
// 235 = R$ 2,35
// 4254 = R$ 42,54
$config['pagseguro']['produtoValor'] = '100'; [/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]// Token gerado no painel do pagseguro
$config['pagseguro']['token'] = 'EFEB3B4CA8914CB3963C3695A6947965';

 

buypoints.php

<?php
if(!$logged)
if($action == "logout")
$main_content .= '
edge.gif);" />
Logout Successful
You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to log in again.
';
else
$main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><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><br/><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 .= '
<form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml">
<input type="hidden" name="email_cobranca" value="'. $config['pagseguro']['email']. '">
<input type="hidden" name="tipo" value="CP">
<input type="hidden" name="moeda" value="BRL">[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]<input type="hidden" name="item_id_1" value="1">
<input type="hidden" name="item_descr_1" value="Pontos na account de nome: '.$account_logged->getCustomField("name").'">[/color][/size][/font]
[font="Verdana, Arial, Tahoma, Calibri, Geneva, sans-serif"][size="2"][color="#333333"]<input type="hidden" name="item_valor_1" value="'. $config['pagseguro']['produtoValor'] .'">
<input type="hidden" name="item_frete_1" value="0">
<input type="hidden" name="item_peso_1" value="0">
<input type="hidden" name="ref_transacao" value="'.$account_logged->getCustomField("name").'">
<table border="0" cellpadding="4" cellspacing="1" width="100%" id="#estilo"><tbody>
<tr bgcolor="#505050" class="white">
<th colspan="2"><strong>Escolha a quantidade de pontos que deseja comprar</strong></th>
</tr>
<tr>
<td width="10%">Sua conta</td>
<td><strong>'.$account_logged->getCustomField("name").'</strong></td>
</tr>
<tr>
<td width="10%">Pontos</td>
<td>
<input name="item_quant_1" type="text" value="1" size="5" maxlength="5">
</td>
</tr>
<tr>
<td colspan="2">
<input type="image" src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/carrinhoproprio/btnFinalizar.jpg" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" />
</td>
</tr>
</tbody></table></form>'; } ?>

 

cria essa tabela no phpmuadmin no na tua tabela sql claro..

 

table

CREATE TABLE `retorno_automatico` (
`TransacaoID` varchar(36) NOT NULL,
`VendedorEmail` varchar(200) NOT NULL,
`Referencia` varchar(200) default NULL,
`TipoFrete` char(2) default NULL,
`ValorFrete` decimal(10,2) default NULL,
`Extras` decimal(10,2) default NULL,
`Anotacao` text,
`TipoPagamento` varchar(50) NOT NULL,
`StatusTransacao` varchar(50) NOT NULL,
`CliNome` varchar(200) NOT NULL,
`CliEmail` varchar(200) NOT NULL,
`CliEndereco` varchar(200) NOT NULL,
`CliNumero` varchar(10) default NULL,
`CliComplemento` varchar(100) default NULL,
`CliBairro` varchar(100) NOT NULL,
`CliCidade` varchar(100) NOT NULL,
`CliEstado` char(2) NOT NULL,
`CliCEP` varchar(9) NOT NULL,
`CliTelefone` varchar(14) default NULL,
`NumItens` int(11) NOT NULL,
`Data` datetime NOT NULL,
`status` tinyint(1) unsigned NOT NULL default '0',
UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`),
KEY `Referencia` (`Referencia`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

apos ter feito isso va no site www.pagseguro.com e crie uma conta , la voce vai entender , vai estar endereco de retorno , gerar token bem facil faca e veja. abraco!

 

Rep + ?

 

Opa, mas aqui está falando em retpagseguro

 

// Incluindo o arquivo da biblioteca

include('retorno.php');

 

E então, precisa adiciona a algum lugar?

Link para o comentário
Compartilhar em outros sites

retpagseguro.php ja esta acima amigao leia certinhu.

 

Sim já tem,

mas no arquivo do retpagseguro.

Tem essa linha.

 

// Incluindo o arquivo da biblioteca

include('retorno.php');

 

Precisa de um arquivo chamado retorno.php?

Se sim o que precisa está lá dentro?

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...