Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. <script language="javascript">
  2. function mostrarValue(){
  3.  
  4. var selObj = document.getElementById('test');
  5. var selIndex = selObj.options[selObj.selectedIndex].value;
  6.  
  7. }
  8. </script>
  9. <p>Seleccione uno de los articulos</p>
  10. <label class="youplay-select">
  11. <select id="test" name="test">
  12. <option value="" selected>Seleccionar</option>
  13. <option value="1000">Articulo1</option>
  14. <option value="1001">Articulo2</option>
  15. <option value="1002">Articulo3</option>
  16.  
  17. </select>
  18. </label>
  19.  
  20.  
  21. <?php
  22. $cert_id = 'CERTIFICADOPAYPAL';
  23. include("Class.PayPalEWP.php");
  24. $paypal = new PayPalEWP();
  25. $paypal->setTempFileDirectory("tmp");
  26. $paypal->setCertificate("my-pubcert.pem", "my-prvkey.pem");
  27. $paypal->setPayPalCertificate("paypal_cert_pem.txt");
  28. $paypal->setCertificateID($cert_id);
  29.  
  30. $pp = array(
  31. 'cmd' => '_xclick',
  32. 'cert_id' => $cert_id,
  33. 'business' => 'xxxx@gmail.com',
  34. 'receiver_email' => 'xxxx@gmail.com',
  35. 'custom' => '1',
  36. 'item_name' => $_POST['test'],
  37. 'currency_code' => 'USD',
  38. 'amount' => '1',
  39. 'lc' => 'ES',
  40. 'no_note' => '1',
  41. 'no_shipping' => '1',
  42. //'return' => '',
  43. 'cancel_return' => '',
  44. //'notify_url' => '',
  45. 'cbt' => 'Volver al sitio web',
  46.  
  47.  
  48. );
  49.  
  50. ?>
  51.  
  52.  
  53. <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="pay_pal_form" method="POST" name= "form1" onclick="mostrarValue();">
  54.  
  55. <input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="cmd" value="_s-xclick">
  56. <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----<?php echo $paypal->encryptButton($pp); ?>-----END PKCS7-----"/>
  57.  
  58. <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.">
  59. <img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" width="1" height="1"></p></div>
  60. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement