%@ LANGUAGE=vbscript %>
<%
'
' NAME
' ====
' SSL_DO.asp
'
' PURPOSE
' =======
' Creates a Digital Order and sends it to the Payment Server.
'
'
' ErrorCode Values
' ================
' 10 Payment Client has not initialised correctly.
' - Check the installation of the payment client.
' 11 Digital Order has not created correctly.
' - Check input parameters.
'
' VARIABLES
' =========
'
' Initialisation
' ==============
' Define the error constants
const No_Error = 0
const ERR_PayClient = 10
const ERR_DigitalOrder = 11
dim errmsg
' Define Error Handler
sErrorPage = "/inc/commoninc/Error.asp"
' Initialise ErrorCode - set to No Errors
nErrorCode = No_Error
sException = ""
' Turn off default error checking, as any errors are explicitly handled
on error resume next
' Stop the page being cached on the web server
Response.Expires = 0
' Retrieve input variables from the prior form
sSessionID = Request.Form("SessionID")
sMerchantID = Request.Form("MerchantID")
sPurchaseAmount = Request.Form("PurchaseAmount")
sLocale = Request.Form("Locale")
sReturnURL = Request.Form("ReturnURL")
'response.write sReturnURL
'response.end
' The amount must be converted to a long for processing
lAmount = CLng(sPurchaseAmount)
'response.end
Dim oPostLib
Set oPostLib = New PostLib
Dim oCI, oMPI, oMerchant, oBTA, oSTA
Set oCI = New CardInfo
Set oMPI = New MPIData
Set oMerchant = New Merchant
'************************
'Function Set Merchant Details
'merchantid
'vendor same as merchant id
'partner same as merchant
' ip '' captured by payment gateway
'trans ref. no. 'y'
'order no. for self ref.'n'
'url for redirection
'http method from ssl post/get
'currency 'INR'
'invoice no. 'N'
'req.Preauthorization
'amount
'
'***********************
oMerchant.setMerchantDetails "00001183","00001183","00001183","",sSessionID,"",sReturnURL,"GET","INR","","req.Preauthorization",lAmount,"GMT+05:30","Ext1","Ext2","Ext3","Ext4","Ext5"
oMPI.setMPIRequestDetails lAmount,"INR 1500.00","356","2","Membership Fees","","","","0","","image/gif, image/x-xbitmap, image/jpeg,image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"
Dim oPGResp
Set oPGResp=oPostLib.postSSL (oMPI,oMerchant,"","")
If oPGResp.getRedirectionUrl() <> "" Then
strResponseURL=oPGResp.getRedirectionUrl()
'response.write strResponseURL
'response.end
Response.Redirect strResponseURL
else
nErrorCode=oPgResp.getRespCode()
DetermineError
' Pass control to the error handler
sErrorPage = sErrorPage & "?errorno="&errmsg & _
"§ion="&server.URLEncode ("Associate Member Registration")
Response.Redirect sErrorPage
'Response.Write "Response code:" & oPgResp.getRespCode() & "
"
'Response.Write "Response message:" & oPgResp.getRespMessage() & "
"
End If
Sub DetermineError()
'
' ErrorCode Values
' ================
' 10 Payment Client has not initialised correctly.
' - Check the installation of the payment client.
' 11 Digital Order has not created correctly.
' - Check input parameters.
Select Case nErrorCode
Case "10" errmsg="PC1"
Case "11" errmsg="PC2"
Case Else errmsg="Payment Client Error unable to be determined."
End Select
End Sub
%>