<% Server.ScriptTimeout = 22000 %> <% Dim action Dim ReturnCode Dim ErrorText Dim eMessage action = Request("action") Select Case action Case "choosemethod" If Request("Recurring") = "on" Then Session("Recurring") = True Else Session("Recurring") = False End If Select Case Request("billmethod") Case "CREDIT" ShowCreditForm Case Else ShowStart End Select Case "paybill" 'check for required fields If Trim(Request("Cust")) = "" Then ErrorText = "You forgot to enter your customer number." End If If Trim(Request("Invoice")) = "" Then ErrorText = "You forgot to enter your invoice number." End If If Trim(Request("ccAmount")) = "" Then ErrorText = "You forgot to enter the amount of the invoice." End If If Trim(Request("FullName")) = "" Then ErrorText = "You forgot to enter your full name." End If If Trim(Request("Address")) = "" Then ErrorText = "You forgot to enter your address." End If If Trim(Request("City")) = "" Then ErrorText = "You forgot to enter your city." End If If Trim(Request("State")) = "" Then ErrorText = "You forgot to enter your state." End If If Trim(Request("ZipCode")) = "" Then ErrorText = "You forgot to enter your zip code." End If If Trim(Request("ccNumber")) = "" Then ErrorText = "You forgot to enter your credit card number." End If 'ErrorText = ErrorText & "No Error
" If ErrorText <> "" Then ShowCreditForm Response.End End If ReturnCode = ProcessSale() If ReturnCode <> "APPROVED" Then ErrorText = "The credit card you entered could not be authorized, please try another card. " ShowCreditForm Response.End End If 'log transaction to sql Set rs = Server.CreateObject("ADODB.RecordSet") SQL = "SELECT TOP 1 * FROM Trans" rs.Open SQL, Conn, 1, 3 rs.AddNew rs("Invoice") = Int(Trim(Replace(Request("Invoice"),chr(34),""))) rs("InvDate") = FormatDateTime(Date(),vbShortDate) rs("Cust") = Trim(Replace(Request("Cust"),chr(34),"")) rs("FullName") = Trim(Replace(Request("FullName"),chr(34),"")) rs("FirstName") = "" rs("LastName") = "" rs("Address") = Trim(Replace(Request("Address"),chr(34),"")) rs("Address2") = Trim(Replace(Request("Address2"),chr(34),"")) rs("City") = Trim(Replace(Request("City"),chr(34),"")) rs("State") = Trim(Replace(Request("State"),chr(34),"")) rs("ZipCode") = Trim(Replace(Request("ZipCode"),chr(34),"")) rs("Country") = "USA" rs("Phone") = Trim(Replace(Request("Phone"),chr(34),"")) rs("Fax") = "" rs("ccNumber") = Trim(Replace(Request("ccNumber"),chr(34),"")) rs("ccMonth") = Trim(Replace(Request("ccMonth"),chr(34),"")) rs("ccYear") = Trim(Replace(Request("ccYear"),chr(34),"")) rs("ccAmount") = Abs(Trim(Replace(Request("ccAmount"),chr(34),""))) rs("Salesman") = "BP" rs("ccResult") = ReturnCode rs("ccType") = Mid(Trim(Replace(Request("ccNumber"),chr(34),"")),1,1) rs("RunDate") = FormatDateTime(Date(),vbShortDate) rs.Update Set rs = Nothing If Session("Recurring") Then eMessage = "" eMessage = eMessage & "Invoice #: " & Int(Trim(Replace(Request("Invoice"),chr(34),""))) & vbcrlf eMessage = eMessage & "Date: " & FormatDateTime(Date(),vbShortDate) & vbcrlf eMessage = eMessage & "Customer #: " & Trim(Replace(Request("Cust"),chr(34),"")) & vbcrlf eMessage = eMessage & "Full Name: " & Trim(Replace(Request("FullName"),chr(34),"")) & vbcrlf eMessage = eMessage & "Address: " & Trim(Replace(Request("Address"),chr(34),"")) & vbcrlf eMessage = eMessage & "Address2: " & Trim(Replace(Request("Address2"),chr(34),"")) & vbcrlf eMessage = eMessage & "City: " & Trim(Replace(Request("City"),chr(34),"")) & vbcrlf eMessage = eMessage & "State: " & Trim(Replace(Request("State"),chr(34),"")) & vbcrlf eMessage = eMessage & "Zip Code: " & Trim(Replace(Request("ZipCode"),chr(34),"")) & vbcrlf eMessage = eMessage & "Phone: " & Trim(Replace(Request("Phone"),chr(34),"")) & vbcrlf 'eMessage = eMessage & "Check #: " & Trim(Replace(Request("checkno"),chr(34),"")) 'eMessage = eMessage & "Routing #: " & Trim(Replace(Request("route"),chr(34),"")) 'eMessage = eMessage & "MICR: " & Trim(Replace(Request("acctnum"),chr(34),"")) eMessage = eMessage & "ccNumber: " & Trim(Replace(Request("ccNumber"),chr(34),"")) & vbcrlf eMessage = eMessage & "ccMonth: " & Trim(Replace(Request("ccMonth"),chr(34),"")) & vbcrlf eMessage = eMessage & "ccYear: " & Trim(Replace(Request("ccYear"),chr(34),"")) & vbcrlf eMessage = eMessage & "Amount: " & Abs(Trim(Replace(Request("ccAmount"),chr(34),""))) & vbcrlf eMessage = eMessage & "Salesman: " & "BP" & vbcrlf eMessage = eMessage & "Return Code: " & ReturnCode & vbcrlf 'SendEmail(eMessage) myMail(eMessage) End If ShowThankYou Response.End Case "paycheck" 'check for required fields If Trim(Request("Cust")) = "" Then ErrorText = "You forgot to enter your customer number." End If If Trim(Request("Invoice")) = "" Then ErrorText = "You forgot to enter your invoice number." End If If Trim(Request("ccAmount")) = "" Then ErrorText = "You forgot to enter the amount of the invoice." End If If Trim(Request("FullName")) = "" Then ErrorText = "You forgot to enter your full name." End If If Trim(Request("Address")) = "" Then ErrorText = "You forgot to enter your address." End If If Trim(Request("City")) = "" Then ErrorText = "You forgot to enter your city." End If If Trim(Request("State")) = "" Then ErrorText = "You forgot to enter your state." End If If Trim(Request("ZipCode")) = "" Then ErrorText = "You forgot to enter your zip code." End If If Trim(Request("checkno")) = "" Then ErrorText = "You forgot to enter a check number." End If If Trim(Request("route")) = "" Then ErrorText = "You forgot to enter a routing number." End If If Trim(Request("acctnum")) = "" Then ErrorText = "You forgot to enter your account number." End If 'ErrorText = ErrorText & "No Error
" If ErrorText <> "" Then ShowCheckForm Response.End End If ReturnCode = ProcessCheckSale() Response.Write "

