developer:threatmetrix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
developer:threatmetrix [2011/10/11 11:20]
irina [Dot Net DLL Integration]
developer:threatmetrix [2011/10/11 11:32]
irina [Dot Net DLL Integration]
Line 177: Line 177:
  
 Dim getSessionResult As New Dictionary(Of String, String) Dim getSessionResult As New Dictionary(Of String, String)
 +Dim sessionid As String
 +
 getSessionResult = usaepay.GetSessionId() getSessionResult = usaepay.GetSessionId()
             ​             ​
Line 182: Line 184:
     If Not getSessionResult.Count <=0 Then     If Not getSessionResult.Count <=0 Then
         If getSessionResult.ContainsKey("​sessionid"​) Then         If getSessionResult.ContainsKey("​sessionid"​) Then
-            ​usaepay.Session ​= getSessionResult.Item("​sessionid"​)+            ​sessionid ​= getSessionResult.Item("​sessionid"​)
             WebBrowser1.DocumentText = getSessionResult.Item("​html"​)             WebBrowser1.DocumentText = getSessionResult.Item("​html"​)
         End If         End If
Line 188: Line 190:
 End If End If
 </​code>​ </​code>​
 +
 +To submit the transaction with session variable:
 +<code vb>
 +Dim usaepay As USAePayAPI.USAePay = New USAePayAPI.USAePay
 +Dim message As String
 +usaepay.SourceKey = "​Your_source_key_here"​
 +usaepay.Pin = "​ABA123"​
 +usaepay.Session = sessionid ​
 +usaepay.Amount = 2.23
 +usaepay.Description = "A test transaction"​
 +usaepay.CardHolder = "Joe Schmoe"​
 +usaepay.CardNumber = "​4444555566667779"​
 +usaepay.CardExp = "​1212"​
 + 
 +Try
 +    usaepay.Sale()
 +    If usaepay.ResultCode = "​A"​ Then
 +        message = "​Transaction approved"​ & vbLf _
 +    & "Auth Code: " & usaepay.AuthCode & vbLf _
 +    & "Ref Num: " & usaepay.ResultRefNum & vbLf _
 +    & "AVS: " & usaepay.AvsResult & vbLf _
 +    & "CVV: " & usaepay.Cvv2Result
 +    ElseIf usaepay.ResultCode = "​D"​ Then
 + message = "​Transaction Declined"​ & vbLf _
 +    & "Ref Num: " & usaepay.ResultRefNum
 +    Else
 + message = "​Transaction Error" & vbLf _
 +    & "Ref Num: " & usaepay.ResultRefNum & vbLf _
 +    & "​Error:​ " & usaepay.ErrorMesg & vbLf _
 +    & "Error Code: " & usaepay.ErrorCode & vbLf
 +    End If
 +    ​
 +    If Not String.IsNullOrEmpty(usaepay.Session) Then
 +        message &= vbLf & vbLf & "​Profiler Score: " & usaepay.ProfilerScore & vbLf _
 +                & "​Profiler Response: " & usaepay.ProfilerResponse & vbLf _
 +                & "​Profiler Reason: " & usaepay.ProfilerReason & vbLf
 +    End If
 +    ​
 +    MsgBox(message)
 +    Catch ex As Exception
 +    MsgBox("​Caught Exception: " & ex.Message)
 +End Try
 +</code vb>
developer/threatmetrix.txt ยท Last modified: 2011/10/11 11:33 by irina

Page Tools