Hi all,
I am using ASP for a while but never really had to use xml nore use the serverxmlhttp (component?)
I have a final checkoutpage that sends you to a payment gateway with variables taken from the form on that page ie. merchant=xxx&... This page also stores the order and orderdetails to a database.
As i understand some of the variables, that are to be send to the gateway by submitting the form, first have to be retrieved (in the background) from this payment gateway by this final checkoutpage by using serverxmlhttp (GET) to register a new payment in the gateway and make it create an xmlfile from which i then have to retrieve and parse the values and bind them to the appropiate hidden fields in the form
So now my questions are:
1. How do i use serverxmlhttp to send required variables to other webserver which then generates an xml-file... The values in this xml file need to be retrieved and parsed(?) by the same page which uses the serverxmlhttp.
2. I need it to be synchronous is this (see below for code) set right for that? Set False to true?
3. some of the variables in the url are also going to be dynamic or retrieved from previous form... How do i use them in the urlstring the right way? In the way used below it uses signs that break up the string i think?
4. How do I get the final checkout page to retrieve these values from the xml file on the remote server and then bind them to their respective hidden fields in a form (binding process/method to use and how to use syntax for formvalues) so I can then send the client to the gateway sending along the required variables in the urlstring.
Below the method I think to understand is the major part of what i need to get this process going. I found this on this site.
I am new to these regions and feel I do not give you much to work with... I hope someone out there can help me on my way understanding how to implement this because after a week of googling and trying to find the way to get this done (serverxmlhttp) this is as far as i got... I understand the principles of the idea and like it but the using it part is still very blurry...
Anyway thnx for any repsonses to my post...
With kind regards,
Bobby V
<%
Response.Buffer = True
Dim objH, tmpStr
on error resume next
' Create an xmlhttp object:
Set objH = Server.CreateObject("Msxml
2.ServerXM
LHTTP")
if err then
response.write err.number & " " & err.description & " " & err.source & "<br>" & vbLF
end if
if err then
response.write err.number & " " & err.description & " " & err.source & "<br>" & vbLF
end if
' Opens the connection to the remote server.
objH.Open "GET", "
https://test.gateway.com/ps/com.gateway.paymentservice.servlets.PaymentService?merchant=xxx&merchant_password=xxx&merchant_trans_id=<%=
Request.Fo
rm("TransI
D")%>&..."
, False
if err then
response.write err.number & " " & err.description & " " & err.source & "<br>" & vbLF
end if
' Actually Sends the request and returns the data:
objH.Send
if err then
response.write err.number & " " & err.description & " " & err.source & "<br>" & vbLF
end if
' The data from the web page is now in objH.responseText.
tmpStr = objH.responseText
if err then
response.write err.number & " " & err.description & " " & err.source & "<br>" & vbLF
end if
response.write tmpStr
%>
Start Free Trial