Converge - Virtual Merchant - PHP集成问题
我正在为我的网站使用converge的虚拟商户支付集成(使用PHP)。Converge - Virtual Merchant - PHP集成问题
我整合设置ssl_show_form显示在我的网站的汇聚形式(本页www.example.com/payment_form)的方法=真正
的收敛形式显示在我的网站如预期。但我无法提交表单值。由于我的网站(www.example.com/process.do)中的表单操作请求process.do文件,表单值不会发送到收敛。
我已经使用演示网址进行测试交易。 https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do
这里是我的代码
<?php //extract data from the post
extract($_POST);
//set POST variables
//$url = 'https://www.myvirtualmerchant.com/VirtualMerchant/process.do';
$url = 'https://demo.myvirtualmerchant.com/VirtualMerchantDemo/process.do';
//Modify the values from xxx to your own account ID, user ID, and PIN
//Additional fields can be added as necessary to support custom fields
//or required fields configured in the Virtual Merchant terminal
$fields = array(
'ssl_merchant_id'=>'xxxxx',
//VirtualMerchant Developer's Guide.docx Page 138 of 152
'ssl_user_id'=>'xxxxx',
'ssl_pin'=>'xxxxx',
'ssl_show_form'=>'true',
'ssl_result_format'=>'html',
'ssl_test_mode'=>'true',
//'ssl_receipt_apprvl_method'=>'redg',
//modify the value below from xxx to the location of your error script
//ssl_error_url?=>?xxx?,
//modify the value below from xxx to the location of your receipt script
//'ssl_receipt_apprvl_get_url'=>'xxx',
'ssl_transaction_type'=>urlencode('ccsale'),
//'ssl_amount'=>urlencode($ssl_amount),
//'ssl_card_number'=>urlencode($ssl_card_number),
//'ssl_exp_date'=>urlencode($ssl_exp_date),
//'ssl_cvv2cvc2_indicator'=>urlencode($ssl_cvv2cvc2_indicator),
//'ssl_cvv2cvc2'=>urlencode($ssl_cvv2cvc2),
//'ssl_customer_code'=>urlencode($ssl_customer_code),
'ssl_amount'=>500,
);
//initialize the post string variable
$fields_string = '';
//build the post string
foreach($fields as $key=>$value) { $fields_string .=$key.'='.$value.'&'; }
rtrim($fields_string, "&");
//open curl session
$ch = curl_init();
//begin seting curl options
//set URL
curl_setopt($ch, CURLOPT_URL, $url);
//set method
curl_setopt($ch, CURLOPT_POST, 1);
//VirtualMerchant Developer's Guide.docx Page 139 of 152
//set post data string
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
//these two options are frequently necessary to avoid SSL errors with PHP
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
//perform the curl post and store the result
$result = curl_exec($ch);
//close the curl session
curl_close($ch);
//a nice message to prevent people from seeing a blank screen
echo "Processing";
?>
请帮助我。
谢谢。
回答:
Virtual Merchant的开发者指南中有一件事。
https://www.myvirtualmerchant.com/VirtualMerchant/download/developerGuide.pdf(页454)
我在片段中使用下面的代码。
echo "<html><head><base href='" . $url . "'></base></head>";
现在它的工作。
谢谢。
以上是 Converge - Virtual Merchant - PHP集成问题 的全部内容, 来源链接: utcz.com/qa/263470.html