Desperately need help....
here's the snippet of my code that im trying to solve since last week...
icePayment.aspx -
If (Left(Request.Form("return_url"), 7) <> "http://") Then
-
errorInput = errorInput & "Invalid return URL path! <BR>"
-
errorExist = True
-
Response.Redirect("InvalidUrlError.aspx")
-
Else
-
Session( "res") = "1"
-
TextBox2.Text = Session(Response.Redirect(Request.Form("res")"retu rn_url"))
payResult.asp -
<% if ( Request.QueryString(Session("res") ) = "1") then %>
-
Thanks!
-
<% else %>
-
sorry
-
<% end if %>
However,it could not be captured in payResult.asp
Ive tried using Request.form(Session("res"), Session("res") in payResult.asp but still it doesnt work...
23 3558
Hello Ryna,
If I understand your question/problem you have a scenario where your user is on a dotNet page and you want to redirect them to a Classic asp page and also pass in a variable to the Classic asp page too?
If that’s the case then pass the variable within the query string like this: -
Response.Redirect("payResult.asp?res=" & Session("res"))
-
Hope that helps,
CroCrew~
hi crowcrew...
its not working...it shows page error(The page cannot be displayed)
=(
Hello ryna,
So, I/we understand the situation better could you please post the code for both the pages? A 404 (page cannot be displayed) could be many things.
But, please before pasting your code for each page make sure you wrap the code of each page inside [code] tags.
Thanks,
CroCrew~
Here's the code..
icePayment.aspx -
Imports System.Data
-
Imports System.Data.SqlClient
-
-
Partial Class icePayment
-
Inherits System.Web.UI.Page
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
-
Dim conn As New SqlConnection("data source=IFCDU2-WS23\SQLEXPRESS;initial catalog=icebank;integrated security=true")
-
conn.Open()
-
-
Dim response_text As String
-
'Dim redirectStr As String
-
Dim input(9) As Object
-
Dim errorInput As String
-
Dim errorExist As Boolean
-
Dim inputName As Object ' Object
-
Dim i As Integer
-
Dim j As Integer
-
Dim k As Integer
-
-
errorInput = ""
-
errorExist = False
-
inputName = New Object() {"merchant_id", "amount", "card_type", "card_num", "expireMon", "expireYr", "return_url", "ref_code", "card_name"}
-
-
'get input from Form
-
For i = 0 To 8
-
Input(i) = Request.Form(inputName(i))
-
Next
-
'Check the Input is Empty
-
For j = 0 To 8
-
If IsNothing(Input(j)) Then
-
errorInput = errorInput & inputName(j) & " is blank.<BR>"
-
errorExist = True
-
End If
-
Next
-
'Check the Input is Numeric
-
For k = 0 To 5
-
If Not (IsNumeric(Input(k))) Then
-
errorInput = errorInput & inputName(k) & " is not numeric.<BR>"
-
errorExist = True
-
End If
-
Next
-
If Not (errorExist) Then
-
-
End If
-
-
Dim response_code As Integer
-
'Dim Msg As String
-
-
Dim merchantSql As New SqlCommand("select * FROM iceMerchant WHERE merchantID = '" & Request.Form("merchant_id") & "'", conn)
-
-
Dim merchant As String = Request.Form("merchant_id")
-
Dim merchantDr As SqlDataReader
-
merchantDr = merchantSql.ExecuteReader()
-
-
-
response_code = 0
-
If merchantDr.Read() Then
-
response_code = 0
-
-
If merchant <> Trim(merchantDr("merchantID")) Then
-
response_text = "Invalid Merchant ID"
-
'Response.Redirect("MerchantError.aspx")
-
End If
-
-
Else
-
End If
-
merchantDr.Close()
-
conn.Close()
-
-
conn.Open()
-
Dim credit As String = Trim(Request.Form("card_num"))
-
Dim cardName As String = Trim(Request.Form("card_name"))
-
Dim cardType As String = (Request.Form("card_type"))
-
'Dim cardType As String = CDbl(Request.Form("card_type")) / 1
-
Dim amount As String = Trim(Request.Form("amount"))
-
Dim ref_code As String = Trim(Request.Form("ref_code"))
-
Dim desc As String
-
Dim time As Date
-
Dim randomNo As Single
-
Dim trans_date As String
-
Dim trans_code As String
-
Dim expireMonSql As Integer
-
Dim expireYrSql As Integer
-
Dim credit_limit As Object
-
Dim total_credit As Object
-
Dim credit_balance As Object
-
Dim merchant_balance As Object
-
Dim userID As Object
-
Dim mBalance As Object
-
Dim debit_account As Object
-
Dim credit_account As Object
-
Dim expireMonFM As Object = Trim(Int(Request.Form("expireMon")))
-
Dim expireYrFM As Object = Trim(Int(Request.Form("expireYr")))
-
'Dim creditSql As New SqlCommand("select iceUser.userID, fullName, account_id, creditCardNo, cardType, expiryDate, totalcredit, creditlimit, creditBalance FROM iceUser INNER JOIN ( account_summary INNER JOIN iceCredit ON account_summary.account_id = iceCredit.creditCardNo) ON iceUser.userID = account_summary.userID where creditCardNo = '" & Request.Form("card_num") & "' ", conn)
-
Dim creditSql As New SqlCommand("select iceUser.userID, fullName, account_id, creditCardNo, cardType, expiryDate, totalcredit, creditlimit, creditBalance, iceMerchant.merchantID, iceMerchant.merchantBalance FROM iceMerchant, iceUser INNER JOIN ( account_summary INNER JOIN iceCredit ON account_summary.account_id = iceCredit.creditCardNo) ON iceUser.userID = account_summary.userID where creditCardNo = '" & Trim(Request.Form("card_num")) & "' ", conn)
-
'Dim creditSql As New SqlCommand("select iceUser.userID, fullName, account_id, creditCardNo, cardType, expiryDate, totalcredit, creditlimit, creditBalance, iceMerchant.merchantID, iceMerchant.merchantBalance FROM iceMerchant, iceUser INNER JOIN ( account_summary INNER JOIN iceCredit ON account_summary.account_id = iceCredit.creditCardNo) ON iceUser.userID = account_summary.userID ", conn)
-
-
Dim creditDr As SqlDataReader
-
creditDr = creditSql.ExecuteReader()
-
-
If creditDr.Read() Then
-
response_code = 0
-
-
If Not IsNumeric(credit) Or credit = "" Or credit <> creditDr("creditCardNo") Then
-
response_text = "Invalid Credit Card No"
-
-
Else
-
If cardName = "" Or cardName <> Trim(UCase(creditDr("fullName"))) Then
-
response_text = "Invalid Card Holder's Name"
-
-
' Label1.Text = cardName & Trim(UCase(creditDr("fullName")))
-
Else
-
'If cardType <> CDblcreditDr("cardType")) / 1 Then
-
If cardType <> (creditDr("cardType")) Then
-
response_text = "Invalid Card Type"
-
-
-
Else
-
expireMonSql = Month(Convert.ToDateTime(creditDr("expiryDate")))
-
expireYrSql = Year(Convert.ToDateTime(creditDr("expiryDate")))
-
credit_limit = Trim(creditDr("creditLimit"))
-
total_credit = Trim(creditDr("totalCredit"))
-
-
If Not IsNumeric(expireMonFM And expireYrFM) Or (((CDbl(expireMonFM) - expireMonSql) <> 0) Or ((CDbl(expireYrFM) - expireYrSql) <> 0)) Then
-
response_text = "Invalid Credit Card"
-
-
-
ElseIf ((CDbl(amount) - CDbl(credit_limit)) > 0) Then
-
response_text = "Card limit is reached!"
-
-
Else
-
response_code = 1
-
credit_balance = Trim(creditDr("creditBalance"))
-
debit_account = Trim(creditDr("creditCardNo"))
-
credit_account = Trim(creditDr("merchantID"))
-
merchant_balance = Trim(creditDr("merchantBalance"))
-
userID = Trim(creditDr("userID"))
-
-
-
If (response_code = 1) Then
-
-
If (CInt(credit_balance) = 0) Then
-
credit_limit = CDbl(credit_limit) - CDbl(amount)
-
credit_balance = -CDbl(amount)
-
-
Else
-
credit_balance = CDbl(credit_balance) - CDbl(amount)
-
-
-
If (credit_balance >= 0) Then
-
credit_limit = total_credit
-
-
Else
-
credit_limit = total_credit + credit_balance
-
-
End If
-
End If
-
-
'mBalance = merchant_balance
-
'mBalance = mBalance + CDbl(amount)
-
'conn.Close()
-
'conn.Open()
-
-
''update merchant balance
-
'Dim updateMerchant As String
-
'updateMerchant = "update iceMerchant set merchantBalance = '" & mBalance & "' where merchantID = '" & merchant & "'"
-
'Dim cmdMerchant As New SqlCommand(updateMerchant, conn)
-
'cmdMerchant.ExecuteNonQuery()
-
-
'conn.Close()
-
'conn.Open()
-
-
''edit iceCredit table
-
'Dim updateCredit As String
-
'updateCredit = "update iceCredit set creditBalance = '" & credit_balance & "',creditLimit = '" & credit_limit & "' where creditCardNo ='" & credit & "' "
-
-
'Dim cmdCredit As New SqlCommand(updateCredit, conn)
-
'cmdCredit.ExecuteNonQuery()
-
-
-
'Randomize(Timer())
-
'randomNo = 0
-
'Do While randomNo <= 1000
-
' randomNo = Int((9999 * Rnd()) + 1)
-
'Loop
-
'time = TimeOfDay()
-
'trans_date = Today() & " " & TimeOfDay()
-
'trans_code = "ICE-"
-
'trans_code = trans_code & randomNo & Second(time) & "-" & Int(Timer())
-
'Dim c1 As String = "Credit Card Transaction @"
-
'Dim c2 As String = "</BR> Ref. Code: "
-
'desc = c1 & time & c2 & ref_code
-
-
'conn.Close()
-
'conn.Open()
-
-
''insert(transaction)
-
'Dim updateTrans As String
-
'updateTrans = "insert into iceTransaction(trans_code, account_id, trans_amt, trans_date, trans_desc,tID) values ('" & trans_code & "','" & debit_account & "', '" & amount & "','" & trans_date & "','" & desc & "','" & userID & "')"
-
-
'Dim cmdTrans As New SqlCommand(updateTrans, conn)
-
'cmdTrans.ExecuteNonQuery()
-
''Request.Form("response_code") = 1
-
'response_text = "Transaction is success!!"
-
''redirectStr = Request.Form("return_url")
-
-
End If
-
-
End If
-
-
If (Left(Request.Form("return_url"), 7) <> "http://") Then
-
errorInput = errorInput & "Invalid return URL path! <BR>"
-
errorExist = True
-
Response.Redirect("inputerror.aspx")
-
Response.Redirect("InvalidUrlError.aspx")
-
Else
-
-
Session("res") = response_code
-
Session("text") = response_text
-
Response.Redirect((Request.Form("return_url")))
-
End If
-
-
If (errorExist) Then
-
response_code = 0
-
response_text = errorInput
-
End If
-
End If
-
-
End If
-
-
End If
-
-
End If
-
'End If
-
-
-
creditDr.Close()
-
conn.Close()
-
-
End Sub
-
-
End Class
-
-
payResult.asp - <% if ( Request.Form(Session("res")) = 1) then %>
-
Thank You for buying GOODS from our online Store!
-
-
<% else %>
-
I'm sorry,but there was a problem with this transaction.<br />
-
The server response was:<br />
-
-
<% = Request.Form(Session("text")) %> <br />
-
Go back to check Out page to enter information again<br />
-
-
<% end if %>
There is no code that is redirecting to PayResult.asp
is that comming in form the Request.Form("return_url")?
Before the "Dim conn" line in your Page_Load add the following code: -
Response.Write("Here: " & Request.Form("return_url"))
-
What do you get before the post and then what do you get after the post.
Comment out the Response.Redirects on the page too so you don’t get the error
Hello ryna,
Try substituting your code in “icePayment.aspx” with this code and run your solution and tell us what you get.
icePayment.aspx -
Imports System.Data
-
Imports System.Data.SqlClient
-
-
Partial Class icePayment
-
Inherits System.Web.UI.Page
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
Dim conn As New SqlConnection("data source=IFCDU2-WS23\SQLEXPRESS;initial catalog=icebank;integrated security=true")
-
conn.Open()
-
-
Dim response_text As String
-
Dim input(9) As Object
-
Dim errorInput As String
-
Dim errorExist As Boolean
-
Dim inputName As Object
-
Dim i As Integer
-
Dim j As Integer
-
Dim k As Integer
-
-
errorInput = ""
-
errorExist = False
-
inputName = New Object() {"merchant_id", "amount", "card_type", "card_num", "expireMon", "expireYr", "return_url", "ref_code", "card_name"}
-
-
For i = 0 To 8
-
Input(i) = Request.Form(inputName(i))
-
Next
-
-
For j = 0 To 8
-
If IsNothing(Input(j)) Then
-
errorInput = errorInput & inputName(j) & " is blank.<BR>"
-
errorExist = True
-
End If
-
Next
-
-
For k = 0 To 5
-
If Not (IsNumeric(Input(k))) Then
-
errorInput = errorInput & inputName(k) & " is not numeric.<BR>"
-
errorExist = True
-
End If
-
Next
-
-
Dim response_code As Integer
-
Dim merchantSql As New SqlCommand("select * FROM iceMerchant WHERE merchantID = '" & Request.Form("merchant_id") & "'", conn)
-
-
Dim merchant As String = Request.Form("merchant_id")
-
Dim merchantDr As SqlDataReader
-
merchantDr = merchantSql.ExecuteReader()
-
-
response_code = 0
-
If merchantDr.Read() Then
-
response_code = 0
-
If merchant <> Trim(merchantDr("merchantID")) Then
-
response_text = "Invalid Merchant ID"
-
End If
-
End If
-
merchantDr.Close()
-
conn.Close()
-
-
conn.Open()
-
Dim credit As String = Trim(Request.Form("card_num"))
-
Dim cardName As String = Trim(Request.Form("card_name"))
-
Dim cardType As String = (Request.Form("card_type"))
-
Dim amount As String = Trim(Request.Form("amount"))
-
Dim ref_code As String = Trim(Request.Form("ref_code"))
-
Dim desc As String
-
Dim time As Date
-
Dim randomNo As Single
-
Dim trans_date As String
-
Dim trans_code As String
-
Dim expireMonSql As Integer
-
Dim expireYrSql As Integer
-
Dim credit_limit As Object
-
Dim total_credit As Object
-
Dim credit_balance As Object
-
Dim merchant_balance As Object
-
Dim userID As Object
-
Dim mBalance As Object
-
Dim debit_account As Object
-
Dim credit_account As Object
-
Dim expireMonFM As Object = Trim(Int(Request.Form("expireMon")))
-
Dim expireYrFM As Object = Trim(Int(Request.Form("expireYr")))
-
Dim creditSql As New SqlCommand("select iceUser.userID, fullName, account_id, creditCardNo, cardType, expiryDate, totalcredit, creditlimit, creditBalance, iceMerchant.merchantID, iceMerchant.merchantBalance FROM iceMerchant, iceUser INNER JOIN ( account_summary INNER JOIN iceCredit ON account_summary.account_id = iceCredit.creditCardNo) ON iceUser.userID = account_summary.userID where creditCardNo = '" & Trim(Request.Form("card_num")) & "' ", conn)
-
-
Dim creditDr As SqlDataReader
-
creditDr = creditSql.ExecuteReader()
-
-
If creditDr.Read() Then
-
response_code = 0
-
If Not IsNumeric(credit) Or credit = "" Or credit <> creditDr("creditCardNo") Then
-
response_text = "Invalid Credit Card No"
-
Else
-
If cardName = "" Or cardName <> Trim(UCase(creditDr("fullName"))) Then
-
response_text = "Invalid Card Holder's Name"
-
Else
-
If cardType <> (creditDr("cardType")) Then
-
response_text = "Invalid Card Type"
-
Else
-
expireMonSql = Month(Convert.ToDateTime(creditDr("expiryDate")))
-
expireYrSql = Year(Convert.ToDateTime(creditDr("expiryDate")))
-
credit_limit = Trim(creditDr("creditLimit"))
-
total_credit = Trim(creditDr("totalCredit"))
-
-
If Not IsNumeric(expireMonFM And expireYrFM) Or (((CDbl(expireMonFM) - expireMonSql) <> 0) Or ((CDbl(expireYrFM) - expireYrSql) <> 0)) Then
-
response_text = "Invalid Credit Card"
-
ElseIf ((CDbl(amount) - CDbl(credit_limit)) > 0) Then
-
response_text = "Card limit is reached!"
-
Else
-
response_code = 1
-
credit_balance = Trim(creditDr("creditBalance"))
-
debit_account = Trim(creditDr("creditCardNo"))
-
credit_account = Trim(creditDr("merchantID"))
-
merchant_balance = Trim(creditDr("merchantBalance"))
-
userID = Trim(creditDr("userID"))
-
If (response_code = 1) Then
-
If (CInt(credit_balance) = 0) Then
-
credit_limit = CDbl(credit_limit) - CDbl(amount)
-
credit_balance = -CDbl(amount)
-
Else
-
credit_balance = CDbl(credit_balance) - CDbl(amount)
-
If (credit_balance >= 0) Then
-
credit_limit = total_credit
-
Else
-
credit_limit = total_credit + credit_balance
-
End If
-
End If
-
End If
-
End If
-
-
If (Left(Request.Form("return_url"), 7) <> "http://") Then
-
errorInput = errorInput & "Invalid return URL path! <BR>"
-
errorExist = True
-
Response.Write("Going to redirect to user to: inputerror.aspx")
-
Response.Write("Going to redirect to user to: InvalidUrlError.aspx")
-
Response.End
-
Else
-
Session("res") = response_code
-
Session("text") = response_text
-
Response.Write("Going to redirect to user to: return_url" & Request.Form("return_url"))
-
Response.End
-
End If
-
-
If (errorExist) Then
-
response_code = 0
-
response_text = errorInput
-
End If
-
End If
-
End If
-
End If
-
End If
-
-
creditDr.Close()
-
conn.Close()
-
End Sub
-
End Class
-
CroCrew~
this statement Request.Form("return_url")) is redirecting to payResult.asp
when I execute the code it did when to payResult.asp but it show:
<% else %>
I'm sorry,but there was a problem with this transaction.<br />
The server response was:<br />
eventhough its successfully update and insert to database...
Hello ryna,
Yes, that is because DotNet “Session” variables will not pass across to Classic ASP pages. So your If—Then statement will fall into the “else” because the condition is “False”.
Did you copy and paste my last post over your code? I need to know what the output is when you run and submit your form with it to help you.
CroCrew~
Ryna, I gave you this same answer in your other thread on the topic. Please do not double post your question because it makes it very hard for us to answer your question and it makes it hard for you to get the answer to your problem too (for example right now you probably didn't see the answer in your other thread).
Please refrain from double posting your questions in the future.
-Frinny
Yes croCrew, I did copy and paste your code..
The output is: Going to redirect to user to: return_url payResult.asp
Hello ryna,
Try substituting both pages now with the below two pages and run your solution and tell us what you get.
icePayment.aspx -
Imports System.Data
-
Imports System.Data.SqlClient
-
-
Partial Class icePayment
-
Inherits System.Web.UI.Page
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
Dim conn As New SqlConnection("data source=IFCDU2-WS23\SQLEXPRESS;initial catalog=icebank;integrated security=true")
-
conn.Open()
-
-
Dim response_text As String
-
Dim input(9) As Object
-
Dim errorInput As String
-
Dim errorExist As Boolean
-
Dim inputName As Object
-
Dim i As Integer
-
Dim j As Integer
-
Dim k As Integer
-
-
errorInput = ""
-
errorExist = False
-
inputName = New Object() {"merchant_id", "amount", "card_type", "card_num", "expireMon", "expireYr", "return_url", "ref_code", "card_name"}
-
-
For i = 0 To 8
-
Input(i) = Request.Form(inputName(i))
-
Next
-
-
For j = 0 To 8
-
If IsNothing(Input(j)) Then
-
errorInput = errorInput & inputName(j) & " is blank.<BR>"
-
errorExist = True
-
End If
-
Next
-
-
For k = 0 To 5
-
If Not (IsNumeric(Input(k))) Then
-
errorInput = errorInput & inputName(k) & " is not numeric.<BR>"
-
errorExist = True
-
End If
-
Next
-
-
Dim response_code As Integer
-
Dim merchantSql As New SqlCommand("select * FROM iceMerchant WHERE merchantID = '" & Request.Form("merchant_id") & "'", conn)
-
-
Dim merchant As String = Request.Form("merchant_id")
-
Dim merchantDr As SqlDataReader
-
merchantDr = merchantSql.ExecuteReader()
-
-
response_code = 0
-
If merchantDr.Read() Then
-
response_code = 0
-
If merchant <> Trim(merchantDr("merchantID")) Then
-
response_text = "Invalid Merchant ID"
-
End If
-
End If
-
merchantDr.Close()
-
conn.Close()
-
-
conn.Open()
-
Dim credit As String = Trim(Request.Form("card_num"))
-
Dim cardName As String = Trim(Request.Form("card_name"))
-
Dim cardType As String = (Request.Form("card_type"))
-
Dim amount As String = Trim(Request.Form("amount"))
-
Dim ref_code As String = Trim(Request.Form("ref_code"))
-
Dim desc As String
-
Dim time As Date
-
Dim randomNo As Single
-
Dim trans_date As String
-
Dim trans_code As String
-
Dim expireMonSql As Integer
-
Dim expireYrSql As Integer
-
Dim credit_limit As Object
-
Dim total_credit As Object
-
Dim credit_balance As Object
-
Dim merchant_balance As Object
-
Dim userID As Object
-
Dim mBalance As Object
-
Dim debit_account As Object
-
Dim credit_account As Object
-
Dim expireMonFM As Object = Trim(Int(Request.Form("expireMon")))
-
Dim expireYrFM As Object = Trim(Int(Request.Form("expireYr")))
-
Dim creditSql As New SqlCommand("select iceUser.userID, fullName, account_id, creditCardNo, cardType, expiryDate, totalcredit, creditlimit, creditBalance, iceMerchant.merchantID, iceMerchant.merchantBalance FROM iceMerchant, iceUser INNER JOIN ( account_summary INNER JOIN iceCredit ON account_summary.account_id = iceCredit.creditCardNo) ON iceUser.userID = account_summary.userID where creditCardNo = '" & Trim(Request.Form("card_num")) & "' ", conn)
-
-
Dim creditDr As SqlDataReader
-
creditDr = creditSql.ExecuteReader()
-
-
If creditDr.Read() Then
-
response_code = 0
-
If Not IsNumeric(credit) Or credit = "" Or credit <> creditDr("creditCardNo") Then
-
response_text = "Invalid Credit Card No"
-
Else
-
If cardName = "" Or cardName <> Trim(UCase(creditDr("fullName"))) Then
-
response_text = "Invalid Card Holder's Name"
-
Else
-
If cardType <> (creditDr("cardType")) Then
-
response_text = "Invalid Card Type"
-
Else
-
expireMonSql = Month(Convert.ToDateTime(creditDr("expiryDate")))
-
expireYrSql = Year(Convert.ToDateTime(creditDr("expiryDate")))
-
credit_limit = Trim(creditDr("creditLimit"))
-
total_credit = Trim(creditDr("totalCredit"))
-
-
If Not IsNumeric(expireMonFM And expireYrFM) Or (((CDbl(expireMonFM) - expireMonSql) <> 0) Or ((CDbl(expireYrFM) - expireYrSql) <> 0)) Then
-
response_text = "Invalid Credit Card"
-
ElseIf ((CDbl(amount) - CDbl(credit_limit)) > 0) Then
-
response_text = "Card limit is reached!"
-
Else
-
response_code = 1
-
credit_balance = Trim(creditDr("creditBalance"))
-
debit_account = Trim(creditDr("creditCardNo"))
-
credit_account = Trim(creditDr("merchantID"))
-
merchant_balance = Trim(creditDr("merchantBalance"))
-
userID = Trim(creditDr("userID"))
-
If (response_code = 1) Then
-
If (CInt(credit_balance) = 0) Then
-
credit_limit = CDbl(credit_limit) - CDbl(amount)
-
credit_balance = -CDbl(amount)
-
Else
-
credit_balance = CDbl(credit_balance) - CDbl(amount)
-
If (credit_balance >= 0) Then
-
credit_limit = total_credit
-
Else
-
credit_limit = total_credit + credit_balance
-
End If
-
End If
-
End If
-
End If
-
-
If (Left(Request.Form("return_url"), 7) <> "http://") Then
-
errorInput = errorInput & "Invalid return URL path! <BR>"
-
errorExist = True
-
Response.Write("Going to redirect to user to: inputerror.aspx")
-
Response.Write("Going to redirect to user to: InvalidUrlError.aspx")
-
Response.End
-
Else
-
Response.Redirect(Request.Form("return_url") & "?res=" & response_code & "&text=" & response_text)
-
End If
-
-
If (errorExist) Then
-
response_code = 0
-
response_text = errorInput
-
End If
-
End If
-
End If
-
End If
-
End If
-
-
creditDr.Close()
-
conn.Close()
-
End Sub
-
End Class
-
payResult.asp -
<%
-
If (Request.QueryString("res") = 1) Then
-
Response.Write("Thank You for buying GOODS from our online Store!")
-
Else
-
Response.Write("I'm sorry,but there was a problem with this transaction.<br />")
-
Response.Write("The server response was:<br />")
-
Response.Write(Request.QueryString("text") & "<br />")
-
Response.Write("Go back to check Out page to enter information again<br />")
-
End If
-
%>
-
Sorry just made a change to "payResult.asp" Check that page again if you seen it before I made the edits.
hi CroCrew,
it show page not found (404)...
Is "payResult.asp" in the same folder that "icePayment.aspx" is in? Are you getting a 404 when going to "payResult.asp"? Post the error that your getting.
Ryna, a 404 error means that it can't find the page that you're redirecting to.
You should check to make sure that the URLs are correct.
Try using the .NET debugger (that comes with VisualStudio) to step through your code and make sure that the URLs are pointing to the right place. If you don't want to use the debugger for some reason you could try hard coding the URL of the payResult.asp page: - 'What are you doing here?????
-
If (Left(Request.Form("return_url"), 7) <> "http://") Then
-
errorInput = errorInput & "Invalid return URL path! <BR>"
-
errorExist = True
-
Response.Redirect("inputerror.aspx")
-
'The following line will not be executed..................
-
'Anything that comes after a Response.Redirect is not executed
-
Response.Redirect("InvalidUrlError.aspx")
-
Else
-
Session("res") = response_code
-
Session("text") = response_text
-
'Instead of this please try hard coding the return url
-
' Response.Redirect((Request.Form("return_url")))
-
'Try this instead
-
'(Make sure that the URL is correctly pointing to the payResult.asp page):
-
Response.Redirect("http://localhost/websiteDirectory/payResult.asp?res=" & response_code,True)
-
End If
hi croCrew...
my fault.The codes that you want me to test it works but
Response.Redirect(Request.Form("return_url") & "?res=" & response_code & "&text=" & response_text)
the one in bold there's curly line below...
it says variable"response_text" is used before it has been assigned a value.A null reference exception could result in at runtime.
it almost working..
when I enter the wrong credit card it did not show the error message
which is : response_text = "Invalid Credit Card No"
however when it is successful(enter correct information) it print out this line:
Response.Write("Thank You for buying GOODS from our online Store!")
Hello ryna,
So, is this resolved? You have your answer?
CroCrew~
im afraid not yet croCrew..
still stuck oon receiving the response_text...
Sir I need help in understanding this code..Any help will be appreciated :
Dim conn As New SqlConnection("data source=IFCDU2-WS23\SQLEXPRESS;initial catalog=icebank;integrated security=true")
Sign in to post your reply or Sign up for a free account.
Similar topics
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of...
|
by: Mike MacSween |
last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime
ago.
Then remembered that arguments are passed by reference, by default.
Does the fact that this slowed me down...
|
by: Scott Zabolotzky |
last post by:
I'm trying to pass a custom object back and forth between forms.
This custom object is pulled into the app using an external reference
to an assembly DLL that was given to me by a co-worker. A...
|
by: John Pass |
last post by:
Hi,
In the attached example, I do understand that the references are not changed
if an array is passed by Val. What I do not understand is the result of line
99 (If one can find this by line...
|
by: MSDNAndi |
last post by:
Hi,
I get the following warning:
"Possibly incorrect assignment to local 'oLockObject' which is the argument
to a using or lock statement. The Dispose call or unlocking will happen on
the...
|
by: Andrew Bullock |
last post by:
Hi,
I have two classes, A and B,
B takes an A as an argument in its constructor:
A a1 = new A();
B b = new B(a1);
|
by: James Robertson |
last post by:
I am new to the ASP and VB thing so be kind. Question I have is that
I have created an ASPX web site to use as an E-Mail page. But I want
to use this for a lot of users. Can I create the link on...
|
by: DaTurk |
last post by:
If I call this method, and pass it a byte by ref, and initialize
another byte array, set the original equal to it, and then null the
reference, why is the original byte array not null as well? I...
|
by: =?Utf-8?B?U3VqZWV0?= |
last post by:
If there are long strings (like 1MB or 2MB) is it more performant to pass
those by ref to methods or by value?
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |