Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/05/2013, 07:44
alexperaza
 
Fecha de Ingreso: diciembre-2012
Mensajes: 178
Antigüedad: 11 años, 4 meses
Puntos: 2
Pregunta Error al capturar ID_USUARIO Boton paypal

Hola como estan... Por aqui molestando con mis novatadas pero ni modo
mi duda en este caso es la siguiente tengo un boton de paypal que implementare pero no logro definir el ID del usuario que haria la transaccion a ver si me ayudan a saber donde esta el error

Código PHP:
Ver original
  1. //AQUI HAGO UNA CONSULTA
  2.  
  3. <?php if (isset($_POST['id_anuncio'])){
  4.     $_POST['id_anuncio']= $_SESSION['id_principal'];
  5.     $id_principal=$_SESSION['id_principal'];
  6.    
  7.      mysql_select_db($database_clasi, $clasi);
  8.      $LoginRS__query=sprintf("SELECT id_principal FROM principal WHERE id_principal=%s",
  9.     GetSQLValueString($id_principal, "text"));
  10.  
  11. }
  12.     ?>
  13.  
  14. //
  15.  
  16.  
  17. <div class = "boton">
  18. <?php   if (isset($_SESSEION['id_principal'])){
  19. ?><?php  //Variable para guardar la ruta hacia la clase  Class.PayPalEWP.php
  20. $cert_id = 'xxxxx'; //Id del certificado
  21. include("Class.PayPalEWP.php"); //Ruta hacia la clase  
  22. $paypal = new PayPalEWP();
  23. $paypal->setTempFileDirectory("tmp"); // HAY que crear una carpeta tmp en el directorio de la clase
  24. $paypal->setCertificate("my-pubcert.pem", "my-prvkey.pem");
  25. $paypal->setPayPalCertificate("paypal_cert_pem.txt");
  26. $paypal->setCertificateID($cert_id);  
  27.  
  28. $boton1 = array(
  29.         'cmd' => '_xclick',
  30.         'cert_id' => $cert_id,
  31.         'business' => '[email protected]',                
  32.         'receiver_email' => '[email protected]',                
  33.         'custom' => $_SESSION['id_principal'],   //AQUI ME TIRA EL ERROR:id_principal indefinida  
  34.         'item_name' => 'servicio',          
  35.         'currency_code' => 'USD',                            
  36.         'amount' => '0.10',                                    
  37.         'lc' => 'ES',                                         //Idioma
  38.         'no_note' => '1',                                    
  39.         'no_shipping' => '1',                                  
  40.         'return' => 'http://return.php',                  
  41.         'cancel_return' => 'http://,      
  42.        'notify_url' => 'http:///ipn.php',                
  43.         'cbt' => 'Texto Voler a mi página',
  44.    
  45.    
  46.     );
  47.      
  48. ?>
  49.  
  50.   </form>
  51.   <form action="https://www.paypal.com/cgi-bin/webscr" method="POST" name= "form1">
  52.   <input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="cmd" value="_s-xclick">
  53.   <table width="296" border="1">
  54.     <tr>
  55.       <td>Inserte la clave de registro de su anuncio</td>
  56.       <td><input name="id_anuncio" id ="id_anuncio" type="text" ></td>
  57.     </tr>
  58.   </table>
  59.   <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----<?php echo $paypal->encryptButton($boton1); ?>-----END PKCS7-----"/>
  60.  
  61.   <input type="image" src="https://www.paypal.com/es_XC/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal, la forma más segura y rápida de pagar en línea.">
  62.   <img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" width="1" height="1"></p></div>
  63.  <?php }?>