Java HSBC API支付网关

时间:2013-01-17 09:49:24

标签: java xml

我正在寻找一个Java HSBC API支付网关脚本。我在php中开发它但即将推出 到java howcan我这样做。下面是我使用的PHP代码

$ch = curl_init();
$url = ‘https://www.secure-epayments.apixml.hsbc.com’;
 curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data_will_go_here);
ob_start();
$data = curl_exec($ch);
curl_close ($ch);
ob_end_clean();

1 个答案:

答案 0 :(得分:0)

看一下HTTPConnection类,这可能会有所帮助!

http://docs.oracle.com/javase/1.5.0/docs/api/java/net/HttpURLConnection.html