Showing results for 
Search instead for 
Did you mean: 

Issues with API integration into MS Access

Developer Gateway in Sandbox - 809501

I am attempting to integrate Credit Card processing into the MS Access application that drives my customer's Hose and Tool Rental business.  I have run into issues with the following procedure:
Public Sub CCPriorAuthChg()
    Dim Post_Url
        'Post_Url = ""; ' SANDBOX Environment
        Post_Url = GetPostURL(CCEnvironment)
    Dim post_string         As String
    Dim post_response       As String
    Dim MerchLogin          As String
    Dim MerchTransKey       As String
    MerchLogin = CCMerchantLogin(CCEnvironment)
    MerchTransKey = CCMerchantKey(CCEnvironment)
    'the API Login ID and Transaction Key must be replaced with valid values
    post_string = ""
    post_string = post_string & "x_login=" & UrlEncode(MerchLogin) & "&"
    post_string = post_string & "x_tran_key=" & UrlEncode(MerchTransKey) & "&"
    post_string = post_string & "x_delim_data=" & UrlEncode("TRUE") & "&"
    post_string = post_string & "x_delim_char=" & UrlEncode("|") & "&"
    post_string = post_string & "x_relay_response=" & UrlEncode("FALSE") & "&"
    post_string = post_string & "x_type=" & UrlEncode("PRIOR_AUTH_CAPTURE") & "&"
    post_string = post_string & "x_method=" & UrlEncode("CC") & "&"
    post_string = post_string & "x_TransId=" & UrlEncode(Me.CCTransCode) & "&"
    post_string = post_string & "x_refTransId=" & UrlEncode(Me.CCNetworkTransCode) & "&"
    post_string = post_string & "x_amount=" & UrlEncode(Me.PmtAmount) & "&" ''''''
    post_string = post_string & "x_currencyCode=" & UrlEncode("USD") & "&"
    ' Additional fields can be added here as outlined in the AIM integration
    post_string = post_string & "x_originalNetworkTransId=" & UrlEncode(Me.CCNetworkTransCode) & "&"
    post_string = post_string & "x_originalAuthAmount=" & UrlEncode(Me.PmtAmount) & "&"
    post_string = Left(post_string, Len(post_string) - 1)
    ' We use xmlHTTP to submit the input values and record the response
    'Dim objRequest As New ActiveXObject("Msxml2.DOMDocument.6.
    Dim objRequest As MSXML2.XMLHTTP
    Set objRequest = New MSXML2.XMLHTTP
    objRequest.Open "POST", Post_Url, False
    objRequest.send post_string
    post_response = objRequest.responseText
    Set objRequest = Nothing
    ' the response string is broken into an array using the specified delimiting character
    Dim response_array '(100) As Variant
    response_array = Split(post_response, "|", -1)
    Me.CCResultCode = response_array(3)
    Me.CCAuthCode = response_array(4)
    Me.CCTransCode = response_array(7)
    Me.CCNetworkTransCode = response_array(68)
    Me.CCResultParseCode = post_response
    Me.Notes = "The previous Authorization Only record was converted to a charge"
End Sub
I have 2 issues:
1. I have compiled the C# SDK into a COM visible TLB files (AuthorizeNet.tlb) which I tried to reference from the Access application.  However the Reference Name was incorrect.  The reference to C# Assembly instead of AuthorizeNet doesn't provide the class intellisense that I need to understand how I can use the Class.
Any assistance that you can provide is appreciated, including how to convert the AIM x_.... references to the current API call.

How to import REST API data to Access. In MS Access, go to External Data Ribbon and select New Data Source and select From Other Sources and ODBC Database. Select the Source and destination of the data, select Import the source data into a new table in the current database and press OK. ExpressHR


Access doesn't provide any functionality to directly access the data from a HTTP endpoint (REST API). It can only function as a database(backend) in this scenario and you would need to look into other solutions to get the data from the database and provide it from a HTTP endpoint (REST API). ExpressHR