Ir para conteúdo
  • 0

Promoção double points


DouglasSalaza11

Pergunta

Aqui está o retpagseguro , onde eu modificaria pra duplicar a quantidade comprada pelo jogador?

Por acaso é aqui : $account_logged->setCustomField("premium_points", $pontos + $produtos[0]['ProdQuantidade']); e poe em ['prodquantidade*2]?

<?php

include('config-and-functions.php');

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...l1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title></title>

</head>

<body>

Link para o comentário
Compartilhar em outros sites

8 respostass a esta questão

Posts Recomendados

  • 0

<?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 .= '<br><br><b>Valores:</b><br>
1 Point = R$ 1,00<br>
10 Points = R$ 10,00<br>
20 Points = R$ 20,00<br>
E assim por diante...<p>
';

$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">

<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").'">

<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="10" 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>
<b><span style="color:#ff0000;">OBS:</span></b> Os pontos sao entregues <b>automaticamente</b> logo apos a <u>aprovacao</u> do seu pagamento pelo PagSeguro, ou seja, pagou e foi aprovado pontos depositados.
<?php } ?>'; } ?>

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

  • 0
[color=#282828][font=helvetica, arial, sans-serif]<?php[/font][/color]


[color=#282828][font=helvetica, arial, sans-serif]if(!$logged)[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]if($action == "logout")[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]$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>';[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]else[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]$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>';[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]else[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]{[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]$main_content .= '<br><br><b>Valores:</b><br>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]1 Point = R$ 1,00<br>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]10 Points = R$ 10,00<br>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]20 Points = R$ 20,00<br>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]E assim por diante...<p>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]';[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]$main_content .= '[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="email_cobranca" value="'. $config['pagseguro']['email']. '">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="tipo" value="CP">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="moeda" value="BRL">[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="item_id_1" value="1">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="item_descr_1" value="Pontos na account de nome: '.$account_logged->getCustomField("name").'">[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="item_valor_1" value="'. $config['pagseguro']['produtoValor'] .'">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="item_frete_1" value="0">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="item_peso_1" value="0">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input type="hidden" name="ref_transacao" value="'.$account_logged->getCustomField("name").'">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<table border="0" cellpadding="4" cellspacing="1" width="100%" id="#estilo"><tbody>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<tr bgcolor="#505050" class="white">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<th colspan="2"><strong>Escolha a quantidade de pontos que deseja comprar</strong></th>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<td width="10%">Sua conta</td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<td><strong>'.$account_logged->getCustomField("name").'</strong></td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<td width="10%">Pontos</td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<input name="item_quant_1" type="text" value="10" size="5" maxlength="5">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<td colspan="2">[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<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!" />[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</td>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</tr>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]</tbody></table></form>[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<b><span style="color:#ff0000;">OBS:</span></b> Os pontos sao entregues <b>automaticamente</b> logo apos a <u>aprovacao</u> do seu pagamento pelo PagSeguro, ou seja, pagou e foi aprovado pontos depositados.[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]<?php } ?>'; } ?>[/font][/color]

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

×
×
  • Criar Novo...