<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with MS Access API in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/26249#M13963</link>
    <description>&lt;P&gt;Do you have an sample VBA code for the Transaction Details API (downloading the settled batch list , transacion list for speicified batches, unsettled transactions list etc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanis&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2012 15:14:48 GMT</pubDate>
    <dc:creator>karl3200</dc:creator>
    <dc:date>2012-05-04T15:14:48Z</dc:date>
    <item>
      <title>Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/2448#M2193</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to this and need a way to connect to authorize.net from MS Access. Can anyone point me to some informaion or sample code for VBA?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;</description>
      <pubDate>Wed, 17 Mar 2010 14:17:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/2448#M2193</guid>
      <dc:creator>dark11star</dc:creator>
      <dc:date>2010-03-17T14:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/5746#M4518</link>
      <description>&lt;P&gt;Have you solved your problem yet. I am also using Access and the solution is fairly simple (after trying to do it the hard way).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2010 18:39:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/5746#M4518</guid>
      <dc:creator>stanjones0net</dc:creator>
      <dc:date>2010-09-22T18:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/6550#M4884</link>
      <description>&lt;P&gt;I would like some more information about this.&amp;nbsp; We cant find any MS Access sample code to connect to authorize.net&amp;nbsp;anywhere.&amp;nbsp; Is it even possible?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 04:23:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/6550#M4884</guid>
      <dc:creator>grippy</dc:creator>
      <dc:date>2010-10-21T04:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/6560#M4888</link>
      <description>&lt;P&gt;Yes it is possible.&amp;nbsp;Look at the sample code page.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Under the first heading&amp;nbsp;Advanced Integration Method (AIM) download the&amp;nbsp;AIM - ASP Classic code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is actually vb script code (almost VBA).&amp;nbsp;Copy and paste into a Access module, delete or comment out the HTML, and make the vb script a public subroutine called "test."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the reference to&amp;nbsp;"Scripting.Dictionary" and built&amp;nbsp;post_values (as a string) manually, just for testing purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also set a reference to "Microsoft XML, v6.0" then remove the line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="white-space: pre;"&gt;&amp;nbsp;&lt;/SPAN&gt;Set objRequest = Server.CreateObject("Microsoft.XMLHTTP")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and add the lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="white-space: pre;"&gt;&amp;nbsp;&lt;/SPAN&gt;Dim &amp;nbsp; &amp;nbsp; objRequest &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;As &amp;nbsp; &amp;nbsp;MSXML2.XMLHTTP&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="white-space: pre;"&gt;&amp;nbsp;&lt;/SPAN&gt;Set &amp;nbsp; &amp;nbsp; objRequest &amp;nbsp; &amp;nbsp; = &amp;nbsp; New &amp;nbsp; MSXML2.XMLHTTP&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the end of the code replace the&amp;nbsp;Response.Write routine with Debug.Print in a loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It been a while since I did this so you will have to clean up some of the other code also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add your testing credentials and run the code. Keep me posted with your results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 16:56:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/6560#M4888</guid>
      <dc:creator>stanjones0net</dc:creator>
      <dc:date>2010-10-21T16:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/12532#M7645</link>
      <description>&lt;P&gt;Thanks for this i was looking for such help for a while.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 thing i canot figure out is the line below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I removed the reference to&amp;nbsp;"Scripting.Dictionary" and built&amp;nbsp;post_values (as a string) manually, just for testing purposes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to built the post_values, if you can please give some detail instrutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;</description>
      <pubDate>Sun, 01 May 2011 19:49:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/12532#M7645</guid>
      <dc:creator>YK</dc:creator>
      <dc:date>2011-05-01T19:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/12546#M7652</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;You are building the post_string something like:

Public Sub test()
    Dim Post_Url
    Post_Url = "&lt;A target="_blank" rel="nofollow" href="https://test.authorize.net/gateway/transact.dll"&gt;https://test.authorize.net/gateway/transact.dll&lt;/A&gt;"
    'post_url = "&lt;A target="_blank" rel="nofollow" href="https://secure.authorize.net/gateway/transact.dll"&gt;https://secure.authorize.net/gateway/transact.dll&lt;/A&gt;"
    Dim post_string         As String
    Dim post_response       As String
    'the API Login ID and Transaction Key must be replaced with valid values
    post_string = ""
    post_string = post_string &amp;amp; "x_login=" &amp;amp; URLEncode("API_LOGIN_ID") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_tran_key=" &amp;amp; URLEncode("TRANSACTION_KEY") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_delim_data=" &amp;amp; URLEncode("TRUE") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_delim_char=" &amp;amp; URLEncode("|") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_relay_response=" &amp;amp; URLEncode("FALSE") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_type=" &amp;amp; URLEncode("AUTH_CAPTURE") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_method=" &amp;amp; URLEncode("CC") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_card_num=" &amp;amp; URLEncode("4111111111111111") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_exp_date=" &amp;amp; URLEncode("0115") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_amount=" &amp;amp; URLEncode("19.98") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_description=" &amp;amp; URLEncode("Sample Transaction") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_first_name=" &amp;amp; URLEncode("John") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_last_name=" &amp;amp; URLEncode("Doe") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_address=" &amp;amp; URLEncode("1234 Street") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_state=" &amp;amp; URLEncode("WA") &amp;amp; "&amp;amp;"
    post_string = post_string &amp;amp; "x_zip=" &amp;amp; URLEncode("98004") &amp;amp; "&amp;amp;"
    ' Additional fields can be added here as outlined in the AIM integration
    ' guide at: &lt;A target="_blank" rel="nofollow" href="http://developer.authorize.net"&gt;http://developer.authorize.net&lt;/A&gt;
    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 MSXML2.XMLHTTP
    objRequest.Open "POST", Post_Url, False
    objRequest.send post_string
    post_response = objRequest.responseText
    Debug.Print post_response
    Set objRequest = Nothing
    ' the response string is broken into an array using the specified delimiting character
    Dim response_array '(100) As String
    response_array = Split(post_response, "|", -1)
' now use Debug.Print to write out response_array
End Sub

Public Function URLEncode(xxx As String) As String
    URLEncode = Replace(xxx, " ", "%20")
End Function


This really old code I found laying around but it still works.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 May 2011 16:38:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/12546#M7652</guid>
      <dc:creator>stanjones0net</dc:creator>
      <dc:date>2011-05-02T16:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/23337#M12569</link>
      <description>&lt;P&gt;Thank you. This code works perfect. I did not put the code in a module. Instead i put it directly behind a form. Easier I think.&amp;nbsp;:smileyhappy:&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2012 07:07:00 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/23337#M12569</guid>
      <dc:creator>hotdryice</dc:creator>
      <dc:date>2012-02-21T07:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/24793#M13267</link>
      <description>Actually I built a complete set of Class modules which are referenced from my application. This way I can fill out the request to Authorize.Net with regular looking code and not a lot of string manipulation in the Form itself. The class also includes any encryption and base 64 coding necessary.</description>
      <pubDate>Tue, 20 Mar 2012 20:15:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/24793#M13267</guid>
      <dc:creator>stanjones0net</dc:creator>
      <dc:date>2012-03-20T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/26249#M13963</link>
      <description>&lt;P&gt;Do you have an sample VBA code for the Transaction Details API (downloading the settled batch list , transacion list for speicified batches, unsettled transactions list etc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanis&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 15:14:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/26249#M13963</guid>
      <dc:creator>karl3200</dc:creator>
      <dc:date>2012-05-04T15:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/26303#M13989</link>
      <description>I don't have any code for Transactions. I briefly looked at the sample code but didn't find anything appropriate. My code is directed at charging cards. You could try working with MSXML2 methods and properties, e.g. responseXML. If you have any success please let me know.</description>
      <pubDate>Tue, 08 May 2012 15:25:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/26303#M13989</guid>
      <dc:creator>stanjones0net</dc:creator>
      <dc:date>2012-05-08T15:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/28276#M14904</link>
      <description>&lt;P&gt;Have you come up with any VBA code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Strong can you share the code you have for charging cards?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2012 14:09:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/28276#M14904</guid>
      <dc:creator>thenelson</dc:creator>
      <dc:date>2012-07-26T14:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/28322#M14927</link>
      <description>&lt;P&gt;Hey thenelson,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's been a while since this was first posted. I would recommend subscribing to this topic so that you'll be alerted via email if anyone from the community is able to respond with any comments. To subscribe, click &lt;STRONG&gt;Topic Options&lt;/STRONG&gt; at the top of this thread and then select &lt;STRONG&gt;Subscribe&lt;/STRONG&gt;. You'll then receive an email once anyone replies.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Michelle&lt;BR /&gt;Developer Community Manager &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2012 19:56:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/28322#M14927</guid>
      <dc:creator>Michelle</dc:creator>
      <dc:date>2012-07-27T19:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with MS Access API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/49610#M25160</link>
      <description>&lt;PRE&gt;&lt;BR /&gt;'===============================================================================================
'Card Transaction Class for Authorize.Net
'Written in 2014 by Freeman Helmuth
'Use this code any way you would like to with the exception of the portions
'that are copyright by others.
'
'Reference Requirements:
'       Microsoft XML, v6.0
'       Microsoft Scripting Runtime
'===============================================================================================

Option Compare Database
Option Explicit

'===============================================================================================
'                                    Private Variables
Private PostValues As Scripting.Dictionary
Private ResponseArray As Variant
'                                  End Private Variables
'===============================================================================================


'===============================================================================================
'                                 Property Let's
'
'Additional fields can be added here by adding a property let and a call to the
'AddPostField function with field names as outlined in the
'AIM integration guide at: http://developer.authorize.net

Property Let FirstName(Value As String)
    AddPostField "x_first_name", Value
End Property

Property Let LastName(Value As String)
    AddPostField "x_last_name", Value
End Property

Property Let AddressLine1(Value As String)
    AddPostField "x_address", Value
End Property

Property Let State(Value As String)
    If Len(Value) = 2 And Not IsNumeric(left(Value, 1)) And Not IsNumeric(left(Value, 2)) Then
        AddPostField "x_state", Value
    Else
        MsgBox "The state must be a two digit non numeric value"
    End If
End Property

Property Let ZipCode(Value As Integer)
    If Len(Value) = 5 And IsNumeric(Value) Then
        AddPostField "x_zip", Value
    Else
        MsgBox "The zip must be a 5 digit numeric value"
    End If
End Property

Property Let CardData(Value As String)
'Complete Card Data or track 1 or 2 values can be passed to this property

    Select Case left(Value, 1)
    Case "%"
        'Track 1 data
        AddPostField "x_track1", Mid(Value, 2, InStr(Value, "?") - 2)
    Case ";"
        'Track 2 data
        AddPostField "x_track2", Mid(Value, 2, InStr(Value, "?") - 2)
    Case Else
        MsgBox "Invalid Track Data", , "Track Data Error"
    End Select
End Property

Property Let CardNumber(Number As String)
'==============================================================
'This copyright notice applies to some parts of the code below
'==============================================================

' ------------------------------------------------------------------------
' Credit Card Validation Solution, version 3.7        Visual Basic Edition
' December 20, 2002
'
' ------------------------------------------------------------------------
' DESCRIPTION:
' Credit Card Validation Solution uses a four step process to ensure
' credit card numbers are keyed in correctly.  This procedure accurately
' checks cards from Discover, JCB, MasterCard and Visa.
'
' ------------------------------------------------------------------------
' CAUTION:
' CCVS uses exact number ranges as part of the validation process. These
' ranges are current as of 10 Nov 2014.  If presently undefined ranges
' come into use in the future, this program will improperly reject card
' numbers in such ranges, rendering an error message entitled "Potential
' Card Type Discrepancy."  If this happens while entering a card &amp;amp; type
' you KNOW are valid, please contact us so we can update the ranges.
'
' ------------------------------------------------------------------------
' POTENTIAL CUSTOMIZATIONS:
' *  If you don't accept some of these card types, just comment out that
' section of the code by putting a single quote mark "'" at the beginning
' of the "Case" and "ShouldLength" lines in question.
' *  Additional card types can be added by inserting new "Case," and
' "ShouldLength" lines and adding the cardtype to the cardtype function
' *  The three functions here can be called from elsewhere in your databse
' to check any number.
'
' ------------------------------------------------------------------------
' CREDITS:
' We learned of the Mod 10 Algorithm in some Perl code, entitled
' "The Validator," available on Matt's Script Archive,
' http://worldwidemart.com/scripts/readme/ccver.shtml.  That code was
' written by David Paris, who based it on material Melvyn Myers reposted
' from an unknown author.  Paris credits Aries Solis for tracking down the
' data underlying the algorithm.  At the same time, our code bears no
' resemblance to its predecessors.  My thanks to Allen Browne and
' Rico Zschau for feedback and further refinements.
'
' ------------------------------------------------------------------------
' COPYRIGHT NOTICE:
' a) This code is property of The Analysis and Solutions Company.
' b) It is being distributed free of charge and on an "as is" basis.
' c) Use of this code, or any part thereof, is contingent upon leaving
'     this copyright notice, name and address information in tact.
' d) Written permission must be obtained from us before this code, or any
'     part thereof, is sold or used in a product which is sold.
' e) By using this code, you accept full responsibility for it's use
'     and will not hold the Analysis and Solutions Company, its employees
'     or officers liable for damages of any sort.
' f) This code is not to be used for illegal purposes.
' g) Please email us any revisions made to this code.
' h) This code can not be reposted.  Sites such as code repositories
'     need to provide a link directly to our URI, below.
'
' Copyright 2002      http://www.AnalysisAndSolutions.com/code/ccvs-vb.htm
' The Analysis and Solutions Company         info@AnalysisAndSolutions.com
' ------------------------------------------------------------------------

    Dim NumberLength As Integer
    Dim CardType As String
    Dim ShouldLength As Integer
    Dim Missing As Integer

    'Get rid of spaces and non-numeric characters.
    Number = OnlyNumeric(Number)
    'Get the card type
    CardType = GetCardType(Number)
    'Get the length of the card number
    NumberLength = Len(Number)

    'Get which length the card number should be for the card type
    Select Case CardType
    Case "American Express"
        ShouldLength = 15
    Case "Visa"
        Select Case NumberLength
        Case Is &amp;gt; 14
            ShouldLength = 16
        Case Is &amp;lt; 14
            ShouldLength = 13
        Case Else
            MsgBox "The Visa number you typed in is 14 digits long." &amp;amp; Chr(13) &amp;amp; "Visa cards usually have 16 digits, though some have 13." &amp;amp; Chr(13) &amp;amp; Chr(13) _
                   &amp;amp; "Please check the number and try again.", vbExclamation, "Invalid Length:"
            Exit Property
        End Select
    Case "MasterCard"
        ShouldLength = 16
    Case "Discover"
        ShouldLength = 16
    Case "JCB"
        ShouldLength = 16
    Case Else
        MsgBox "The first four digits of the number entered are " &amp;amp; left(Number, 4) &amp;amp; "." &amp;amp; Chr(13) _
               &amp;amp; "If that's correct, we don't accept that type of credit card." &amp;amp; Chr(13) _
               &amp;amp; "If it's wrong, please try again.", vbExclamation, "Potential Card Type Discrepancy:"
        Exit Property
    End Select

    'Check that the number is the right length
    If NumberLength &amp;lt;&amp;gt; ShouldLength Then
        Missing = NumberLength - ShouldLength
        If Missing &amp;lt; 0 Then
            MsgBox "The " &amp;amp; CardType &amp;amp; " number entered, " &amp;amp; Number &amp;amp; ", is missing " &amp;amp; Abs(Missing) &amp;amp; " digit(s)." &amp;amp; Chr(13) &amp;amp; Chr(13) _
                   &amp;amp; "Please check the number and try again.", vbExclamation, "Invalid Length:"
        Else
            MsgBox "The " &amp;amp; CardType &amp;amp; " number entered, " &amp;amp; Number &amp;amp; ", has " &amp;amp; Missing &amp;amp; " too many digit(s)." &amp;amp; Chr(13) &amp;amp; Chr(13) _
                   &amp;amp; "Please check the number and try again.", vbExclamation, "Invalid Length:"
        End If
        Exit Property
    End If

    'Does the number pass the Mod 10 Algorithm Checksum?
    If Mod10Solution(Number) = False Then
        MsgBox "The algorithm of the " &amp;amp; CardType &amp;amp; " number entered, " &amp;amp; Number &amp;amp; ", is invalid." &amp;amp; Chr(13) &amp;amp; Chr(13) _
               &amp;amp; "Please check the number and try again.", vbExclamation, "Invalid Algorithm"
        Exit Property
    End If

    AddPostField "x_card_num", Number
End Property

Property Let ExpirationDate(Value As String)

'Check if the correct number of digits have been given
    If Len(Value) &amp;lt;&amp;gt; 4 Then
        MsgBox "Invalid Expiration Date"
        Exit Property
    Else
        'Check if the card has expired
        If left(Value, 2) &amp;lt; Month(Date) And Right(Value, 2) &amp;lt;= Year(Date) Then
            MsgBox "This card expired on " &amp;amp; left(Value, 2) &amp;amp; "/" &amp;amp; Right(Value, 2)
            Exit Property
        End If
    End If

    AddPostField "x_exp_date", Value
End Property

Property Let VerificationCode(Value As String)
    AddPostField "x_card_code", Value
End Property

Property Let Amount(Value As String)

    If Not left(Right(Value, 3), 1) = "." Then
        'Make sure that we have two decimal points
        MsgBox "You must provide exactly two decimal places"
        Exit Property
    End If

    AddPostField "x_amount", Value
End Property

Property Let TransactionType(Value As String)

'Transaction Type | DESCRIPTION
'=========================================================================================================
'AUTH_CAPTURE       Transactions of this type are sent for authorization. The transaction is automatically
'                   picked up for settlement if approved. This is the default transaction type in the
'                   gateway. If no type is indicated when submitting transactions to the gateway, the
'                   gateway will assume that the transaction is of the type AUTH_CAPTURE.
'                   If the approved amount is less than the requested amount and the transaction
'                   qualifies as a partial authorization transaction, see the special conditions described
'                   in "Credit Card Transaction Processing," page 16 of the PDF.

'AUTH_ONLY          Transactions of this type are submitted if the merchant wishes to validate the credit
'                   card for the amount of the goods sold. If the merchant does not have goods in stock
'                   or wishes to review orders before shipping the goods, this transaction type should
'                   be submitted. The gateway will send this type of transaction to the financial
'                   institution for approval. However this transaction will not be sent for settlement. If the
'                   merchant does not act on the transaction within 30 days, the transaction will no
'                   longer be available for capture.

'PRIOR_AUTH_CAPTURE This transaction is used to request settlement for a transaction that was previously
'                   submitted as an AUTH_ONLY. The gateway will accept this transaction and initiate
'                   settlement if the following conditions are met:
'                   * The transaction is submitted with the ID of the original authorization-only
'                   transaction which needs to be settled.
'                   * The transaction ID is valid and the system has a record of the original
'                   authorization-only transaction being submitted.
'                   * The original transaction referred to is not already settled or expired or errored.
'                   * The amount being requested for settlement in this transaction is less than or
'                   equal to the original authorized amount.
'                   If no amount is submitted in this transaction, the gateway will initiate settlement for
'                   the amount of the originally authorized transaction.
'                   Note If extended line item, tax, freight, and/or duty information was submitted with
'                   the original transaction, adjusted information can be submitted in the event that the
'                   transaction amount changed. If no adjusted line item, tax, freight, and/or duty
'                   information is submitted, the information submitted with the original transaction will
'                   apply.

'CREDIT             This transaction is also referred to as a Refund, and indicates to the gateway that
'                   money should flow from the merchant to the customer. The gateway will accept a
'                   credit or a refund request if the transaction submitted meets the following conditions:
'                   The transaction is submitted with the ID of the original transaction against which the
'                   credit is being issued (x_ref_trans_id).
'                   * The gateway has a record of the original transaction.
'                   * The original transaction has been settled.
'                   * The sum of the amount submitted in the Credit transaction and all credits
'                   submitted against the original transaction is less than the original transaction
'                   amount.
'                   * The full or last four digits of the credit card number submitted with the credit
'                   transaction match the full or last four digits of the credit card number used in the
'                   original transaction.
'                   * The transaction is submitted within 120 days of the settlement date of the original
'                   transaction.
'                   A transaction key is required to submit a credit to the system (i.e., x_tran_key
'                   should have a valid value when a CREDIT transaction is submitted).
'                   For details about how to submit CREDIT transactions to the Payment Gateway,
'                   please see the Issuing Credits Guide.

    AddPostField "x_type", Value
End Property


'                                        End Property Let's
'===============================================================================================
'                                       AddPostField  Function
'This function sets the PostValues variable if it is null,
'and adds the given field to the post values.

Private Function AddPostField(Field As Variant, FieldValue As Variant)

    If PostValues Is Nothing Then
        Set PostValues = New Scripting.Dictionary
    End If

    PostValues.Add Field, FieldValue
End Function

'===============================================================================================
'                                       Process Sub
'Processes the card transaction
Sub Process()

    Dim PostString As String
    Dim PostUrl As String
    Dim PostResponse As String
    Dim PostField As String

    Dim objRequest As MSXML2.XMLHTTP
    Dim ApprovalStatus As Variant
    Dim Delimiter As String
    Dim Key As Variant

    Set objRequest = New MSXML2.XMLHTTP

    'Delimiter to use for delimited data
    Delimiter = "|"

    'Test Post URL
    PostUrl = "https://test.authorize.net/gateway/transact.dll"

    'Live Post URL
    'PostUrl = "https://secure.authorize.net/gateway/transact.dll"

    'The API Login ID and Transaction Key must have valid values
    '==============================================================
    'Sandbox Values
    PostValues.Add "x_login", "XXXXXXXXXXXXXXXXXX"
    PostValues.Add "x_tran_key", "XXXXXXXXXXXXXXXXX"

    'Live values for YOUR COMPANY NAME
'    PostValues.Add "x_login", "XXXXXXXXXXXXXXXXX"
'    PostValues.Add "x_tran_key", "XXXXXXXXXXXXXXXXX"
    '==============================================================

    'Use the test request only when connecting to the live post URL
    'PostValues.Add "x_test_request", "TRUE"

    'Various Transaction settings
    PostValues.Add "x_market_type", "2"    'Market type 2 is retail
    PostValues.Add "x_delim_data", "TRUE"
    PostValues.Add "x_delim_char", Delimiter
    PostValues.Add "x_relay_response", "FALSE"

    'Build the Post String
    PostString = ""
    For Each Key In PostValues.Keys
        PostString = PostString &amp;amp; Key &amp;amp; "=" &amp;amp; UrlEncode(PostValues(Key)) &amp;amp; "&amp;amp;"
    Next

    'Trim the last &amp;amp;
    PostString = left(PostString, Len(PostString) - 1)

    ' We use xmlHTTP to submit the input values and record the response
    objRequest.Open "POST", PostUrl, False
    objRequest.send PostString
    PostResponse = objRequest.responseText

    Set objRequest = Nothing

    'The response string is broken into an array using the specified delimiting character

    ResponseArray = Split(PostResponse, Delimiter, -1)

End Sub

'                                   End Process Sub
'===============================================================================================
'                                   Property Get's(For Results)

Property Get Result()
    Result = ResponseArray(3)
End Property

Property Get AuthCode()
    AuthCode = ResponseArray(4)
End Property

'                                   End Property Get's
'===============================================================================================
'                                   Supporting Functions

Private Function UrlEncode(ByVal StringToEncode As String) As String
    UrlEncode = Replace(StringToEncode, " ", "%20")
End Function

Private Function OnlyNumeric(Number As String)
    Dim Location As Integer
    Dim NumberLength As Integer
    Dim CurrentOutput As String
    Dim CurrentCharacter As String * 1

    NumberLength = Len(Number)
    If NumberLength &amp;gt; 50 Then
        ' Avoids system overload from hacking via super long input.
        NumberLength = 50
    End If


    ' Go through each number in the string.
    For Location = 1 To NumberLength
        CurrentCharacter = Mid(Number, Location, 1)
        Select Case Asc(CurrentCharacter)
        Case 48 To 57
            ' This character is a number,
            ' append it to the variable we're going to output.
            CurrentOutput = CurrentOutput &amp;amp; CurrentCharacter
        End Select
    Next

End Function

Property Get GetCardType(Optional Number As String)

    Dim CardNumber As String

    If Number = "" Then
        CardNumber = PostValues("x_card_num")
    Else
        CardNumber = Number
    End If

    Select Case left(CardNumber, 4)
    Case 3400 To 3527, 3590 To 3799
        GetCardType = "American Express"
    Case 4000 To 4999
        GetCardType = "Visa"
    Case 5100 To 5599
        GetCardType = "MasterCard"
    Case 6011, 6221 To 6229, 6440 To 6499, 6500 To 6599
        GetCardType = "Discover"
    Case 3528 To 3589
        GetCardType = "JCB"
    Case Else
        GetCardType = "Invalid"
    End Select
End Property

Private Function Mod10Solution(Number As String) As Boolean
'This works for numbers up to 255 characters long.
'For longer numbers, increase variable data types as needed.
    On Error GoTo ErrHandle
    Dim NumberLength As Byte    'Up to 255 digits.
    Dim Location As Byte     'Up to 255 digits.
    Dim Checksum As Integer  'Up to 3,640 digits.
    Dim Digit As Byte

    NumberLength = Len(Number)

    'Add even digits in even length strings
    'or odd digits in odd length strings.
    For Location = 2 - (NumberLength Mod 2) To NumberLength Step 2
        Checksum = Mid(Number, Location, 1) + Checksum
    Next Location

    'Analyze odd digits in even length strings
    'or even digits in odd length strings.
    For Location = (NumberLength Mod 2) + 1 To NumberLength Step 2
        Digit = Mid(Number, Location, 1) * 2
        If Digit &amp;lt; 10 Then
            Checksum = Digit + Checksum
        Else
            Checksum = Digit - 9 + Checksum
        End If
    Next Location

    'Is the checksum divisible by ten?
    Mod10Solution = (Checksum Mod 10 = 0)
    Exit Function

ErrHandle:
    MsgBox Error, vbExclamation, "Mod 10 Solution Had Error:"
    Mod10Solution = False

End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Here is a complete class for processing transactions with authorize.net&lt;/P&gt;&lt;P&gt;It should be very flexible to get whatever data you need.&lt;/P&gt;&lt;P&gt;Simply add "Property Let"s to add more fields&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 22:23:26 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Help-with-MS-Access-API/m-p/49610#M25160</guid>
      <dc:creator>busyfritz</dc:creator>
      <dc:date>2015-02-10T22:23:26Z</dc:date>
    </item>
  </channel>
</rss>

