%@ Language=VBScript %>
<%
'***************************************************************************
' FILENAME: $Workfile: payment_wait.asp $
' DESCRIPTION: This ASP page is the Confirm page in Events registration.
' CREATION DATE: Jan 18, 2001
' INITIAL AUTHOR: Jim Prucha
' LAST MODIFIED DATE: $Date: 10/05/03 2:33p $
' LAST MODIFIED BY: $Author: Nyepca1 $
' Copyright (C) 2001 TVisions Inc.
' Tvisions, Inc. Confidential
'***************************************************************************
%>
<% Option Explicit %>
<%
'Lets server know which security level we need http or https
setServerProtocol(SECURE)
'Buffer the output till we are done processing
Response.Buffer = True
Dim myRegistrant
Dim myEvent
Dim myOrder
Dim myEventMgr
Dim eventStatus
Dim myConst
Dim myPP
Dim paymentStatus
Dim dB
Dim strSQL
Set dB = Server.CreateObject("NYeCommerce.DBAccess")
Set myPP = Server.CreateObject("NYeCommerce.PaymentProcessor")
Set myConst = Server.CreateObject("NYeCommerce.nyConst")
Set myRegistrant = Server.CreateObject("NYeCommerce.Registrant")
Set myOrder = Server.CreateObject("NYeCommerce.Order")
'Retrieve the order, event and registrant info from session
myRegistrant.retrieveRegistrant "registerEvent"
myOrder.retrieveOrder "registerEvent"
Dim emailBody
Dim emailFrom
Dim emailSubject
Dim emailMsg
Set emailMsg = Server.CreateObject("CDONTS.NewMail")
emailFrom = Application("NYECOMM_ADMIN_EMAIL")
emailSubject = "Registration Confirmation"
emailBody = "Dear " & myRegistrant.getFirstName() & " " & myRegistrant.getLastName() & "," & vbCrLf & vbCrLf & "This email is to confirm receipt of payment for the New York eComm Ten Awards. We look forward to seeing you at the event. Please keep this email for your personal records." & vbCrLf & vbCrLf & "For information on upcoming events, please visit http://" & myConst.getServerName() & "/Events/Display/index.asp. If you would like information on company membership or future event sponsorships opportunities, please email mailto:sponsor@nyecomm.org." & vbCrLf & vbCrLf & "Sincerely," & vbCrLf & vbCrLf & "Jody Maier" & vbCrLf & "Chair, Programs Committee" & vbCrLf & "New York eComm"
If (Session("processing_payment") = False) Then
'payment processing has not started so begin payment processing
Session("processing_payment") = True
Session("number_payment_checks") = Session("number_payment_checks") + 1
If (CBool(Request.Form("reload")) and Session("number_payment_checks") >= 1) Then
'Send the new order to the payment processor
'Check to see if the registrant is member or there is a member cost.
If myOrder.getOrderTotal() <> 0 Then
paymentStatus = myPP.processOrder(myOrder)
Session("paymentStatus") = paymentStatus
Session("processing_payment") = False
myRegistrant.saveRegistrant("registerEvent")
myOrder.saveOrder "registerEvent"
'Find out the status of the payment processor
Select Case paymentStatus
Case myPP.PAYMENT_APPROVED
'Good status from the payment processor
'Send the email to the registrant
emailMsg.To = myRegistrant.getEmail()
emailMsg.From = emailFrom
emailMsg.Subject = emailSubject
emailMsg.BodyFormat = 1
emailMsg.Body = emailBody
emailMsg.Send
Set emailMsg = Nothing
'SQL
strSQL = "INSERT INTO TenAwards VALUES ('" & dB.sqlEncode(myRegistrant.getFirstName()) & "','"
strSQL = strSQL & dB.sqlEncode(myRegistrant.getLastName()) & "','"
strSQL = strSQL & dB.sqlEncode(myRegistrant.getCompanyName()) & "','"
strSQL = strSQL & dB.sqlEncode(myRegistrant.getEmail()) & "'," & Session("tenawards_singleQTY") & ","
strSQL = strSQL & Session("tenawards_tableQTY") & ")"
dB.tvi_Open(myConst.NYECOMMERCE_ADMIN_CONNECTION)
dB.tvi_ExecuteSql(strSQL)
dB.tvi_Close()
set dB = Nothing
Case myPP.PAYMENT_ERROR
Response.Write "We are unable to process payment at this time. Please try again later."
Response.End
End Select
End If
Set myOrder = Nothing
Set myPP = Nothing
End If
Else
'Payment processing has already started
'Check the status of the payment processor
If Session("paymentStatus") <> "NO_STATUS" Then
'Check to see if there was an error NOT payProc.PAYMENT_APPROVED
If Session("paymentStatus") <> myPP.PAYMENT_APPROVED Then
'Error status from payment processor
Response.Write "Unable to process payment at this time. Please try again later."
Response.End
Else
'Send to the thank you page
Response.Redirect "/tenawards/ThankYou.asp"
End If
End If
End If
%>