Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 Add-ons for VP-ASP
 Check Submit Form
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pagesbydave
Starting Member

USA
1 Posts

Posted - June 26 2003 :  16:14:45  Show Profile  Reply with Quote
I had a check submit form that was working under 3.5 and after I upgraded and have tried to add it to a new site using 4.5 it bombs

does anyone see where its bombing?
I will put all the code in as it was when working

In shopcheckout.asp

' Put our credit card and non credit card form
'*************************************************
Sub DisplayForm

If SError<>"" then
Response.Write(getconfig("xfont") & "<br>" & sError & "</font>")
end if
PerformGateway
Response.Write("<b>" & getconfig("xfont") & LangCheckout01 & "</font></b><br>")
If AllowCreditCards="Yes" or AllowOtherPayment="Yes" then
Response.Write("<form name=form1 method=Post action='" & getsess("currenturl") &"'>")
Response.Write(tabledef)
AddCreditCard
AddOtherPayment
Response.Write(tabledefend)
shopbuttonreset getconfig("xbuttonreset"),LangCommonReset,""
Response.write "  "
shopbutton Getconfig("xbuttoncontinue"),LangCommonContinue,"Action"
response.write "<br><br>"
end if
shopbutton Getconfig("xbuttoncancel"),LangCommonCancelorder,"cancel"
Response.Write("</form>")
Response.Write("<b><a href=""shopcheckform.asp""> CLICK HERE TO USE ONLINE CHECK FORM. </a><b><br><br>")

End Sub

In shopcheckform.asp

<!-- #include file="shop$db.asp" -->
<!-- #include file="shophash.asp" -->
<!-- #include file="shopcartformat.asp" -->
<%
'**************************************************************************
' we are now secure and in different session to need to reget info'
' unless the user has cancelled, in that case we delete order and items
' creates a check form that the user can use to process online checks
' or to just verify the order details before proceeeding
' Dave theGraet
'*******************************************************************
ShopPageHeader ' Normal page header
OpenOrderDB dbc ' Open the database
GetCustomerSessionData ' make sure we have all session data in local variables
CartFormat "NOREMOVE" ' common format cart routine


dim oid
strOid = GetSess("orderid")
dim dbc
dim rstemp
strCustomerID = GetSess("CustomerID")
dim AccountNum
dim TransitNum
dim BankName
dim BranchNum
dim CheckNum
dim CheckNum2
dim EMail
dim State
dim Address
dim City
dim sAction
oid = GetSess("oid")

' SetSess "CurrentURL","ShopCheckform.asp"
' SetSess "FollowonURL","ShopThanks.asp"
' SetSess "PaymentURL",paymentURL

GetOrderInfo ' get orderid
sError=GetSess("PaymentError") ' on return for authorization there may be an error
SetSess "PaymentError","" ' reset
If xDisplayPrices<>"Yes" then
response.redirect GetSess("followonurl") ' go to shopthanks
end if

sAction=Request.form("Action")
If sAction = "" Then
' ShopPageHeader ' put out normal header
' DisplayForm() ' credit card form
' ShopPagetrailer ' trailer
Else
GetFormFields
ValidateData
if sError = "" Then
UpdateCreditInfo ' add payment to daat base
if paymentURL<>"" then ' if there is an authorization
response.redirect PaymentURL & "?oid=" & oid
else
response.redirect GetSess("followonurl") ' go to shopthanks
end if
end if
ShopPageHeader
DisplayForm
' ShopPageTrailer
end if




Sub GetorderInfo
' Either comes on querystring or on rentry is in session variables
if oid="" then
oid=GetSess("oid")
else
SetSess "oid", oid
end if
If oid="" then
Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (LangCheckoutProcessed)
end if
SetSess "oid", oid ' debug only

end sub





sAction=Request.form("Action")
If sAction = "" Then
' DisplayForm() ' credit card form
' ShopPagetrailer ' trailer
Else
GetFormFields
ValidateData
if sError = "" Then
SaveThisOrder ' add payment to daat base
if paymentURL<>"" then ' if there is an authorization
response.redirect PaymentURL & "?oid=" & oid
else
response.redirect GetSess("followonurl") ' go to shopthanks
end if
end if
' DisplayForm
' ShopPageTrailer
end if

Sub SaveThisOrder
ShopAddOrder ' add order to database
oid=GetSess( "orderId")
if Getsess("ordertotal")= 0 then
updatepaymentinfo LangpaymentNone
' response.redirect "shopthanks.asp"
end if
end sub




