Hi all.
I have been racking my brain trying to figure out how to validate a form on a saved page (user saved the page to their desktop) where the dynamic variables are then saved as static variables?
I am using outdated ASP classic, and I have to work with old Fox 2.o and Visual Fox data.
Basically a DLL is built that creates a string and I perform an "execute" function that returns a string that must be parsed off into variables.
I include a results page which I can then utilize the variables from the
From the resultshow page, the user can click a button that will take the amount due -echeckdue - (which changes monthly) and this button would send the user data to a third party processor.
The problem is when a user saves the webpage to their desktop, the amount "Echeckdue" may be more than what is saved on the client computer. The 'checkit()' function does not seem to fire and the user is taken to the third party processor with the wrong amount that is now due.
When I look at the source behind the form on the saved page, this is what I see:
So what I need the function to do is take the static value of "pg_total_amount" value="474.39" and go back and re-query the data through the execute function above and test whether the new value is the same as the old. If not, I need to stop them from submitting the values to the third party processor.
I cannot seem to get this to work.
It always goes to the 3rd party processor with the wrong amount.
Here is the checkit function
Any suggestions as to make this happen? I would really like to make the page un-saveable, but I know I cannot do that!
Thank you all!
CMcc
I have been racking my brain trying to figure out how to validate a form on a saved page (user saved the page to their desktop) where the dynamic variables are then saved as static variables?
I am using outdated ASP classic, and I have to work with old Fox 2.o and Visual Fox data.
Basically a DLL is built that creates a string and I perform an "execute" function that returns a string that must be parsed off into variables.
Code:
Set mytest = Server.CreateObject("webrepay.taxcalc")
buffer = mytest.execute(cmd)
Code:
%>
<!--#INCLUDE file="resultshow.asp"-->
<%
Code:
echeckbtnmsg = " Pay $" + cstr(echeckdue) + " by eCheck (includes $.50 cent processing fee*)"
<form method='post' action= '[URL unfurl="true"]https://swp.paymentprocessor.com/co/default.aspx'>[/URL]
<input type='hidden' name='pg_api_login_id' value='il3bB78B1A'/>
<input type='hidden' name='pg_merchant_data_1' value='<%=taxyear%>'/>
<input type='hidden' name='pg_merchant_data_2' value='<%=addyear%>'/>
<input type='hidden' name='pg_merchant_data_3' value='<%=timedate%>'/>
<input type='hidden' name='pg_wallet_id' value='Property Tax'/>
<input type='hidden' name='pg_billto_postal_name_company' value=''/>
<input type='hidden' name='pg_continue_url' value='[URL unfurl="true"]http://www.mysite.org/general/onlinepay.shtml'/>[/URL]
<input type='hidden' name='pg_total_amount' value='<%=echeckdue%>'/>
<input type='hidden' name='pg_consumer_id' value='<%=plainparcel%>'/>
<input type='hidden' name='pg_consumerorderid' value='<%=plainparcel%>'/>
<p align="center">
<% if echeck <> "" then %>
<input name="BtnSUBMIT" onsubmit = 'return checkit(parcelnodash)' type=SUBMIT value='<%=echeckbtnmsg%>' />
<% end if %>
</p>
</form>
The problem is when a user saves the webpage to their desktop, the amount "Echeckdue" may be more than what is saved on the client computer. The 'checkit()' function does not seem to fire and the user is taken to the third party processor with the wrong amount that is now due.
When I look at the source behind the form on the saved page, this is what I see:
Code:
<form method="Redirect" onsubmit="checkit(parcelnodash)" action="[URL unfurl="true"]https://swp.paymentprocessor.net/co/default.aspx"><table[/URL] cellspacing="0" cellpadding="0" border="0"><tbody><tr><td align="right" width="300"></td><td align="left" width="200"><input type="hidden" name="pg_api_login_id" value="il3bB78B1A">
<input type="hidden" name="pg_merchant_data_1" value="2013">
<input type="hidden" name="pg_merchant_data_2" value="2013">
<input type="hidden" name="pg_merchant_data_3" value="1/3/2014 4:50:55 PM">
<input type="hidden" name="pg_wallet_id" value="Tax">
<input type="hidden" name="pg_billto_postal_name_company" value="">
<input type="hidden" name="pg_continue_url" value="[URL unfurl="true"]http://www.mysite.org/general/onlinepay.shtml">[/URL]
<input type="hidden" name="pg_total_amount" value="474.39">
<input type="hidden" name="pg_consumerorderid" value="R2519305AG080B">
<input type="hidden" name="pg_consumer_id" value="R2519305AG080B">
</td></tr><tr><td align="right" width="300"></td><td align="left" width="200"><input type="SUBMIT" value="Continue to Pay by eCheck Now"><br></td></tr></tbody></table></form>
I cannot seem to get this to work.
It always goes to the 3rd party processor with the wrong amount.
Here is the checkit function
Code:
<%
Function checkit(account)
dim mytest
dim buffer
dim ok2pay
dim whatisdue
dim whatshows
Set mytest = Server.CreateObject("webrepay.taxcalc")
buffer = mytest.execute(s)
ok2pay = mid(buffer,1557,1) 'ok2pay
whatisdue = Mid(buffer,293,11) * .01 '' newest value to pay
whatshows = amountdue '' amountdue is original variable parsed off the buffer with value of what is due
if ok2pay = "T" then '' right time of year to pay
intCompare = StrComp(whatisdue, whatshows, vbTextCompare)
If intCompare = 0 Then
checkit = true
Else
checkit = false
End If
else
checkit = false
end if
if checkit = false then
response.redirect("[URL unfurl="true"]http://www.mysite.org/dev/payresult.asp?txtAccountID="[/URL] & account)
end if
End Function
%>
Any suggestions as to make this happen? I would really like to make the page un-saveable, but I know I cannot do that!
Thank you all!
CMcc