%
' Copyright (C) 1998-2005 Cyberstrong Internet Services, Inc. All Rights Reserved
'
' This file has been seeded with unique information at point of sale and
' is traceable to its purchaser.
'
' Your license agreement forbids the removal of this notice.
%>
<%
'
' CCAuth1.ASP - Prepare for CC Authorization Submission
'
Dim iPass, FormErrorMsg, rs
' Main ----------------------------------------------------------------
Public Sub Main()
Dim OrderID, UseGateway, SQL
Dim Result, Reason, AuthCode
Dim oGatewayParms, ReturnValue
' Confirm no session timeout ...
Call ConfirmSessionOk("OrderID")
' Send receipt to ...
Session("PmtGatewayReceiptTo") = SecureURL("46CCAuth.asp")
' Pickup order ID ...
OrderID = Session("OrderID")
FormErrorMsg = ""
Set Conn = dbOpen("rwl")
SQL = ""
SQL = SQL & "SELECT * FROM Orders, Customers, PaymentMethods "
SQL = SQL & "WHERE Orders.CustomerID = Customers.CustomerID "
SQL = SQL & "AND Orders.PaymentMethodDescription = PaymentMethods.PaymentMethod "
SQL = SQL & "AND OrderId = " & CleanSQL(OrderID, "i")
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, Conn, adOpenKeyset, adLockOptimistic
If (isInstalled("Payment Gateway:" & rs("PaymentGateway"))) Then
Set UseGateway = FeatureInstalled.Item("Payment Gateway:" & rs("PaymentGateway"))
' Next line for debug only ...
' Response.Write("UseGateway.Name: " & UseGateway.Name & "
" & vbCrLf)
Set oGatewayParms = New clsPaymentGatewayParms
' Load gateway parameters into local class, then launch the gateway ...
Call LoadGatewayParms(oGateWayParms, rs)
Call UseGateway.Connect(oGatewayParms, Result, Reason, AuthCode)
Set oGateWayParms = Nothing
rs.Close
Set rs = Nothing
If (Result = pmtApproved) Then
Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM Orders WHERE OrderID = " & CleanSQL(OrderID, "i")
rs.Open SQL, Conn, adOpenKeyset, adLockOptimistic
rs("CreditCardAuthorizationNumber") = AuthCode
rs("CreditCardAuthorizationDate") = Date()
rs.Update
' Call user exit on payment authorization ...
Call UserExit(usrPmtAuthorized, Conn, _
OrderID, _
rs("PaymentAmount"), _
rs, _
ReturnValue)
' Clear CC Info if enabled ...
If (cstDeleteCCInfoAfterUse) Then
Call ClearCCInfo(rs)
rs.Update
End If
rs.Close
Set rs = Nothing
End If
dbClose(Conn)
If (UseGateway.ConnectType = pmtDirect) Then
Call ReturnToCaller(Result, Reason, "d")
End If
Else
FormErrorMsg = FormErrorMsg & "CCAuth1.asp: Credit Card gateway could not be determined.
"
wl(FormErrorMsg)
Response.End
End If
End Sub
Call Main()
%>