' add info to order
Sub ShopAddOrder
dim CVN, newcardno
Dim dbc
OpenOrderDB dbc
Dim sqltemp
sqltemp="select * from orders where orderid=" & getsess("oid")
Set rstemp = Server.CreateObject("ADODB.Recordset")
rstemp.open sqltemp, dbc, 1, 3
rstemp.update
end sub




%>


<form name="form" method="post" action="send_con.asp">
<p align="center"><font color="#000000"><br><B> Replace the following text fields with the corresponding values
<br>
EXACTLY as they are on your check.</b><br></font>
<div align="center">
<table cellpadding=2 bgcolor="0000ff"><tr><td align="center" valign="middle">
<table width="600" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="00ccff">
<tr>
<td colspan="3">
<div align="left">
<input type="text" name="Name" value="<%=strFirstName%> <%=strLastName%>" size="30">
</div>
</td>
<td rowspan="3" width="199" valign="top" align="left">
<div align="left"><b><font color="#000000"><%=strEmail%><br> Affinity Order ID #<%=strOid%></font></b> </div>
<input type="hidden" value="<%=strEmail%>" name="Email" >

</td>
<td width="8" height="42" rowspan="2">  </td>
<td width="98" height="42" rowspan="2">
<input type="text" name="CheckNum" size="10" maxlength="10" value="Check #">
</td>
</tr>
<tr>
<td colspan="3">
<input type="text" name="address" value="<%=strAddress%>" size="30">
</td>
</tr>
<tr>
<td width="60">
<input type="text" name="city" size="10" value="<%=strCity%>">
</td>
<td width="35">
<input type="text" name="state" size="5" value="<%=strState%>">
</td>
<td width="140">
<input type="text" name="zip" size="7" value="<%=strPostCode%>">
</td>
<td width="8">  </td>
<td width="98">
<input type="text" name="branch" size="15" value="Bank Branch Num">
</td>
</tr>
<tr>
<td height="51" width="60">
<div align="right"><font size="-1" color="#000000">Pay to the
Order of:</font></div>
</td>
<td colspan="3" height="51">
<div align="left"><b><u><font color="#000000">___Affinity Inc.____</font></U></b></div>
</td>
<td height="51" width="8">
<div align="right"><b><font color="#000000">$</font></b></div>
</td>
<td height="51" width="98">
<input type="text" name="amount" size="10" value="<%=Round(Getsess("OrderTotal"),2)%>">
</td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<input type="text" name="BankName" value="Bank Name" size="25">
</div>
</td>
<td colspan="3">  
 

</td>
</tr>
<tr>
<td width="60" align="right">
<div align="right"><b><font color="#000000">Memo:</font></b></div>
</td>
<td colspan="2" align="left">
<div align="left">
<input type="text" name="memo" value=" " size="25">
<input type="hidden" name="CustomerID" value="<%=strCustomerId%>">
<input type="hidden" name="CartInfo" value="<%=LangCommonViewCart%>">
<input type="hidden" name="OrderID" value="<%=Oid%>">
</div>
</td>
<td colspan="3">
 

</td>
</tr>
<tr>
<td colspan="3">
<div align="center"><font size="-2" color="#000000"> <b>|</b></font><b><font size="+1" color="#000000">:</font></b> 
<input type="text" name="TransitNum" value="9 Digit Routing Num" size="15">
 <font size="-2" color="#000000"><b>|</b></font><b><font size="+1" color="#000000">:</font></b>
</div>
</td>
<td colspan="2" align="left">

<input type="text" name="AccountNum" value="Account Number" size="12">
<b><font size="-2" color="#000000">||* </font></b> </div>
</td>
<td align="left">
<input type="text" name="checkNum2" size="8" value="Check #">
</td>
</tr>
</table>
</td></tr></table>
</div><br>
<div align="center">
<input type="submit" name="Submit" value="Submit Check">
  
<input type="reset" name="Submit2" value="Reset Check">
</div>
</form>






<%

ShopPageTrailer ' Normal Shop page trailer
ShopCloseDatabase dbc ' Close the database
%>



IN send_con.asp

