我正在嘗試驗證paypal pdt信息。CURL請求問題
我生成了我的模型表單並提交了它。 IT工作並返回了信息。
我試着做同樣的事情使捲曲請求。但是我的請求對我來說是空白的。
我樣機形式:
<form method="post" action="https://sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_notify-synch"/>
<input type="hidden" name="at" value="-----"/>
<input type="hidden" name="tx" value="-----"/>
<input type="submit" value="Test"/>
</form>
我捲曲REQ代碼:
$arrData = array(
'tx' => '----',
'cmd' => '_notify-synch',
'at' => '-----'
);
$ch = curl_init('https://sandbox.paypal.com/cgi-bin/webscr');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1) ;
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $arrData);
$strCurlResult = curl_exec($ch);
curl_close($ch);
return $strCurlResult;
編輯:
ON跟蹤捲曲的錯誤,我發現以下消息:
SSL:證書主題名稱'www.sandbox.paypal.com'不匹配 目標主機名「sandbox.paypal.com」
possible dupe:http://stackoverflow.com/questions/1776827/php-curl-paypal-sandbox –
KoolKabin;如果我們對解決方案有所貢獻,請更新此問題。 – Robert