Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. Route::post('/', function()
  2. {
  3. // CONFIG: Enable debug mode. This means we'll log requests into 'ipn.log' in the same directory.
  4. // Especially useful if you encounter network errors or other intermittent problems with IPN (validation).
  5. // Set this to 0 once you go live or don't require logging.
  6. define("DEBUG", 1);...
  7.  
  8. curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  9. curl_setopt($ch, CURLOPT_POST, 1);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
  11. curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  13. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
  14. curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
  15.  
  16. if(DEBUG == true) {
  17. curl_setopt($ch, CURLOPT_HEADER, 1);
  18. curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
  19. }
  20.  
  21. // CONFIG: Optional proxy configuration
  22. //curl_setopt($ch, CURLOPT_PROXY, $proxy);
  23. //curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
  24.  
  25. // Set TCP timeout to 30 seconds
  26. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  27. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
  28.  
  29. // CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
  30. // of the certificate as shown below. Ensure the file is readable by the webserver.
  31. // This is mandatory for some environments.
  32.  
  33. $cert = __DIR__ . "./cacert.pem";
  34. curl_setopt($ch, CURLOPT_CAINFO, $cert);
  35.  
  36. $res = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement