Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Route::post('/', function()
- {
- // CONFIG: Enable debug mode. This means we'll log requests into 'ipn.log' in the same directory.
- // Especially useful if you encounter network errors or other intermittent problems with IPN (validation).
- // Set this to 0 once you go live or don't require logging.
- define("DEBUG", 1);...
- curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
- curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
- if(DEBUG == true) {
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
- }
- // CONFIG: Optional proxy configuration
- //curl_setopt($ch, CURLOPT_PROXY, $proxy);
- //curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
- // Set TCP timeout to 30 seconds
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
- // CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
- // of the certificate as shown below. Ensure the file is readable by the webserver.
- // This is mandatory for some environments.
- $cert = __DIR__ . "./cacert.pem";
- curl_setopt($ch, CURLOPT_CAINFO, $cert);
- $res = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement