我正在嘗試將我的網站上的最終結帳與Secure Hosting (UPG) payment gateway進行整合。一切工作正常,除了我的嘗試從他們的Technical Integration Guide(請參閱第17-9頁)中受益於高級Secuitems安全系統。如何確保引薦來源網址是通過傳統ASP發佈的?
以下是給生成唯一的哈希PHP代碼:
$secuStringFields = "shreference=SH20XXXX&secuitems=".$secuitems."&secuphrase=yourphrase&transactionamount=".$transactionamount;
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "https://www.secure-server-hosting.com/secutran/create_secustring.php");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $secuStringFields);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_REFERER, "http://www.yourdomain.com/basket.php");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
$secuString = trim(curl_exec ($ch));
if($secuString == "") $secuString='Call to create_secustring Failed';
curl_close ($ch);
以下建議here爲它的等效利用經典ASP,這是我在這個編碼語言(我知道...遺留系統!):
Set objXMLHttp = CreateObject("Microsoft.XMLHTTP")
objXmlHttp.open "POST", "https://www.secure-server-hosting.com/secutran/create_secustring.php", False
objXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objXmlHttp.setRequestHeader "REFERER", "http://www.yourdomain.com/basket.asp"
objXmlHttp.send "shreference=SH20XXXX&secuitems="&secuitems&"secuphrase=yourphrase&transactionamount="&transactionamount
secuString = objXmlHttp.responseText
的問題是,我一直在剛開g Referral Check Failed
錯誤消息,根據上述技術指南的第19頁,表示「請求的引用者與客戶端控制面板中配置的URL不匹配」。我確定這兩個(發送推薦人和麪板中的推薦人)是相同的。
我也嘗試將RequestHeader
字符串設置爲X-Alt-Referer
,根據this answer,但無濟於事。
當聯繫UPG支持團隊時,他們幫助通知我「當您調用我們的系統時沒有收到引用者」,並且「我們無法協助您開發代碼因爲我們不是ASP開發人員,無法爲您提供足夠的答案「。
那麼,至少我知道問題是他們沒有收到引薦網址。所以,問題是:有誰知道爲什麼以及如何解決這個問題?還是有更好的方法來實現相同?
非常感謝和歉意(提前),如果我錯過了明顯的。