Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. <?
  2. header('Content-Type: text/html; charset=utf-8');
  3. include ("TMySQL.php");
  4. //Abrindo conexao com o banco de dados
  5. $MySQL = new TMySQL();
  6. $MySQL->connect($host, $db, $user, $pass);
  7.  
  8.  
  9. $DATA = $_GET['DATA'];//8 Data da transação
  10. $NUMPEDIDO = $_GET['NUMPEDIDO']; //16 Número do Pedido
  11. $NR_CARTAO = $_GET['NR_CARTAO']; //16 Número do Cartão mascarado
  12. $ORIGEM_BIN = $_GET['ORIGEM_BIN']; //3 Código de Nacionalidade do Emissor
  13. $NUMAUTOR = $_GET['NUMAUTOR']; //6 Número de Autorização
  14. $NUMCV = $_GET['NUMCV']; //9 Número do Comprovante de Venda (NSU)
  15. $NUMAUTENT = $_GET['NUMAUTENT']; //27 Número de Autenticação
  16. $NUMSQN = $_GET['NUMSQN']; //12 Número seqüencial único
  17. $NUMPRG = $_GET['NUMPRG']; //1 Número correspondente ao programa de captura utilizado
  18.  
  19. ///CASO DE ERROS
  20. $CODRET = $_GET['CODRET']; //2 Código de erro
  21. $MSGRET = $_GET['MSGRET']; //200 Mensagem de erro
  22. if ( !isset($CODRET) ) {
  23. $consulta=$MySQL->query("select PRECO_TOTAL from pedidos_cliente where ID_PEDIDO_CLIENTE=$NUMPEDIDO");
  24. list($PRECO_TOTAL) = mysql_fetch_array($consulta);
  25. $url= "http://ecommerce.red.../confirma.asp?"
  26. ."DATA=$DATA&"
  27. ."TRANSACAO=203&"
  28. ."TRANSORIG=04&"
  29. ."PARCELAS=00&"
  30. ."FILIACAO=30355141&"
  31. ."DISTRIBUIDOR=&"
  32. // ."TOTAL=$PRECO_TOTAL";
  33. ."TOTAL=0.01&"
  34. ."NUMPEDIDO=$NUMPEDIDO&"
  35. ."NUMAUTOR=$NUMAUTOR&"
  36. ."NUMCV=$NUMCV&"
  37. ."NUMSQN=$NUMSQN&"
  38. ."ORIGEM_BIN=$ORIGEM_BIN&"
  39. ."NUMPRG=$NUMPRG";
  40.  
  41. //AQUI JA FOI ENVIADA A SEGUNDA FASE3 E AGORA ESTA RECEBENDO O CÓDIGO DE CONFIRMAÇÃO.
  42. //A função file irá enviar a url para a Redecard sem redirecionar(sair da NatureLavie) e, ao mesdo tempo, receber o rerorno da Redecdard
  43. $file = file($url);
  44. $retorna = $file[0];
  45. $arrLinhas = explode("&", $retorna);
  46. $i = 0;
  47. foreach ($arrLinhas AS $line) {
  48. list($variavel, $valor) = explode('=', ($line));
  49. $variavel = trim($variavel);
  50. $$variavel = $valor ;
  51. $i ++;
  52. print $variavel;
  53. print "<br>";
  54. print $valor;
  55. }
  56. $status = $_REQUEST['CODRET'];
  57. if ($status > 1) {
  58. $autent = $_REQUEST['MSGRET'];
  59. }
  60. else {
  61. $URLCupom = "https://ecommerce.re...upom.asp?DATA=" . $data . "&TRANSACAO=201&NUMAUTOR=" . $arp . "&NUMCV=" . $cv;
  62. ?>
  63.  
  64. <script LANGUAGE=javascript>
  65. <!--
  66. vpos=window.open('<? echo $URLCupom; ?>','vpos','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,copyhistory=no,width=280,height=440');
  67. //-->
  68. </SCRIPT>
  69. <? }
  70. }
  71. else if (
  72. $CODRET==50 or $CODRET==52 or $CODRET==54 or $CODRET==55 or $CODRET==57 or $CODRET==59 or $CODRET==61 or
  73. $CODRET==62 or $CODRET==64 or $CODRET==66 or $CODRET==67 or $CODRET==68 or $CODRET==70 or $CODRET==71 or
  74. $CODRET==73 or $CODRET==75 or $CODRET==78 or $CODRET==79 or $CODRET==80 or $CODRET==82 or $CODRET==83 or
  75. $CODRET==84 or $CODRET==85 or $CODRET==87 or $CODRET==89 or $CODRET==90 or $CODRET==91 or $CODRET==93 or
  76. $CODRET==94 or $CODRET==95 or $CODRET==97 or $CODRET==99
  77. )
  78. { print $MSGRET; exit; }
  79. else if ( $CODRET==51 or $CODRET==92 or $CODRET==98 ) { print $MSGRET; exit; }
  80. else if ( $CODRET==53 ) { print $MSGRET; exit; }
  81. else if ( $CODRET==76 or $CODRET==86 ) { print $MSGRET; exit; }
  82. else if ( $CODRET==58 or $CODRET==63 or $CODRET==65 or $CODRET==69 or $CODRET==72 or $CODRET==77 or $CODRET==96 )
  83. { print $MSGRET; exit; }
  84. else if ( $CODRET==56 or $CODRET==60 ) { print $MSGRET; exit; }
  85. else if ( $CODRET==74 ) { print $MSGRET; exit; }
  86. else if ( $CODRET==81 ) { print $MSGRET; exit; }
  87. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement