MS ACcess and Authorize.net (1 Viewer)

rkulik

New member
Local time
Today, 17:38
Joined
Apr 26, 2001
Messages
5
I have the following code from Authorize.net which allows the connection via
ssl from your apps to their processing center....however I can not get it to
work. I am new to this so that is half the problem. (THIS IS ACTUALLY VB
CODE"

Any help or direction will be appreciated

'Create the COM object

Dim MyObj

Set MyObj = Server.CreateObject("AuthNetSSLConnect.SSLPost")

'Create the transaction info string

Dim Login, Amount, CardNum, ExpDate, PostData

Login = "testing" : Amount = "1.00" : ExpDate = "11/01" : CardNum =
"4000000000000002"

PostData = "x_Login=" & Login & ",x_Card_Num=" & CardNum

PostData = PostData & ",x_Exp_Date=" & ExpDate & ",x_Amount=" & Amount

'Send the transaction info string

MyObj.doSSLPost PostData

' Check the ErrorCode to make sure that the component was able to talk to
the authorization network

If MyObj.ErrorCode = 0 Then

'Make sure that there was a delimited response

If MyObj.NumFields > 1 Then

ResponseCode = MyObj.GetField(1)

ResponseReasonText = MyObj.GetField(4)

If ResponseCode = 1 Then

Response.Write("Thank you for your purchase.")

Else

Response.Write("I am sorry but the transaction could not be approved:
" & ResponseReasonText )

End If

Else

Response.Write("I am sorry but the transaction could not be approved: "
& MyObj.Response )

End If

Else

Select Case MyObj.ErrorCode

Case -1

strErrorMessage = "Sorry, a connection could not be established with
the authorization network. Please try again later."

Case -2

strErrorMessage = "Sorry, a connection could not be established with
the authorization network. Please try again later."

Case -3

strErrorMessage = "Sorry, a connection could not be established with
the authorization network. Please try again later."

Case Else

strErrorMessage = "An error occured during processing, please contact
the merchant to see whether or not your transaction was processed."

End Select

Response.Write(strErrorMessage)

End If
 

Users who are viewing this thread

Top Bottom