Hi, all
I try to integrate secpay now, again after HSBC is so much hassle.
Now as aspx pages only post to them self, I made a little function.
Public Function sendToSecpay()
Dim secSting As String = ""
How to build my string?
Dim encoding As New ASCIIEncoding()
Dim postData As String = secSting
Dim data As Byte() = encoding.GetBytes(postData)
' web request...
Dim myRequest As Net.HttpWebRequest = DirectCast(Net.HttpWebRequest.Create("https://www.secpay.com/java-bin/ValCard"), Net.HttpWebRequest)
myRequest.Method = "POST"
myRequest.ContentType = "application/x-www-form-urlencoded"
myRequest.ContentLength = data.Length
Dim newStream As IO.Stream = myRequest.GetRequestStream()
' Send the data.
newStream.Write(data, 0, data.Length)
newStream.Close()
End Function
now in my old asp code I used;
response.write "<form name='to_secpay' action='https://www.secpay.com/java-bin/ValCard' method='post'>"
response.Write "<input type=""hidden"" name=""options"" value=""mail_merchants=stickers@simplystuck.com""> "
response.Write "<input type=""hidden"" name=""order"" value=""" & strSecPayOrder & """>"
response.Write "<input type=""hidden"" name=""billing"" value=""bill_name=" & request("bill_name") & ",bill_addr_1=" & request("bill_addr_1") & ", " & request("bill_addr_2") & ",bill_city=" & request("bill_city") & ",bill_state=" & request("bill_state") & ",bill_post_code=" & uCase(request("bill_post_code")) & ",bill_country=" & left(request("bill_country"),2) & ",bill_phone=" & request("bill_phone") & ",bill_email=" & request("bill_email") & """>"
response.Write "<input type=""hidden"" name=""merchant"" value=""secpay"">"
Now how do I form my secpay string?
Do I build the string like;
secSting = secSting & name="merchant" & value="secpay" secSting = secSting & name="options" & value= mail_merchants=stickers@simplystuck.com"
Secpay only shows stone old code on there site.
Any pointers?
Mike



Reply With Quote
Bookmarks