<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%    
'############################################################################################
'#  ACHPaymentDemo.asp
'############################################################################################
'#
'# This script is a functioning example that shows ASP programmers how to utilize 
'# the SpeedChex ServerLink Advanced API to submit checking account and customer 
'# data to SpeedChex for authorization.  The script also shows sample code for parsing
'# the results sent back from SpeedChex.  Please contact your support representative
'# if you do not have a copy of the SpeedChex ServerLink Advanced API documentation.
'#
'# In order to establish an HTTPS connection, pass data to the SpeedChex Gateway and receive
'# a response using this sample code, you will need have ServerXMLHTTP installed.  This is 
'# installed by default in Windows 2003, Windows XP SP1, and Windows 2000 SP3.  It is also
'# included in Microsoft's .Net platform.  Documentation for ServerXMLHTTP can be found at:
'# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/97884cf6-5fdf-4b1f-8273-73c0e098b8f3.asp 
'#
'# This script expects to receive the following data fields as POST or QUERY STRING (GET)
'# variables:
'#     
'#     InvoiceNumber
'#     CheckAmount
'#     CustomerID
'#     FirstName
'#     LastName
'#     Company
'#     Address
'#     City
'#     State
'#     Zip
'#     Phone
'#     Email
'#     BankName
'#     AccountType
'#     AccountClass
'#     RoutingNumber
'#     CheckNumber
'#     AccountNumber
'#
'# The data format specifications and rules about which fields are required and which fields
'# are optional can be found in the SpeedChex ServerLink Advanced API documentation.
'# 
'# Programmers may use all or any part of this code and can make whatever modifications are
'# necessary to integrate this code into their perl application.
'#
'# When you are ready to test this code, you will need to change the MerchantID,
'# LoginName, and Password fields to those provided by your SpeedChex support representative.
'#
'###############################################################################################

'*************************************************************************
'*                                  M A I N
'*************************************************************************

   'Declare local variables
    Dim BillTo_ProfileID, BillTo_FirstName, BillTo_LastName, BillTo_Company, BillTo_Address, BillTo_City
    Dim BillTo_State, BillTo_Zip, BillTo_Country, BillTo_DaytimePhone, BillTo_HomePhone
    Dim BillTo_CellPhone, BillTo_Email, BillTo_SSN

    Dim ShipTo_ProfileID, ShipTo_FirstName, ShipTo_LastName, ShipTo_Company, ShipTo_Address, ShipTo_City
    Dim ShipTo_State, ShipTo_Zip, ShipTo_Country, ShipTo_DaytimePhone, ShipTo_HomePhone
    Dim ShipTo_CellPhone, ShipTo_Email, ShipTo_SSN
    
    Dim ExpressVerify, ReferenceID, CheckAmount, CustomerID, SECCode, DateScheduled
   
    Dim ErrorMessage, ParamList, Processor_Response, ResultArray
    
   'Initialize Local variables
    ErrorMessage = ""

    BillTo_FirstName = "Joe"                    'Note:  You would obviously use Request object or database
    BillTo_LastName = "Buyer"                  '       objects to populate these variables in a normal
    BillTo_Company = "JoeCo, Inc."              '       software application.
    BillTo_Address = "1234 Purchaser Lane"
    BillTo_City = "New York"
    BillTo_State = "NY"
    BillTo_Zip = "12345"
    BillTo_DaytimePhone = "(555) 222-1234"
    BillTo_Email = "jbuyer@217hosting.com"
    BillTo_SSN    = ""

    ShipTo_FirstName = "Joe"
    ShipTo_LastName = "Buyer"
    ShipTo_Company = "JoeCo, Inc."
    ShipTo_Address = "1234 Purchaser Lane"
    ShipTo_City = "New York"
    ShipTo_State = "NY"
    ShipTo_Zip = "12345"
    ShipTo_DaytimePhone = "(555) 222-1234"
    ShipTo_Email = "jbuyer@217hosting.com"
    ShipTo_SSN    = ""

    ReferenceID = "12345"
    CheckAmount = "44.00"
    CustomerID = ""
    SECCode = "WEB"
    ExpressVerify = "Yes"
    DateScheduled = String(2-Len(Month(Date)),"0") & Month(Date) & _             
                    String(2-Len(Day(Date)),"0") & Day(Date) & Year(Date)      
                      'this code puts the date in the required format MMDDYYYY     

   'This line is only here for the demo.  It resets the PaymentStatus so this demo can be used over and over from the same browser session
    Session("PaymentStatus") = ""
    
   'Determine if the payment form has been posted and whether or not the payment has been already been processed.
    If Request.Form("FormPost") = "True" and Session("PaymentStatus") = "" Then

      'Validate user input of check data for errors
       If Valid_CheckInputData() Then
       
           'Now send check payment data to SpeedChex for authorization
            If ECheck_Approved() Then

                'Set the Session("PaymentStatus") variable
                 Session("PaymentStatus") = "Completed"
         
                  'Note:  Once a payment is completed, assigning a value to the Session("PaymentStatus") variable
                  'will prevent the transaction from being resubmitted to SpeedChex if the user refreshes the page
                  'or hits the Back button and submits the transaction again.

            End If
        End If
    End If


