CardEaseXML COM/ActiveX VB6 Example Code
Sub Main()
Dim CommandLineArgs() As String
CommandLineArgs = Split(Command, " ")
If Len(Command) = 0 Or UBound(CommandLineArgs) < 1 Then
Debug.Print ("Usage: " + App.EXEName + " TerminalID TransactionKey")
Debug.Print ("")
Debug.Print ("The TerminalID and TransactionKey are provided at registration:")
Debug.Print ("")
Debug.Print (" https://testwebmis.creditcall.com")
Debug.Print ("")
Debug.Print ("Press Enter to continue . . .")
Debug.Print ("")
Exit Sub
End If
Dim client As CClient
Set client = New CClient
' Setup the request
With client.Request
.SoftwareName = "SoftwareName"
.SoftwareVersion = "SoftwareVersion"
.TerminalID = CommandLineArgs(0)
.TransactionKey = CommandLineArgs(1)
' Setup the request detail
.RequestType = RequestType.Auth
.Amount = "123"
.PAN = "341111597241002"
.ExpiryDate = "2012"
End With
Debug.Print (client.Request.ToString())
' Setup the client
client.AddServerURL "https://test.cardeasexml.com/generic.cex", 45000
' Process the request
Dim ProcessResult As ProcessResult
ProcessResult = client.ProcessRequest()
If ProcessResult = ClientOK Then
Debug.Print (client.Response.ToString())
Else
Debug.Print ("CLIENT ERROR: " + client.LastErrorDescription)
Debug.Print ("REQUEST ERROR: " + client.Request.LastErrorDescription)
End If
End Sub
|