Hi all,
I am developing payment gateway application using vb.net with the help of asp.net, the thing is i done this application perfectly but i got some page redirecting issue, my payment flow should like this, (registerd user only can able to click payment button) that is user can click the payment button its sudently go to payment page ,in this i can pass the value through post method only.In this page user can able to submit their account details .once they submit the pay button, the page has been redirect to mypaysuccess.aspx through paysuccess.aspx were i mentioned in the code below. But my point is that page cannot be redirect to mypaysuccess.aspx which is redirecting to anothor page that is signin.aspx but it should i need to redirect mypaysuccess.aspx only .also the same user once again do the above flow with the same browser then its working fine the page has been redirect to mypaysuccess.aspx page.So this is my problem. please find out my application code which i declared in the mentioned payment page.please give me a drop of solution which is very helpful for me your thoughts...
payment button click page:
Protected Sub ibRegister_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibRegister.Click
Try
Dim result() As String = New String(5) {}
Dim objCls As clsCommon = New clsCommon()
Dim amount As String
amount = drpAmount.Text.Trim().Substring(1)
result = objCls.beforetrans(Session("user_name").ToString(), Session("user_id").ToString(), Session("user_email").ToString(), Convert.ToInt32(amount))
ttid = result(0)
ttkey = result(1)
Session.Add("user_amount", amount)
'Session.Add("user_ttid", ttid)
'Session.Add("user_ttkey", ttkey)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.Write("<html><head>")
HttpContext.Current.Response.Write(String.Format("</head><body onload=""document.form1.submit()"">"))
HttpContext.Current.Response.Write(String.Format("<form name=""form1"" method=""Post"" action=""https://payments.securetrading.net/process/payments/choice"">"))
HttpContext.Current.Response.Write(String.Format("<input name=""sitereference"" type=""hidden"" value=""test_payment2342"">"))
HttpContext.Current.Response.Write(String.Format("<input name=""currencyiso3a"" type=""hidden"" value=""GBP"">"))
HttpContext.Current.Response.Write(String.Format("<input name=""mainamount"" type=""hidden"" value=""" + amount + """>"))
HttpContext.Current.Response.Write(String.Format("<input name=""version"" type=""hidden"" value=""1"">"))
HttpContext.Current.Response.Write(String.Format("<input name=""orderreference"" type=""hidden"" value=""" + Session("user_id").ToString() + """>"))
HttpContext.Current.Response.Write(String.Format("<input name=""ttid"" type=""hidden"" value=""" + ttid + """>"))
HttpContext.Current.Response.Write(String.Format("<input name=""ttkey"" type=""hidden"" value=""" + ttkey + """>"))
HttpContext.Current.Response.Write("</form>")
HttpContext.Current.Response.Write("</body></html>")
HttpContext.Current.Response.End()
Catch ex As Exception
End Try
End Sub
paysuccess.aspx:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Try
Dim ttid As String = ""
Dim ttkey As String = ""
ttid = Request.QueryString("ttid").ToString()
ttkey = Request.QueryString("ttkey").ToString()
Dim objCls As clsCommon = New clsCommon()
objCls.cmstopup(ttid, ttkey)
Response.Redirect("mypaysuccess.aspx")
Catch ex As Exception
Response.Redirect("mypaysuccess.aspx")
End Try
End Sub
mypaysuccess.aspx:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
If Session("user_id") <> Nothing Then
If Not Page.IsPostBack Then
If Session("user_type") = 1 Then
'show_adminmenus()
End If
lbluserwelcome.Text = "Welcome " & Session("user_name") & " " & Session("user_surname") & " to home"
End If
Else
Session.Abandon() 'abandon that user session
Server.Transfer("~/signin.aspx")
End If
Dim result() As String
Dim clsobj As clsCommon = New clsCommon
result = clsobj.fnGetCustomerAccountinfo(Session("user_id"))
If result(0) = 1 Then
lblBalance.Text = "My Account Balance is:;" & result(2)
Else
lblBalance.Text = "Unable to retrieve your balance at the moment .Please try again later"
End If
End Sub
thanks in advance....