'*************************************************************************
'*                    E C H E C K _ A P P R O V E D
'*************************************************************************
Function ECheck_Approved()
  Dim URL

 'Set the destination URL
  URL = "https://www.speedchex.com/datalinks/merchants/serverlink-advanced.asp"

 'Build the field list to be POSTED and assign the appropriate data values
  ParamList = "MerchantID=2001" & _
                         "&GateID=test" & _
                         "&GateKey=test" & _
                         "&ReferenceID=" & ReferenceID & _
                         "&PaymentDirection=FromCustomer" & _
                         "&CheckAmount=" & Server.URLEncode(CheckAmount) & _
                         "&DateScheduled=" & DateScheduled & _
                         "&CustomerID=" & Server.URLEncode(CustomerID) & _
                         "&CustomerName=" & Server.URLEncode(BillTo_FirstName & " " & BillTo_LastName) & _
                         "&Company=" & Server.URLEncode(BillTo_Company) & _
                         "&Address1=" & Server.URLEncode(BillTo_Address) & _
                         "&City=" & Server.URLEncode(BillTo_City) & _
                         "&State=" & Server.URLEncode(BillTo_State) & _
                         "&Zip=" & Server.URLEncode(BillTo_Zip) & _
                         "&Phone=" & Server.URLEncode(BillTo_DaytimePhone) & _
                         "&Email=" & Server.URLEncode(BillTo_Email) & _
                         "&SendEmailToCustomer=No" & _
                         "&BankName=" & Server.URLEncode(Request("BankName")) & _
                         "&AccountType=" & Server.URLEncode(Request("CheckType")) & _
                         "&AccountClass=" & Server.URLEncode(Request("AccountType")) & _
                         "&RoutingNumber=" & Server.URLEncode(Request("RoutingNumber")) & _
                         "&CheckNumber=" & Server.URLEncode(Request("CheckNumber")) & _
                         "&AccountNumber=" & Server.URLEncode(Request("AccountNumber")) & _
                         "&ExpressVerify=" & ExpressVerify & _
                         "&SECCode=" & SECCode & _
                         "&TestMode=On"

 'For Windows 2003, Windows 2000, and Windows XP Users
  Set objWinHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")

 'Post the data to the serverlink-advanced URL  
  objWinHttp.Open "POST", URL, False

  objWinHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  objWinHttp.Send ParamList

 'Parse the response
  Processor_Response = objWinHttp.ResponseText 
  ResultArray = Split(Processor_Response,",")

 'Close the object 
  Set objWinHTTP = Nothing
  
  If ResultArray(0) = "ReturnCode=000" Then
     ECheck_Approved = True
  Else
     ECheck_Approved = False

     'Parse ResultArray into corresponding variables.  NVPair is short for Name Value Pair
      ReturnCodeNVPair = split(ResultArray(0),"=")
        ReturnCodeName = ReturnCodeNVPair(0)
        ReturnCodeValue = ReturnCodeNVPair(1)

      ErrorDescriptionNVPair = split(ResultArray(1),"=")
        ErrorDescriptionName = ErrorDescriptionNVPair(0)
        ErrorDescriptionValue = ErrorDescriptionNVPair(1)

       ErrorFieldNVPair = split(ResultArray(2),"=")
        ErrorFieldName = ErrorFieldNVPair(0)
        ErrorFieldValue = ErrorFieldNVPair(1)

       TrackingCodeNVPair = split(ResultArray(3),"=") 
        TrackingCodeName = TrackingCodeNVPair(0)
        TrackingCodeValue = TrackingCodeNVPair(1)

      Select Case ReturnCodeValue  
        Case "006" 
         'Transaction Request Already Processed
          '  SpeedChex has already processed this check and will not process it again
          ErrorMessage = "This checking account data has already been submitted for this transaction."

        Case "007"
         'Please Contact Support Representative
           ErrorMessage = "Return Code 007:  Please contact our customer support department."

        Case "008"
         'Failed Verification
         '   The ErrorDescriptionValue variable will contain the Express Verify Response Code and the 
         '   Express Verify Response Text separated by a colon.  See document SpeedChex_ExpressVerify_Response_Codes.doc 
         '   for a list of all possible negative response codes.
                    
         'Get the Express Verify Response Text
          ErrorMessage = "<p class=""UtxtDarkRed"" style=""text-align: left"">We apologize, but we cannot accept a check on this bank account. &nbsp;The " &_
                                        "account has failed verification due to its current status as reported by your bank.<br><br>" &_
                                        "Your business is very important to us.  Please review the routing number and the " &_
                                        "account number for any input errors.  If you are sure the account information is " &_
                                        "correct, you may want to contact your banking institution to discuss the current " &_
                                        "status of your account and how it may have affected this transaction.</p>"

        Case Else
         'All other response codes
           ErrorMessage = "Return Code " & ReturnCodeValue & ":  Please contact our customer support department."
      End Select
  End If


