Last active
August 29, 2015 14:03
-
-
Save lucasff/ff5ea5742d2a42550c04 to your computer and use it in GitHub Desktop.
Teste POST PagSeguro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); | |
| header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past | |
| header('Pragma: no-cache'); | |
| if (count($_POST) > 0 && !isset($_POST['action'])) { | |
| die( "VERIFICADO" ); | |
| } | |
| if (count($_POST) > 0 && $_POST['action'] == 'pagseguro-v1') | |
| { | |
| $url = $_POST['url']; | |
| unset($_POST['action']); | |
| unset($_POST['url']); | |
| $ch = curl_init($url); | |
| curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER , true); | |
| curl_setopt($ch, CURLOPT_POST, true); | |
| curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); | |
| $result = curl_exec($ch); | |
| curl_close($ch); | |
| var_dump($result); | |
| die; | |
| } | |
| ?> | |
| <!DOCTYPE html> | |
| <html lang="pt-br"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="author" content="NEO Solutions"> | |
| <!-- Le styles --> | |
| <link href="//getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet"> | |
| <link href="//getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet"> | |
| <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> | |
| <!--[if lt IE 9]> | |
| <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
| <![endif]--> | |
| <script src="//code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> | |
| <script src="//getbootstrap.com/2.3.2/assets/js/bootstrap.min.js" type="text/javascript"></script> | |
| <style type="text/css"> | |
| body > .container { | |
| margin-top: 20px; | |
| } | |
| </style> | |
| <title>Teste PagSeguro - NEO Solutions</title> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="row"> | |
| <div class="span12 well"> | |
| <button type="button" class="btn btn-info" data-target="#pagseguro-v1" data-toggle="collapse">PagSeguro v1</button> | |
| <button type="button" class="btn btn-info" data-target="#pagseguro-notify" data-toggle="collapse">Notificação PagSeguro</button> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="span6"> | |
| <div id="pagseguro-v1" class="collapse out"> | |
| <div class="well"> | |
| <form action="" method="post" class="form-horizontal"> | |
| <fieldset> | |
| <div class="control-group"> | |
| <label class="control-label">URL</label> | |
| <div class="controls"> | |
| <input type="text" name="url" value="http://dev.agencianeo.com/neo-save/pagseguro/retorno.php" /> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">VendedorEmail</label> | |
| <div class="controls"> | |
| <input type="text" name="VendedorEmail" value="<?php echo isset( $_POST['VendedorEmail'] ) ? : 'lucas@lucasfreitas.com.br'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">TransacaoID</label> | |
| <div class="controls"> | |
| <input type="text" name="TransacaoID" value="<?php echo isset( $_POST['TransacaoID'] ) ? : 'transid'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">Referencia</label> | |
| <div class="controls"> | |
| <input type="text" name="Referencia" value="<?php echo isset( $_POST['Referencia'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">Extras</label> | |
| <div class="controls"> | |
| <input type="text" name="Extras" value="<?php echo isset( $_POST['Referencia'] ) ? : '0,00'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">TipoFrete</label> | |
| <div class="controls"> | |
| <input type="text" name="TipoFrete" value="<?php echo isset( $_POST['Referencia'] ) ? : 'FR'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ValorFrete</label> | |
| <div class="controls"> | |
| <input type="text" name="ValorFrete" value="<?php echo isset( $_POST['Referencia'] ) ? : '0,00'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">Anotacao</label> | |
| <div class="controls"> | |
| <input type="text" name="Anotacao" value="<?php echo isset( $_POST['Referencia'] ) ? : 'Pagamento gerado pelo ambiente de testes'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">DataTransacao</label> | |
| <div class="controls"> | |
| <input type="text" name="DataTransacao" value="<?php echo isset( $_POST['DataTransacao'] ) ? : date('d/m/Y H:m:s'); ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">TipoPagamento</label> | |
| <div class="controls"> | |
| <input type="text" name="TipoPagamento" value="<?php echo isset( $_POST['TipoPagamento'] ) ? : 'Cartao de Crédito'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliNome</label> | |
| <div class="controls"> | |
| <input type="text" name="CliNome" value="Nome da Silva"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">Status da Transação</label> | |
| <div class="controls"> | |
| <select name="StatusTransacao"> | |
| <option value="Completo">Completo</option> | |
| <option value="Aguardando Pagto">Aguardando</option> | |
| <option value="Aprovado">Aprovado</option> | |
| <option value="Em Análise">Em Análise</option> | |
| <option value="Cancelado">Cancelado</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliEmail</label> | |
| <div class="controls"> | |
| <input type="text" name="CliEmail" value="<?php echo isset( $_POST['CliEmail'] ) ? : 'lucas_reborn@hotmail.com'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliEndereco</label> | |
| <div class="controls"> | |
| <input type="text" name="CliEndereco" value="<?php echo isset( $_POST['CliEndereco'] ) ? : 'Av. dos Bobos'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliNumero</label> | |
| <div class="controls"> | |
| <input type="text" name="CliNumero" value="<?php echo isset( $_POST['CliNumero'] ) ? : '0'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliComplemento</label> | |
| <div class="controls"> | |
| <input type="text" name="CliComplemento" value="<?php echo isset( $_POST['CliComplemento'] ) ? : 'Ap 01'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliBairro</label> | |
| <div class="controls"> | |
| <input type="text" name="CliBairro" value="<?php echo isset( $_POST['CliBairro'] ) ? : 'Payland'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliCidade</label> | |
| <div class="controls"> | |
| <input type="text" name="CliCidade" value="<?php echo isset( $_POST['CliCidade'] ) ? : 'Paytown'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliEstado</label> | |
| <div class="controls"> | |
| <input type="text" name="CliEstado" value="<?php echo isset( $_POST['CliEstado'] ) ? : 'AC'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliCEP</label> | |
| <div class="controls"> | |
| <input type="text" name="CliCEP" value="<?php echo isset( $_POST['CliCEP'] ) ? : '90000000'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">CliTelefone</label> | |
| <div class="controls"> | |
| <input type="text" name="CliTelefone" value="<?php echo isset( $_POST['CliTelefone'] ) ? : '51 30857272'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">NumItens</label> | |
| <div class="controls"> | |
| <input type="text" name="NumItens" value="<?php echo isset( $_POST['NumItens'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">Parcelas</label> | |
| <div class="controls"> | |
| <input type="text" name="Parcelas" value="<?php echo isset( $_POST['Parcelas'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdID_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdID_1" value="<?php echo isset( $_POST['ProdID_1'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdDescricao_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdDescricao_1" value="<?php echo isset( $_POST['ProdDescricao_1'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdQuantidade_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdQuantidade_1" value="<?php echo isset( $_POST['ProdQuantidade_1'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdFrete_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdFrete_1" value="0,00"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdExtras_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdExtras_1" value="0,00"/> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <label class="control-label">ProdValor_1</label> | |
| <div class="controls"> | |
| <input type="text" name="ProdValor_1" value="<?php echo isset( $_POST['ProdValor_1'] ) ? : '1'; ?>"/> | |
| </div> | |
| </div> | |
| <div class="form-actions"> | |
| <input type="hidden" name="action" value="pagseguro-v1"/> | |
| <input type="submit" class="btn btn-primary"/> | |
| </div> | |
| </fieldset> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="span6"> | |
| <div id="pagseguro-notify" class="collapse out"> | |
| <div class="well"> | |
| <form action="" method="post" enctype="application/x-www-form-urlencoded"> | |
| <div class="control-group"> | |
| <div class="controls"> | |
| <input type="text" name="url" placeholder="http://" value="http://"> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <div class="controls"> | |
| <input type="text" name="notificationType" placeholder="transaction" value="transaction" readonly> | |
| </div> | |
| </div> | |
| <div class="control-group"> | |
| <div class="controls"> | |
| <input type="text" name="notificationCode" placeholder="notificationCode"> | |
| </div> | |
| </div> | |
| <div class="form-actions"> | |
| <input type="hidden" name="action" value="notify"/> | |
| <input type="submit" class="btn btn-primary"/> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment