[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 499
  • Last Modified:

Microsoft VBScript compilation error '800a03f6'

Please help! I know I've just been staring at this code too long and am blind to what's causing the error, so I need a fresh set of eyes to look at it and tell me what syntax problem is causing this error. I'm getting the following error:

Microsoft VBScript compilation error '800a03f6'

Expected 'End'

/pending/process.asp, line 109


On the following script:

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

'********************************************************************
' Name: UpgiClient_Test
'
' Purpose: Test the UpgiClient Automation component with an ASP page
'********************************************************************
Option Explicit

'********************************************************************
' Global Variables
'********************************************************************
Dim PropertyVals
Dim ApprovalVals
Dim UpgiClient
Dim cart_order_id

cart_order_id = Request.Form("cart_order_id")

Set UpgiClient = Server.CreateObject("UpgiClient.Payment")

'---------------------------------------
'Set the UpgiClient component properties
'---------------------------------------

'Setting TestOverrideErrors ensures test authorization
UpgiClient.TestOverrideErrors = true

'Required properties
UpgiClient.UserName = "username"
UpgiClient.PW = "password"
UpgiClient.TranType = "Sale"
UpgiClient.FullTotal = "1.00"
'UpgiClient.FullTotal = Request.Form("total")
UpgiClient.CCNumber = Request.Form("x_card_num")
UpgiClient.CardType = Request.Form("cardtype")
UpgiClient.Month = Request.Form("month")
UpgiClient.Year = Request.Form("year")
UpgiClient.CCName = Request.Form("x_first_name") & " " & Request.Form("x_last_name")

'Optional properties
UpgiClient.CCIdentifier = Request.Form("x_card_code")
UpgiClient.NotifyEmail = Request.Form("x_email")
UpgiClient.BillingAddress1 = Request.Form("x_address")
'UpgiClient.BillingAddress2 = Request.Form("x_card_code")
UpgiClient.BillingCity = Request.Form("x_city")
UpgiClient.BillingState = Request.Form("x_state")
UpgiClient.BillingZip = Request.Form("x_zip")
UpgiClient.BillingPhone = Request.Form("x_phone")
UpgiClient.BillingCountry = "US"

call SetPropertyDisplay

'********************************************************************
' Subroutines
'********************************************************************
sub SetApprovalDisplay()

ApprovalVals = "Transaction ID = " & UpgiClient.AnaTransID & vbcrlf
ApprovalVals = ApprovalVals & UpgiClient.Approval & vbcrlf
ApprovalVals = ApprovalVals & UpgiClient.ErrorString & vbcrlf & vbcrlf
end sub

sub SetPropertyDisplay()

'build the display string for current values
PropertyVals = "TestOverriderErrors = " & UpgiClient.TestOverrideErrors & vbcrlf & vbcrlf
PropertyVals = PropertyVals & "UserName = " & UpgiClient.UserName & vbcrlf
PropertyVals = PropertyVals & "PW = " & UpgiClient.PW & vbcrlf
PropertyVals = PropertyVals & "TranType = " & UpgiClient.TranType & vbcrlf
PropertyVals = PropertyVals & "FullTotal = " & UpgiClient.FullTotal & vbcrlf
PropertyVals = PropertyVals & "CCNumber = " & UpgiClient.CCNumber & vbcrlf
PropertyVals = PropertyVals & "CardType = " & UpgiClient.CardType & vbcrlf
PropertyVals = PropertyVals & "Month = " & UpgiClient.Month & vbcrlf
PropertyVals = PropertyVals & "Year = " & UpgiClient.Year & vbcrlf
PropertyVals = PropertyVals & "CCName = " & UpgiClient.CCName & vbcrlf
PropertyVals = PropertyVals & "CCIdentifier = " & UpgiClient.CCIdentifier & vbcrlf
PropertyVals = PropertyVals & "NotifyEmail = " & UpgiClient.NotifyEmail & vbcrlf
PropertyVals = PropertyVals & "BillingAddress1 = " & UpgiClient.BillingAddress1 & vbcrlf
'PropertyVals = PropertyVals & "BillingAddress2 = " & UpgiClient.BillingAddress2 & vbcrlf
PropertyVals = PropertyVals & "BillingCity = " & UpgiClient.BillingCity & vbcrlf
end sub


Sub ProcessAuthorization()

'Response.Write("Processing authorization ... <br>")
UpgiClient.ProcessTransaction

'if err.number <> 0 then
'Response.Write "Error " & err.number & "<br>"
'Response.Write err.description
'Else
'Response.Write "<br>No Errors<br>"
'end if

call SetPropertyDisplay
call SetApprovalDisplay

'Set UpgiClient = Nothing

End Sub

%>
<SCRIPT RUNAT="SERVER" LANGUAGE="VBScript">
Sub submitVals()
Call RunPaymentClass
End Sub
</SCRIPT>
<%
Response.Write("Processing transaction. This may take a few minutes. Please do not close or refresh this page or click the back button.")
%>
            <%
ProcessAuthorization
%>
<%
'see if the transaction has been approved
      Dim ordernum
      Dim approval_code
      Dim msg
      Dim success
      
      ordernum=UpgiClient.AnaTransID
      approval_code=UpgiClient.Approval
      
      if len(approval_code) > 0 then
            success=1
            msg="<p>Thank you! Your payment has been accepted and your account has been credited. Your approval code is <b>" & ordernum & "</b></p><p>An e-mail receipt has been sent to the address you provided. If you have any questions, please contact NutraPacHealth at <a href='mailto:billing@nutrapachealth.com'>billing@nutrapachealth.com.</a></p>"
      end if
      if len(approval_code) = 0 then
            success=0
            msg="<p>I'm sorry, but there was an error and we were unable to process your transaction. The following is the reason provided by the processor:</p><blockquote><p><b>" & UpgiClient.ErrorString & "</b></p></blockquote><p>If you have any questions, please contact NutraPacHealth at <a href='mailto:billing@nutrapachealth.com'>billing@nutrapachealth.com.</a></p>"
            response.redirect "http://www.nutrapachealth.com/pending/success.php?msg=" & msg
      end if

'process if successful
      if success = "1" then
                  Dim objConn
            'connect to database      
                  'REM Make the NutraPac database(SQL Server2000) connection
                  Set objConn = Server.CreateObject("ADODB.Connection")
                  objConn.connectionString = "DSN=dsn; User ID=username; Password=password;"
                  objConn.Open update_cust_query
                  objConn.close
                  objConn.Open update_query
            'insert order
            Dim order_date
            order_date=year(now) & "-" & month(now) & "-" & day(now)
                  Dim update_cust_query
                  update_cust_query="UPDATE table SET fullname='" & UpgiClient.CCName & "', " _
                  & "billing_address1='" & UpgiClient.BillingAddress1 & "', " _
                  & "billing_city='" & UpgiClient.BillingCity & "', " _
                  & "billing_state='" & UpgiClient.BillingState & "', " _
                  & "billing_zip='" & UpgiClient.BillingZip & "', " _
                  & "billing_country='" & UpgiClient.BillingCountry & "', " _
                  & "phone='" & UpgiClient.BillingPhone & "', " _
                  & "email='" & UpgiClient.NotifyEmail & "', " _
                  & "order_date='" & order_date & "', " _
                  & "order_num='" & ordernum & "', " _
                  & "approval_code='" & approval_code & "', " _
                  & "WHERE order_id='" & cart_order_id & "'"
                  objConn.Execute update_cust_query
            'update session info
                  Dim update_query
                  update_query="UPDATE sessions SET exp='Y' WHERE session_id='" & cart_order_id & "'"
                  objConn.Execute update_query
                  objConn.close
                  SET objConn = nothing            
                  response.redirect "http://www.nutrapachealth.com/pending/success.php?success=1&msg=" & msg
%>
0
Kezzas2
Asked:
Kezzas2
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
If that's your exact code, where's youor "end if" for this line:
if success = "1" then
0
 
Kezzas2Author Commented:
Awesome, thanks!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now