汇聚-虚拟商人- PHP集成问题


Converge - Virtual Merchant - PHP Integration Issues

我正在为我的网站使用converge's的虚拟商家支付集成(使用PHP)。

通过设置ssl_show_form = true,我正在集成在我的网站(在此页面www.example.com/payment_form)上显示收敛表单的方法

收敛形式显示在我的网站如预期。但是我无法提交表单值。自表单动作请求过程。做文件在我的网站(www.example.com/process.do),表单值不发送收敛。

我已经使用演示url测试事务。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 (Page 454)

在我的代码片段中使用了下面的代码。

echo "<html><head><base href='" . $url . "'></base></head>";

现在开始工作了。

谢谢。