【发布时间】:2010-11-11 11:43:42
【问题描述】:
我正在使用支付网关处理信用卡。要将数据发布到他们的服务器,我在 PHP 中使用 cURL。我有一个颁发给我的域的 SSL 证书,以确保所有 POST 的数据都被加密。因为 SSL 证书已经安装,我还需要为 cURL 使用 SSL 选项吗?如果是这样,根据我的设置,我需要设置哪些选项?
我尝试了以下代码失败:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://secure.paymentgateway.com/blah.php");
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_CAINFO, getcwd().'/cert/ca.crt');
curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/cert/mycert.pem');
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, 'password');
curl_setopt($ch, CURLOPT_POST, $count);
curl_setopt($ch,CURLOPT_POSTFIELDS,"variables...");
$output = curl_exec($ch);
echo $output;
curl_close($ch);
【问题讨论】:
-
我只是好奇,你能指定它是哪个支付网关吗?
-
payscape 是支付网关
标签: php curl payment-gateway credit-card