我在PHP中有一个Visa Payment Gateway示例:
$authString = $userId.":".$password;
$authStringBytes = utf8_encode($authString);
$authloginString = base64_encode($authStringBytes);
$authHeader = "Authorization:Basic ".$authloginString;
echo "<strong>URL:</strong><br>".$url. "<br><br>";
$header = (array("Accept: application/json", "Content-Type: application/json", $authHeader));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestBodyString);
curl_setopt($ch, CURLOPT_SSLCERT, $certificatePath);
curl_setopt($ch, CURLOPT_SSLKEY, $privateKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
我正在尝试将PHP代码转换为ColdFusion。如何通过CURLOPT_SSLKEY
传递cfhttpparam
选项?到目前为止,这是我的代码:
<cfhttp method="get" url="https://sandbox.api.visa.com/vdp/helloworld"
clientcert="C:\ColdFusion10\cfusion\wwwroot\visa\myapp_keyAndCertBundle.p12"
clientcertpassword="theCertPassword"
result="res">
<cfhttpparam type="header" name="Accept" value="application/json">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="body" value="Authorization:Basic#authloginString#">
</cfhttp>