" & ErrorText & "

" If ReturnCode <> "APPROVED" Then ErrorText = "The checking account you entered could not be authorized, please try another account." 'ErrorText = ReturnCode ShowCheckForm Response.End End If 'log transaction to sql Set rs = Server.CreateObject("ADODB.RecordSet") SQL = "SELECT TOP 1 * FROM Trans" rs.Open SQL, Conn, 1, 3 rs.AddNew rs("Invoice") = Int(Trim(Replace(Request("Invoice"),chr(34),""))) rs("InvDate") = FormatDateTime(Date(),vbShortDate) rs("Cust") = Trim(Replace(Request("Cust"),chr(34),"")) rs("FullName") = Trim(Replace(Request("FullName"),chr(34),"")) rs("FirstName") = "" rs("LastName") = "" rs("Address") = Trim(Replace(Request("Address"),chr(34),"")) rs("Address2") = Trim(Replace(Request("Address2"),chr(34),"")) rs("City") = Trim(Replace(Request("City"),chr(34),"")) rs("State") = Trim(Replace(Request("State"),chr(34),"")) rs("ZipCode") = Trim(Replace(Request("ZipCode"),chr(34),"")) rs("Country") = "USA" rs("Phone") = Trim(Replace(Request("Phone"),chr(34),"")) rs("Fax") = "" rs("checkno") = Trim(Replace(Request("checkno"),chr(34),"")) rs("route") = Trim(Replace(Request("route"),chr(34),"")) rs("acctnum") = Trim(Replace(Request("acctnum"),chr(34),"")) 'rs("ccNumber") = Trim(Replace(Request("ccNumber"),chr(34),"")) 'rs("ccMonth") = Trim(Replace(Request("ccMonth"),chr(34),"")) 'rs("ccYear") = Trim(Replace(Request("ccYear"),chr(34),"")) rs("ccAmount") = Abs(Trim(Replace(Request("ccAmount"),chr(34),""))) rs("Salesman") = "BP" rs("ccResult") = ReturnCode rs("ccType") = 0 rs("RunDate") = FormatDateTime(Date(),vbShortDate) rs.Update Set rs = Nothing If Session("Recurring") Then eMessage = "" eMessage = eMessage & "Invoice #: " & Int(Trim(Replace(Request("Invoice"),chr(34),""))) & vbcrlf eMessage = eMessage & "Date: " & FormatDateTime(Date(),vbShortDate) & vbcrlf eMessage = eMessage & "Customer #: " & Trim(Replace(Request("Cust"),chr(34),"")) & vbcrlf eMessage = eMessage & "Full Name: " & Trim(Replace(Request("FullName"),chr(34),"")) & vbcrlf eMessage = eMessage & "Address: " & Trim(Replace(Request("Address"),chr(34),"")) & vbcrlf eMessage = eMessage & "Address2: " & Trim(Replace(Request("Address2"),chr(34),"")) & vbcrlf eMessage = eMessage & "City: " & Trim(Replace(Request("City"),chr(34),"")) & vbcrlf eMessage = eMessage & "State: " & Trim(Replace(Request("State"),chr(34),"")) & vbcrlf eMessage = eMessage & "Zip Code: " & Trim(Replace(Request("ZipCode"),chr(34),"")) & vbcrlf eMessage = eMessage & "Phone: " & Trim(Replace(Request("Phone"),chr(34),"")) & vbcrlf eMessage = eMessage & "Check #: " & Trim(Replace(Request("checkno"),chr(34),"")) & vbcrlf eMessage = eMessage & "Routing #: " & Trim(Replace(Request("route"),chr(34),"")) & vbcrlf eMessage = eMessage & "MICR: " & Trim(Replace(Request("acctnum"),chr(34),"")) & vbcrlf 'eMessage = eMessage & "ccNumber: " & Trim(Replace(Request("ccNumber"),chr(34),"")) 'eMessage = eMessage & "ccMonth: " & Trim(Replace(Request("ccMonth"),chr(34),"")) 'eMessage = eMessage & "ccYear: " & Trim(Replace(Request("ccYear"),chr(34),"")) eMessage = eMessage & "Amount: " & Abs(Trim(Replace(Request("ccAmount"),chr(34),""))) & vbcrlf eMessage = eMessage & "Salesman: " & "BP" & vbcrlf eMessage = eMessage & "Return Code: " & ReturnCode & vbcrlf 'SendEmail(eMessage) myMail(eMessage) End If ShowThankYou Response.End Case Else ShowStart End Select Sub ShowStart %> EZ2 Network, Inc. - Online Bill Pay
  Welcome to EZ2 Network's Online BillPay. You can pay your EZ2 Network invoice using your credit card or checking account.

 

