<%@ Language=VBScript %>
<%
'requires Microsoft XML Parser
http://msdn.microsoft.com/xml Dim objHttp 'object used for posting form data to nochex
Dim nochexformdata 'variable used to store form data sent from NOCHEX
Dim NochexResponse 'stores the response from the NOCHEX server
nochexformdata = Request.Form 'copy the form data from NOCHEX into the variable
set objHttp = Server.CreateObject("MSXML2.XMLHTTP") 'create an instance of the XML object library
objHttp.open "POST", "https://www.nochex.com/nochex.dll/apc/apc", false 'set the page to post the form data to the NOCHEX server
objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHttp.Send nochexformdata 'send the form data received from NOCHEX to the NOCHEX server
' Check notification validation
if (objHttp.status = 200 ) then
if (objHttp.responseText = "AUTHORISED") then
NochexResponse = "AUTHORISED"
'check the transaction_id to make sure it is not a duplicate
'process transaction
elseif (objHttp.responseText = "DECLINED") then
NochexResponse = "DECLINED"
'log and investigate incorrect data
end if
else
NochexResponse = "NO RESPONSE "
end if
%>
Add New Comment