<%option explicit%>
<!-- #include file="shop$db.asp" -->
<!-- #include file="shophash.asp" -->
<!-- #include file="shopcartformat.asp" -->
<!-- #include file="shopgiftdb.asp" -->
<!-- #include file="shop$language2.asp" -->
<%
Dim oid
strCustomerID = GetSess("CustomerID")
Oid = GetSess("orderid")
strAccountNum = Request.Form("AccountNum")
strTransitNum = Request.Form("TransitNum")
strBankName = Request.Form("BankName")
strBranchNum = Request.Form("branch")
strCheckNum = Request.Form("CheckNum")
strCheckNum2 = Request.Form("CheckNum2")
strEMail = Request.Form("email")
strState = Request.Form("state")
strPostcode = Request.Form("zip")
strAddress = Request.Form("address")
strCity = Request.Form("city")

const AllowReview="Yes" ' allow customer to review order
const IncludeOidonLink="no" ' some payment systems do not allow oid on their URL
Dim dbc
Dim ssl
dim slash, action, tmpstr, rc

ssl=xssl
if ssl<>"" then
slash=right(ssl,1)
if slash="/" or slash="\" then
else
ssl=ssl & "/"
end if
end if
if GetSess("cartItem")=0 or GetSess("cartitem")="" then
Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (LangError01)
end if
if GetSess("AffID")="" and xaffiliateUseCookies="Yes" then
tmpStr=Request.Cookies("affid")
If tmpStr<>"" then
SetSess "AffID", tmpStr
end if
end if
action = request("Cancel")
If action<>"" then
ShopCancelOrder
Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (LangCheckoutCancelled)
end if
action = ucase(left(request.form("action"),6))
' no action so display final form in this session
SetSess "CurrentURL","send_con.asp"
if Action="" then
' ShopPageHeader
Response.Write " "
' ShopPageTrailer
else
SaveThisOrder
end if

Sub SaveThisOrder
ShopAddOrder ' add order to database
oid=GetSess( "orderId")
' HandleGiftPurchase
' HandleGiftCertificate
' if Getsess("ordertotal")= 0 then
' updatepaymentinfo LangpaymentNone
' response.redirect "shopthanks.asp"
' end if
' If IncludeOidOnLink="Yes" then
' Response.Redirect ssl & xcheckout & "?oid=" & oid
' else
' Response.Redirect ssl & xcheckout
' end if
end sub


dim Mail
set Mail = server.createobject("Persits.Mailsender")

dim Content

Content = "Date : " & Now() & vbcrlf & "IP Address : " & Request.ServerVariables("REMOTE_ADDR") & vbcrlf & "Name : " & Request.form("Name") & vbcrlf & "Order ID : " & oid & vbcrlf & "Email : " & strEmail & vbcrlf & "Memo : " & Request.form("memo") & vbcrlf & "Amount : $" & Request.form("amount") & vbcrlf & vbcrlf & "Address : " & strAddress & vbcrlf & "City : " & strCity & vbcrlf & " State: " & strState & vbcrlf & "Zip : " & strPostcode & vbcrlf & vbcrlf & "Check Number : " & strCheckNum & vbcrlf & "CheckNum2 : " & strCheckNum2 & vbcrlf & "Branch Number : " & strBranchNum & vbcrlf & "Bank Name : " & strBankName & vbcrlf & "Transit Number : " & strTransitNum & vbcrlf & "Account Number : " & strAccountNum & vbcrlf & vbcrlf & vbcrlf & " Customer ID : " & strCustomerID


Mail.Host = "mail.teche.net"
Mail.From = request.form("Email")
Mail.FromName = request.form("Name")
Mail.AddAddress "[email protected]"
Mail.Subject = "Online Check Payment "
Mail.Body = Content

On Error Resume Next
Mail.Send


Sub UpdatepaymentInfo ()
Dim rstemp
OpenOrderDB dbc
Dim sqltemp
sqltemp="select * from orders where orderid=" & getsess("oid")
Set rstemp = Server.CreateObject("ADODB.Recordset")
rstemp.open sqltemp, dbc, 1, 3
' rstemp("ocardtype")=paymenttype
rstemp("ocardtype")=check

rstemp.update
rstemp.close
set rstemp=nothing
ShopcloseDatabase dbc
end sub


If Err < 0 then
response.write("An error occured: " & Err.Description)
Else
' response.redirect("shopthanks.asp")
ShopPageHeader
Response.Write "<b> Thank You , </b><br> Your check payment and order have been submitted. <br> Your order will be shipped when payment is approved."
ShopPageTrailer
End IF

%>




the check used to work but know it goes stratight from the shopcheckout page to the thanks page
?????????????????????


any help would be great and anyone who would like to use it after it is working is welcome
thanks Dave


  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)
$0.00