PHP CURL HTTPS Worldpay VeriSign root certificate

test_https_curl($Field, "https://select.worldpay.com/wcc/itransaction", true);
function test_https_curl($Field, $Url) {
    // Start CURL session
    $ch = curl_init($Url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $Field); // set the fields to post
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // make sure we get the response back
    curl_setopt($ch, CURLOPT_CAINFO, "c:/worldpay.pem"); //VeriSign root certificate
    $fileHandle = fopen("c:/error1.txt", "w+");
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    curl_setopt($ch, CURLOPT_STDERR, $fileHandle);

    $buffer = curl_exec($ch); // execute the post
    $details = explode("|", $buffer);

    if (curl_exec($ch) === false) {
        echo 'Curl error: ' . curl_error($ch);
    }
    curl_close($ch); // close our session
    print_r($details); // create an array of the response values

}

你可能感兴趣的:(C++,c,PHP,C#)