End Function


'*************************************************************************
'*             V A L I D _ C H E C K I N P U T D A T A
'*************************************************************************
Function Valid_CheckInputData()
  Dim s, n
  
 'Assume Success
  Valid_CheckInputData = True
  
  If Request.Form("CheckType") = "Empty" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Type of Check"
    Exit Function
  ElseIf Request.Form("BankName") = "" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Bank Name"
    Exit Function
  ElseIf Request.Form("AccountType") = "Empty" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Account Type"
    Exit Function
  ElseIf Request.Form("RoutingNumber") = "" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Routing Number"
    Exit Function
  ElseIf Request.Form("CheckNumber") = "" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Check Number"
    Exit Function
  ElseIf Request.Form("AccountNumber") = "" Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Account Number"
    Exit Function
  ElseIf IsNumeric(Request.Form("RoutingNumber")) = False Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Routing Number cannot contain letters or spaces"
    Exit Function
  ElseIf Len(Request.Form("RoutingNumber"))<>9 Then
    Valid_CheckInputData = False
    ErrorMessage = "Invalid Entry: &nbsp;Routing Number"
    Exit Function
  End If
  
  
End Function



%>

<html>
<head>
<title>SpeedChex ACH Payment Demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
var closeOK = false;

function QuickFill() {

  var f = document.PaymentForm;
      f.CheckType.selectedIndex=1;
      f.AccountType.selectedIndex=1;
      f.CheckNumber.value = "2001";
      f.BankName.value = "Bank of America";
      f.RoutingNumber.value = "111000025";
      f.AccountNumber.value = "987654321";
 
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="../SampleCode.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--

.InputFields {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
}
.style1 {
    font-size: 18px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    color: #FFFFFF;
}
#Overview {
    position:absolute;
    width:544px;
    height:360px;
    z-index:1;
    left: 8px;
    top: 2376px;
    visibility: visible;
}
.style3 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #394D79;
}
.style4 {font-size: 16px}
-->
</style>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="Ubody">
<form action="ACHPaymentDemo.asp" method="post" name="PaymentForm" class="Ubody" id="PaymentForm">
  <table width="100%" height="100%" border="0" align="center" cellpadding="5" cellspacing="0" bgcolor="#3F6FA9">
    <tr>
      <td height="55">&nbsp;</td>
      <td width="700" align="center"><span class="style1">SpeedChex ServerLink Advanced API Demo</span> </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td width="700" valign="top" bgcolor="#FFFFFF">
        <br>
        <table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td height="40" class="UtxtLargeHeader">
              <table border="0" align="center" cellpadding="0" cellspacing="0" class="srhDisplayBox">
                <% If Session("PaymentStatus") <> "Completed" Then %>
                <tr>
                  <td width="670" height="30" bgcolor="#FEFBE2" class="UtxtLargeBlueHeader" style="padding-left: 15px">Shopping Cart &gt; Checkout &gt; Make Payment</td>
                </tr>
                <% Else %>
                <tr>
                  <td height="30" align="center" bgcolor="#FEFBE2" class="UtxtLargeBlueHeader" style="padding-left: 15px; padding-right: 15px; color: maroon">Thank You.&nbsp; Your Payment is Completed.</td>
                </tr>
                <% End If %>
              </table>
            </td>
          </tr>
          <tr>
            <td height="15">&nbsp;</td>
          </tr>
          <% If Session("PaymentStatus") <> "Completed" Then %>
          <tr>
            <td height="15">
              <table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="50%">
                    <table width="315" border="1" align="left" cellpadding="0" cellspacing="0" bordercolor="#BCC7DE" valign="top">
                      <tr>
                        <td height="30" bgcolor="#336699">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td class="UtxtWhiteBold">&nbsp;  Bill Purchase To: &nbsp;&nbsp; </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr align="left">
                        <td align="left" valign="top" style="padding-bottom: 3px; padding-top: 3px; padding-left: 8px" >
                          <table width="100%" border="0" cellpadding="1" cellspacing="0" class="UtxtDarkBlueBold">
                            <tr>
                              <td>
                                <% =BillTo_FirstName & " " & BillTo_LastName %>
                              </td>
                            </tr>
                            <% If Trim(BillTo_Company) <> "" Then %>
                            <tr>
                              <td>
                                <% =BillTo_Company %>
                              </td>
                            </tr>
                            <% End If %>
                            <tr>
                              <td>
                                <% =BillTo_Address %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =BillTo_City & ", " & BillTo_State & "&nbsp;" & BillTo_Zip %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =BillTo_DaytimePhone %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =BillTo_Email %>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="50%">
                    <table width="315" border="1" align="right" cellpadding="0" cellspacing="0" bordercolor="#BCC7DE" valign="top">
                      <tr>
                        <td height="30" bgcolor="#336699">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td class="UtxtWhiteBold">&nbsp;&nbsp; Ship Purchase To: &nbsp;&nbsp; </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr align="left">
                        <td align="left" valign="top" style="padding-bottom: 3px; padding-top: 3px; padding-left: 8px" >
                          <table width="100%" border="0" cellpadding="1" cellspacing="0" class="UtxtDarkBlueBold">
                            <tr>
                              <td>
                                <% =ShipTo_FirstName & " " & ShipTo_LastName %>
                              </td>
                            </tr>
                            <% If Trim(ShipTo_Company) <> "" Then %>
                            <tr>
                              <td>
                                <% =ShipTo_Company %>
                              </td>
                            </tr>
                            <% End If %>
                            <tr>
                              <td>
                                <% =ShipTo_Address %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =ShipTo_City & ", " & ShipTo_State & "&nbsp;" & ShipTo_Zip %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =ShipTo_DaytimePhone %>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <% =ShipTo_Email %>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr>
                  <td height="25" colspan="2">&nbsp;</td>
                </tr>
                <tr>
                  <td height="25" colspan="2">
                    <table width="100%" border="0" cellpadding="0" cellspacing="5" id="PleaseWait_Table" style="border-top: 2px inset; border-right: 2px inset; border-bottom: 2px inset; border-left: 2px inset; position: absolute; visibility: hidden">
                      <tr>
                        <td height="100" align="center" class="UtxtLargeMaroonHeader" style="padding-top: 10px">Processing Your Payment.&nbsp; Please Wait....</td>
                      </tr>
                    </table>
                    <table width="100%" border="0" cellpadding="0" cellspacing="5" id="ECheckTable" xstyle="border-top: 2px inset #BCC7DE; border-right: 2px inset #BCC7DE; border-bottom: 2px inset #BCC7DE; border-left: 2px inset #BCC7DE;">
                      <tr>
                        <td height="37" align="center" class="utxtBlackBold-14px" style="padding-top: 10px">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="25%">&nbsp;</td>
                              <td align="center"><span class="utxtBlackBold-14px" style="padding-top: 10px"><u>Electronic Check Payment </u></span></td>
                              <td width="25%" align="center"><span class="utxtBlackBold-14px" style="padding-top: 10px"><u>
                                <input type="button" name="button1" value="Quick Fill" onClick="javascript: QuickFill();">
                              </u></span></td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <% If ErrorMessage <> "" Then %>
                      <tr>
                        <td height="16" align="center" valign="bottom" class="UtxtErrorMessage-Red">
                          <% =ErrorMessage %>
                        </td>
                      </tr>
                      <% Else %>
                      <tr>
                        <td height="16" align="center" valign="bottom" class="UtxtDarkRed">Please use your next available check to provide the following information</td>
                      </tr>
                      <% End If %>
                      <tr>
                        <td>
                          <table cellpadding="0" cellspacing="0" border="0" align="CENTER">
                            <tr>
                              <td colspan="3"><img src="images/SCCheck_Top.jpg" width="482" height="15"></td>
                            </tr>
                            <tr>
                              <td width="34"><img src="images/SCCheck_Left.jpg" width="34" height="100%"></td>
                              <td height="173" background="images/SCCheck_Body.jpg" valign="TOP" style="padding-top: 3px; padding-bottom: 3px">
                                <table width="413" cellpadding="0" cellspacing="0" border="0" align="CENTER">
                                  <tr>
                                    <td width="3"></td>
                                    <td width="198" class="UtxtCheckLabels"><b>
                                      <% =BillTo_FirstName & " " & BillTo_LastName %>
                                      </b><br>
                                      <span style="font-weight: normal">
                                      <% If BillTo_Company <> "" Then %>
                                      <% =BillTo_Company %>
                                      <br>
                                      <% End If %>
                                      <% =BillTo_Address %>
                                      <br>
                                      <% =BillTo_City & ", " & BillTo_State & " " & BillTo_Zip %>
                                    </span> </td>
                                    <td width="211" valign="TOP" align="RIGHT">
                                      <table width="100%" cellpadding="0" cellspacing="0" border="0" align="RIGHT">
                                        <tr>
                                          <td align="RIGHT" class="UtxtCheckLabels" style="font-size: 10pt; font-weight: bold;">Type of Check:&nbsp;</td>
                                          <td align="RIGHT" width="120">
                                            <select name="CheckType" size="1" class="InputFields" style="font-size: 11px">
                                              <option value="Empty" selected="SELECTED"> </option>
                                              <option &lt;% If Request("CheckType") = "Personal" Then %&gt;selected&lt;% End If %&gt; value="Personal" >Personal Check</option>
                                              <option &lt;% If Request("CheckType") = "Company" Then %&gt;selected&lt;% End If %&gt; value="Company" >Company Check</option>
                                            </select>
                                        </tr>
                                        <tr>
                                          <td height="35">
                                            <table cellpadding="0" cellspacing="0" border="0" align="RIGHT">
                                              <tr>
                                                <td height="4"></td>
                                              </tr>
                                              <tr>
                                                <td align="RIGHT" valign="TOP" class="UtxtCheckLabels" style="font-size: 10pt; font-weight: bold;">Process Date:&nbsp;</td>
                                              </tr>
                                            </table>
                                          </td>
                                          <td align="CENTER" style="color: maroon; text-decoration: underline; font-size: 10pt; font-family: 'Times New Roman'; font-weight: bold;"> &nbsp;
                                            &nbsp;
                                                                          <% =MonthName(Month(Date),True) & " " & Day(Date) & ", " & Year(Date) %>
                                            &nbsp;</td>
                                        </tr>
                                      </table>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" height="7"> </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" width="408">
                                      <table width="408" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                          <td width="60" valign="BASELINE" class="UtxtCheckLabels" style="font-weight: normal">Pay to the<br>
                                            order of</td>
                                          <td valign="BOTTOM"> &nbsp;&nbsp;<b>Some Company, Inc. </b></td>
                                          <td width="90" valign="BOTTOM">
                                            <table width="90" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td width="10"> <b>$</b></td>
                                                <td>
                                                  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#808080" bordercolordark="#000000">
                                                    <tr>
                                                      <td align="CENTER">
                                                        <% =FormatNumber(CheckAmount) %>
                                                      </td>
                                                    </tr>
                                                  </table>
                                                </td>
                                              </tr>
                                            </table>
                                          </td>
                                        </tr>
                                        <tr>
                                          <td width="60"> </td>
                                          <td valign="TOP"> <img src="images/payline.gif" width="250" height="1" border="0"></td>
                                          <td> </td>
                                        </tr>
                                      </table>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" height="15" width="408"> </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" width="408">
                                      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="UtxtCheckLabels">
                                        <tr>
                                          <td valign="MIDDLE" align="RIGHT" width="70"> <b><font size="-1"> Bank Name&nbsp;&nbsp;</font></b></td>
                                          <td valign="MIDDLE" align="LEFT">
                                            <input type="TEXT" name="BankName" size="30" class="InputFields" value="<% =Request("BankName") %>">
                                          </td>
                                          <td valign="MIDDLE" colspan="2" align="RIGHT"><b><font size="-1">Account Type&nbsp;&nbsp;</font></b>
                                              <select name="AccountType" size="1" class="InputFields" id="AccountType" style="font-size: 11px">
                                                <option value="Empty" selected="SELECTED"> </option>
                                                <option value="Checking" &lt;%If Request("AccountType") = "Checking" Then %&gt;selected&lt;% End If %&gt;>Checking</option>
                                                <option value="Savings" &lt;%If Request("AccountType") = "Savings" Then %&gt;selected&lt;% End If %&gt;>Savings </option>
                                              </select>
                                            &nbsp; </td>
                                        </tr>
                                      </table>
                                    </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" height="14" width="408"> </td>
                                  </tr>
                                  <tr>
                                    <td></td>
                                    <td colspan="2" width="408">
                                      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="UtxtCheckLabels">
                                        <tr>
                                          <td width="130" align="CENTER"> <b><font size="-1">Routing Number</font></b></td>
                                          <td align="CENTER" width="170"> <b><font size="-1">Check Number</font></b></td>
                                          <td align="CENTER" width="159"> <b><font size="-1">Bank Account Number</font></b></td>
                                        </tr>
                                        <tr>
                                          <td align="CENTER">
                                            <table width="90" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td align="RIGHT" width="14"> <img src="images/rtnsym.gif" width="19" height="20" border="0"></td>
                                                <td align="CENTER" width="113">
                                                  <input type="TEXT" name="RoutingNumber" size="11" maxlength="9" class="InputFields" value="<% =Request("RoutingNumber") %>">
                                                </td>
                                                <td align="LEFT" width="14"> <img src="images/rtnsym.gif" width="19" height="20" border="0"></td>
                                              </tr>
                                            </table>
                                          </td>
                                          <td align="CENTER">
                                            <input type="TEXT" name="CheckNumber" size="10" class="InputFields" value="<% =Request("CheckNumber") %>">
                                          </td>
                                          <td align="CENTER">
                                            <input type="TEXT" name="AccountNumber" size="20" class="InputFields" value="<% =Request("AccountNumber") %>">
                                          </td>
                                        </tr>
                                      </table>
                                    </td>
                                  </tr>
                                </table>
                              </td>
                              <td><img src="images/SCCheck_Right.jpg" width="34" height="100%"></td>
                            </tr>
                            <tr>
                              <td colspan="3"><img src="images/SCCheck_Bottom.jpg" width="482" height="95"></td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                      </tr>
                      <tr>
                        <td>
                          <table width="580" height="159" border="1" align="center" cellpadding="2" cellspacing="0" bgcolor="#F0EFEC">
                            <tr>
                              <td width="467" height="30" bgcolor="#000066" class="UtxtWhiteHeader"> Check Authorization Agreement </td>
                            </tr>
                            <tr>
                              <td valign="top" class="UtxtDarkBlue" style="padding-top: 8px; padding-bottom: 10px; padding-left: 5px; padding-right: 5px"> I, <b>
                                <% =BillTo_FirstName & " " & BillTo_LastName %>
                                </b>, authorize <b>Some Company, Inc. </b> (the merchant) to submit an ACH or paper bank draft to the bank indicated above for the amount of this order. &nbsp;I acknowledge that the bank account information shown in the check
                                form above is accurate.<br>
                                                  <br>
                                If this item is dishonored due to non-sufficent funds, I authorize an additional debit of the above account for the maximum return check fee allowed by my state.&nbsp; My entry of the information above and the pressing of my
                                acceptance of this agreement below shall be my signature to execute this transaction.<br>
                                                  <br>
                                Remember to record this purchase in your check register. <br>
                                <br>
                                <br>
                                <div align="center">
                                  <input type="submit" 
                                              name="AcceptECheck" 
                                              value="I accept the terms of this Agreement">
                                </div>
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <% Else %>
          <tr>
            <td align="center" class="UtxtLargeMaroonHeader">
               <br>
              Put a payment confirmation, reciept, or other language here<br>
              to let your customer know their payment was successful.<br>
              <br>
              <br>
            </td>
          </tr>
          <% End If %>
        </table>
      </td>
      <td>&nbsp;</td>
