4 Replies Latest reply on Apr 2, 2008 12:52 PM by djc11

    authorize.net ARB api connection problems

    ahmedplummer
      Has anyone been able to use authorize.net's ARB api successfully? If so, was there anything special you had to do?

      I was able to post to their testing URL, and receive a well formed XML response, but once I switched over to their production URL I receive and http authentication error. Nothing changed with my posting code, aside from the URL i am posting to. After doing some research and finding mention of occasional problems regarding CFHTTP and certain SSL certificates, I manually imported the SSL certificate as well, but the error continues....

      Anyhow, if anyone has done this successfully, or has some feedback let me know. i can post my code as well as my error...

      thanks.

        • 1. Re: authorize.net ARB api connection problems
          insuractive Level 3
          There are 2 custom headers you have to pass when using CFHTTP via SSL. I'll see if I can dig them up
          • 2. Re: authorize.net ARB api connection problems
            insuractive Level 3
            If you have already added their certificate to your java cert store on your server, try adding the following to your cfhttp call:

            <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
            <cfhttpparam type="Header" name="TE" value="deflate;q=0">
            • 3. Re: authorize.net ARB api connection problems
              ahmedplummer Level 1
              thanks for the suggestion.

              still no luck though. i added the headers to my post, and the error persists.

              maybe it's something really stupid that i'm missing. i've messed around with the code enough at this point i would not be shocked. fresh eyes never hurt. with that in mind, here is my code and error (see below):
              -----------
              <cfoutput>
              <CFXML VARIABLE="myXml">
              <ARBCreateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
              <merchantAuthentication>
              <name>myusername</name>
              <transactionKey>mytrankey</transactionKey>
              </merchantAuthentication>
              <refId>testing123</refId>
              <subscription>
              <name>Sample subscription</name>
              <paymentSchedule>
              <interval>
              <length>1</length>
              <unit>months</unit>
              </interval>
              <startDate>2007-05-25</startDate>
              <totalOccurrences>12</totalOccurrences>
              <trialOccurrences>1</trialOccurrences>
              </paymentSchedule>
              <amount>10.29</amount>
              <trialAmount>0.00</trialAmount>
              <payment>
              <creditCard>
              <cardNumber>4111111111111111</cardNumber>
              <expirationDate>2008-08</expirationDate>
              </creditCard>
              </payment>
              <billTo>
              <firstName>test</firstName>
              <lastName>test</lastName>
              </billTo>
              </subscription>
              </ARBCreateSubscriptionRequest>
              </CFXML>
              </cfoutput>

              <cfhttp method="POST" url="https://api.authorize.net/xml/v1/request.api" >
              <cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
              <cfhttpparam type="Header" name="TE" value="deflate;q=0">
              <cfhttpparam name="body" type="xml" value="#ToString(myXml)#" />
              </cfhttp>
              ---------
              And here's the result of cfdump on the cfhttp result:
              -------
              Charset [empty string]
              ErrorDetail I/O Exception: peer not authenticated
              Filecontent Connection Failure
              Header [undefined struct element]
              Mimetype Unable to determine MIME type of file.
              Responseheader struct [empty]
              Statuscode Connection Failure. Status code unavailable.
              Text YES
              -----------
              • 4. Re: authorize.net ARB api connection problems
                djc11
                Was this ever resolved? I am having a problem getting this API working as well.