我正在尝试通过 curl 调用设置虚拟商家。
$url = 'https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do';
$request = curl_init($url); // initiate curl object
curl_setopt($request, CURLOPT_POST, 1);
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($request, CURLOPT_POSTFIELDS, $fields_string); // use HTTP POST to send form data
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
curl_setopt($request, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($request, CURLOPT_FOLLOWLOCATION, 1);
$post_response = curl_exec($request); // execute curl post and store results in $post_response
curl_close ($request); // close curl object
print_r($post_response);die();
字段设置正确。
当我执行此代码时,它首先将我重定向到空白页面,然后刷新,但刷新后我请求了以下参数:perfect-process-status.php?ssl_email=&ssl_status=TEST+MODE&ssl_cvv2_response=P&... 等等...
var_dump 结果(重定向前)
字符串(1504)“”