Pay an invoice using a credit card
  Recurring automatic payment

 

If you would like to sign up for a new EZ2 Network account, please use our online signup.

 
   
<% End Sub Sub ShowCreditForm %> EZ2 Network, Inc. - Online Bill Pay
Customer # <% If Trim(Request("Cust")) = "" Then %> <% Else %> <% = Trim(Request("Cust")) %> "> <% End If %>
Invoice Number <% If Trim(Request("Invoice")) = "" Then %> <% Else %> <% = Trim(Request("Invoice")) %> "> <% End If %>
Invoice Amount <% If Trim(Request("ccAmount")) = "" Then %> <% Else %> <% = FormatCurrency(Trim(Request("ccAmount"))) %> "> <% End If %>
<% If ErrorText <> "" Then %> <% = ErrorText %>

<% End If %>
Name " size="30">
Address " size="30">
Address (cont.) " size="30">
City " size="30">
State " maxlength="2" size="3">
Zip Code " size="30">
Card Number " size="30">
Card Expiration /

   
<% End Sub Sub ShowThankYou %> EZ2 Network, Inc. - Online Bill Pay
  Your request has been processed, please allow up to 24 hours for your account to be credited.

Thank you for using Online BillPay.

EZ2 Network Home

 
   
 
<% End Sub Function SelOption(byVal curVal, reqVal) If curVal = reqVal Then SelOption = " SELECTED" Else SelOption = "" End If End Function %> <% Function ProcessSale() ParseFormData 'Dim strURL 'Dim strResultMessage 'strURL = "?ssl_merchant_id=405169" 'strURL = strURL & "&ssl_user_id=ez2net" 'strURL = strURL & "&ssl_pin=L4C81Q" 'strURL = strURL & "&ssl_amount=" & total 'strURL = strURL & "&ssl_invoice_number=1" 'strURL = strURL & "&ssl_salestax=0" 'strURL = strURL & "&ssl_card_number=" & cardnumber 'strURL = strURL & "&ssl_exp_date=" & expmonth & expyear 'MMYY 'strURL = strURL & "&ssl_show_form=false" 'strURL = strURL & "&ssl_cvv2=Bypassed" 'strURL = strURL & "&ssl_avs_address=" & Server.URLEncode(baddr1) 'strURL = strURL & "&ssl_avs_zip=" & bzip 'strURL = strURL & "&ssl_customer_code=1" 'strURL = strURL & "&ssl_description=" & oid 'strURL = strURL & "&ssl_city=" & Server.URLencode(bcity) 'strURL = strURL & "&ssl_state=" & Server.URLencode(bstate) 'strURL = strURL & "&ssl_phone=" & Server.URLencode(bphone) 'strURL = strURL & "&ssl_company=" & Server.URLencode(bname) 'strURL = strURL & "&ssl_result_format=ASCII" 'Set HttpObj = Server.CreateObject("MSXML2.XMLHTTP") 'HttpObj.open "POST", "https://www.viaKLIX.com/process.asp" & strURL, False 'HttpObj.send 'strResponse = HttpObj.responseText 'Results = Split(strResponse,vbcrlf) 'For i = 0 to Ubound(Results) - 1 'ssl_result_message=APPROVED 'If Instr(1,Results(i),"ssl_result_message") <> 0 Then 'strResultMessage = Mid(Results(i),Instr(1,Results(i),"=") + 1) 'End If 'Next 'If Trim(strResultMessage) = "" Then 'ProcessSale = "DECLINED" 'Else 'ProcessSale = strResultMessage 'End If Dim strURL Dim strResultMessage strURL = "M_id=596893488844" strURL = strURL & "&M_key=Q3C7K5T5I5W5" strURL = strURL & "&C_name=" & Server.URLencode(bname) strURL = strURL & "&C_address=" & Server.URLencode(baddr1) strURL = strURL & "&C_city=" & Server.URLencode(bcity) strURL = strURL & "&C_state=" & Server.URLencode(bstate) strURL = strURL & "&C_zip=" & bzip strURL = strURL & "&C_country=" & "US" strURL = strURL & "&C_cardnumber=" & cardnumber strURL = strURL & "&C_exp=" & expmonth & expyear 'MMYY strURL = strURL & "&T_customer_number=" & bcompany strURL = strURL & "&T_code=" & "01" strURL = strURL & "&T_amt=" & total 'request = "M_id=" & "Insert Merchant ID" 'request = request & "&" & "M_key=" & "Insert Merchant Key" 'request = request & "&" & "C_name=" & "John Doe" 'request = request & "&" & "C_address=" & "1234 AnyStreet" 'request = request & "&" & "C_city=" & "AnyTown" 'request = request & "&" & "C_state=" & "TX" 'request = request & "&" & "C_zip=" & "12345" 'request = request & "&" & "C_country=" & "US" 'request = request & "&" & "C_email=" & "none@none.com" 'request = request & "&" & "C_cardnumber=" & "4111111111111111" 'request = request & "&" & "C_exp=" & "0109" 'request = request & "&" & "T_code=" & "01" 'request = request & "&" & "T_amt=" & "1.00" Set HttpObj = Server.CreateObject("Microsoft.XMLHTTP") 'HttpObj.open "POST", "https://www.viaKLIX.com/process.asp" & strURL, False HttpObj.open "POST", "https://www.sagepayments.net/cgi-bin/eftBankcard.dll?transaction", False HttpObj.send strURL strResponse = HttpObj.responseText If Trim(strResponse) <> "" Then If Mid(strResponse, 2, 1) = "A" Then strResultMessage = "APPROVED" Else strResultMessage = strResponse End If Else strResultMessage = strResponse End If 'Results = Split(strResponse,vbcrlf) 'Wscript.Echo strURL 'For i = 0 to Ubound(Results) - 1 'ssl_result_message=APPROVED 'If Instr(1,Results(i),"ssl_result_message") <> 0 Then 'strResultMessage = Mid(Results(i),Instr(1,Results(i),"=") + 1) 'End If 'Next 'Wscript.Echo strResultMessage If Trim(strResultMessage) <> "APPROVED" Then ProcessSale = "DECLINED" Else ProcessSale = Mid(Trim(strResultMessage),1,200) End If End Function Function ProcessSaleOld ParseFormData ' Create an empty order Set order = CreateObject("LpiCom_6_0.LPOrderPart") order.setPartName("order") ' Create an empty part Set op = CreateObject("LpiCom_6_0.LPOrderPart") ' Build 'orderoptions' res=op.put("ordertype", "SALE") ' add 'orderoptions to order res=order.addPart("orderoptions", op) ' Build 'merchantinfo' res=op.clear() res=op.put("configfile", configfile) ' add 'merchantinfo to order res=order.addPart("merchantinfo", op) ' Build 'billing' ' Required for AVS. If not provided, ' transactions will downgrade. res=op.clear() res=op.put("userid", userid) res=op.put("name", bname) res=op.put("company", bcompany) res=op.put("address1", baddr1) res=op.put("address2", baddr2) res=op.put("city", bcity) res=op.put("state", bstate) ' Required for AVS. If not provided, ' transactions will downgrade. res=op.put("zip", bzip) res=op.put("addrnum", baddrnum) res=op.put("country", bcountry) res=op.put("phone", bphone) res=op.put("fax", bfax) res=op.put("email", bemail) ' add 'billing to order res=order.addPart("billing", op) ' Build 'creditcard' res=op.clear() res=op.put("cardnumber", cardnumber) res=op.put("cardexpmonth", expmonth) res=op.put("cardexpyear", expyear) ' add 'creditcard to order res=order.addPart("creditcard", op) ' Build 'payment' res=op.clear() res=op.put("chargetotal", total) ' add 'payment to order res=order.addPart("payment", op) ' Add oid res=op.clear() res=op.put("oid", oid) ' add 'transactiondetails to order res=order.addPart("transactiondetails", op) res=op.clear() res=op.put("comments", comments) 'res=op.put("referred", referred) res=order.addPart("notes", op) ' create transaction object Set LPTxn = CreateObject("LpiCom_6_0.LinkPointTxn") if (fLog = True) and ( logLvl > 0 ) Then Dim res1, resDesc 'Next call return level of accepted logging in 'res1' 'On error 'res1' contains negative number 'You can check 'resDesc' to get error description 'if any res = LPTxn.setDbgOpts(logFile,logLvl,resDesc,res1) End If ' get outgoing XML from 'order' object Dim outXml, resp outXml = order.toXML() ' Call LPTxn resp = LPTxn.send(keyfile, host, port, outXml) 'Store transaction data on Session and redirect 'Session("outXml") = outXml 'Session("resp") = resp Set LPTxn = Nothing Set order = Nothing Set op = Nothing 'R_Approved = ParseTag("r_approved", resp) ProcessSaleOld = ParseTag("r_approved", resp) End Function Function AddError(byVal Errata) ErrorText = ErrorText & Errata & "
" & vbcrlf AddError = "" End Function Function myMail(byVal Message) Set myMail=CreateObject("CDO.Message") myMail.Subject="Add Customer to Recurring Billing" myMail.From="acct@ez2.net" myMail.To="acct@ez2.net" myMail.Bcc="mibrahim@ez2.net" myMail.TextBody = Message myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 'Name or IP of remote SMTP server myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="mail2.ez2.net" 'Server port myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=587 myMail.Configuration.Fields.Update myMail.Send set myMail=nothing End Function 'Function SendEmail(byVal Message) ' Set sm = Server.CreateObject("ABMailer.Mailman") ' sm.clear ' sm.MailDate = FormatDateTime(Date() & " " & Time(),vbGeneralDate) ' sm.MailSubject = "Add customer to recurring billing" ' sm.FromAddress = "acct@ez2.net" ' sm.FromName = "Online Billpay" ' sm.ReplyTo = "acct@ez2.net" ' sm.SendTo = "acct@ez2.net" ' sm.ServerAddr = "mail.ez2.net" ' sm.ServerPort = 587 ' sm.XPriority = 2 ' sm.MailMessage = Message ' sm.SendMail ' ' result = sm.ErrorCode ' ' Set sm = Nothing ' ' SendEmail = result 'End Function %>