我正在向虚拟商家付款网发送信息,以便使用曲线付款。 这是我的法典:
$Url= "https://www.myvirtualmerchant.com/VirtualMerchant/process.do";
// is cURL installed yet?
if (!function_exists( curl_init )){
die( Sorry cURL is not installed! );
}
// OK cool - then let s create a new cURL resource handle
$ch = curl_init();
// Now set some options (most are optional)
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $Url);
// Include header in result? (0 = yes, 1 = no)
// curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$fields = array(
ssl_card_number =>urlencode($_POST[ ssl_card_number ]),
ssl_exp_date =>urlencode($_POST[ ssl_exp_date ]),
ssl_cvv2cvc2 =>urlencode($_POST[ ssl_cvv2cvc2 ]),
ssl_avs_address =>urlencode($_POST[ ssl_avs_address ]),
ssl_avs_zip =>urlencode($_POST[ ssl_avs_zip ]),
ssl_merchant_id =>urlencode($_POST[ ssl_merchant_id ]),
ssl_user_id =>urlencode($_POST[ ssl_user_id ]),
ssl_pin =>urlencode($_POST[ ssl_pin ]),
ssl_transaction_type =>urlencode($_POST[ ssl_transaction_type ]),
ssl_amount =>urlencode($_POST[ ssl_amount ]),
ssl_show_form =>urlencode($_POST[ ssl_show_form ]),
TransactionType =>urlencode($_POST[ TransactionType ])
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string .= $key. = .$value. & ; }
rtrim($fields_string, & );
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
// Download the given URL, and return output
echo $output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
print_r($output);
But in $output i am getting nothing, not any error or message. Am i doing it wrong ? please tell me ?