</tr> <tr> <td height="20">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <% 'Set hidden variables with Billing & Shipping Data for PostBack %> <input type="hidden" name="BillTo_FirstName" value="<% =BillTo_FirstName %>"> <input type="hidden" name="BillTo_MiddleInitial" value="<% =BillTo_MiddleInitial %>"> <input type="hidden" name="BillTo_LastName" value="<% =BillTo_LastName %>"> <input type="hidden" name="BillTo_Company" value="<% =BillTo_Company %>"> <input type="hidden" name="BillTo_Address" value="<% =BillTo_Address %>"> <input type="hidden" name="BillTo_City" value="<% =BillTo_City %>"> <input type="hidden" name="BillTo_State" value="<% =BillTo_State %>"> <input type="hidden" name="BillTo_Zip" value="<% =BillTo_Zip %>"> <input type="hidden" name="BillTo_Country" value="<% =BillTo_Country %>"> <input type="hidden" name="BillTo_DaytimePhone" value="<% =BillTo_DaytimePhone %>"> <input type="hidden" name="BillTo_HomePhone" value="<% =BillTo_HomePhone %>"> <input type="hidden" name="BillTo_CellPhone" value="<% =BillTo_CellPhone %>"> <input type="hidden" name="BillTo_Email" value="<% =BillTo_Email %>"> <input type="hidden" name="ShipTo_FirstName" value="<% =ShipTo_FirstName %>"> <input type="hidden" name="ShipTo_MiddleInitial" value="<% =ShipTo_MiddleInitial %>"> <input type="hidden" name="ShipTo_LastName" value="<% =ShipTo_LastName %>"> <input type="hidden" name="ShipTo_Company" value="<% =ShipTo_Company %>"> <input type="hidden" name="ShipTo_Address" value="<% =ShipTo_Address %>"> <input type="hidden" name="ShipTo_City" value="<% =ShipTo_City %>"> <input type="hidden" name="ShipTo_State" value="<% =ShipTo_State %>"> <input type="hidden" name="ShipTo_Zip" value="<% =ShipTo_Zip %>"> <input type="hidden" name="ShipTo_Country" value="<% =ShipTo_Country %>"> <input type="hidden" name="ShipTo_DaytimePhone" value="<% =ShipTo_DaytimePhone %>"> <input type="hidden" name="ShipTo_HomePhone" value="<% =ShipTo_HomePhone %>"> <input type="hidden" name="ShipTo_CellPhone" value="<% =ShipTo_CellPhone %>"> <input type="hidden" name="ShipTo_Email" value="<% =ShipTo_Email %>"> <input type="hidden" name="FormPost" value="True"> </form> </body> </html>