VB code snippet for using the careCreditResponseManager


Private Sub CareCreditResponseExampleButton_Click()

On Error GoTo Err_Trap

Dim bStatus As Boolean

'### CareCreditResponseManager interface
Dim careCreditRequestManagerEx As CARECREDITRESPONSEMANAGER450Lib.CareCreditResponseManager
Set careCreditRequestManagerEx = New CareCreditResponseManager

'### CareCreditResponse interface
Dim careCreditResponseEx As CareCreditResponse


Dim strXML As String
Dim strXSD As String
Dim lVersion As Long
Dim strFromEAN As String
Dim strToEAN As String
Dim bIsEncrypted As YesNoType

strXML = "Response450_Accepted01.xml"

bStatus = careCreditRequestManagerEx.GetXMLInfo(strXML,strXSD,strFromEAN,strToEAN,bIsEncrypted)
If bStatus And Not bIsEncrypted Then

    bStatus = careCreditRequestManagerEx.LoadXML(strXML, "", "", careCreditResponseEx)
    If bStatus Then
        Dim strCode As String
        Dim strText As String
        Dim bIsAnError As YesNoType
        Dim lRecordID As Long
        Dim strErrorValue As String
        Dim strValidValue As String
        Dim strOutput As String
        strOutput = ""
        bStatus = careCreditResponseEx.GetFirstNotification(strCode, strText, bIsAnError, lRecordID,  _
                                                                strErrorValue, strValidValue)
        If bStatus Then
            strOutput = strOutput + "strCode=[" + strCode + "]strText=[" + strText + "]recordID=[" +  _
                        lRecordID + "]strErrorValue=[" + strErrorValue + "]strValidValue=[" +  _
                        strValidValue + "]" + vbCrLf
            Do While careCreditResponseEx.GetNextNotification(strCode, strText, bIsAnError,  _
                                                                  lRecordID, strErrorValue, strValidValue)
                strOutput = strOutput + "strCode=[" + strCode + "]strText=[" + strText + "]recordID=[" +  _
                            lRecordID + "]strErrorValue=[" + strErrorValue + "]strValidValue=[" +  _
                            strValidValue + "]" + vbCrLf
            Loop
            MsgBox (strOutput)
        End If
    End If

End If

'### relase resources
Set careCreditResponseEx = Nothing
Set careCreditRequestManagerEx = Nothing

Exit Sub

Err_Trap:
    MsgBox "Error: " & Err.Description, vbCritical, _
           "Opps! Error" & Str$(Err.Number)

'### relase resources
Set careCreditResponseEx = Nothing
Set careCreditRequestManagerEx = Nothing

End Sub