cancel
Showing results for 
Search instead for 
Did you mean: 

ColdFusion Accept.js

Hello Authorize.NET,

 

After your reponse to this question, I started to work on a proof of concept using Accept.js.  Using the Payment Nonce to construct a XML HTTP request from my server to Authorize, I am getting a response message of "I00001" (Successful).  However, I would like to confirm before I implement our actual solution.  I am using ColdFusion (CFML), and since your documentation happy path does not offer a ColdFusion solution, I used HTTP.  Is it OK to make HTTP request to the following URLs?  If not let me know how am I supposed to do this.

 

Here my server code (proof of concept):

<cfset variables.authorizeHttpResponse  = StructNew()>
<cfset variables.oneTimePaymentResponse = XMLNew()>
<cfxml variable="oneTimePaymentRequest"><cfoutput><createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>API_LOGIN_ID</name>
    <transactionKey>API_TRANSACTION_KEY</transactionKey>
  </merchantAuthentication>
  <transactionRequest>
    <transactionType>authCaptureTransaction</transactionType>
    <amount>15.00</amount>
    <payment>
      <opaqueData>
        <dataDescriptor>#FORM.dataDescriptor#</dataDescriptor>
        <dataValue>#FORM.dataValue#</dataValue>
      </opaqueData>
    </payment>
  </transactionRequest>
</createTransactionRequest></cfoutput></cfxml>

<cftry>
  <cfhttp url="https://apitest.authorize.net/xml/v1/request.api" method="post" result="authorizeHttpResponse" timeout="60">
    <cfhttpparam type="header" value="text/xml" name="Content-Type">
    <cfhttpparam type="body"   value="#oneTimePaymentRequest#">
  </cfhttp>
  
  <cfif structKeyExists(authorizeHttpResponse, "Filecontent")>
    <cfset oneTimePaymentResponse = #xmlParse(authorizeHttpResponse.Filecontent)#>
  </cfif>
  <cfdump var="#authorizeHttpResponse#"  label="authorizeHttpResponse">
  <cfdump var="#oneTimePaymentResponse#" label="oneTimePaymentResponse">
  
  <cfcatch type="any">
    <cfdump var="#cfcatch#">
  </cfcatch>
</cftry>
Shapeous
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @Anurag,

 

I also found this example which more closely matches what I am doing.

 

https://github.com/AuthorizeNet/accept-sample-app/blob/master/transactionCaller.php

 

Thanks for confirming,

View solution in original post

4 REPLIES 4

Hi @Shapeous

 

Yes you can make API calls to the below URLs . 

 

You can use our API reference for testing the APIs 

 

https://developer.authorize.net/api/reference/index.html

 

 

Also check our SDK/Sample code at https://github.com/AuthorizeNet 





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

Thanks @Anurag,

 

I also found this example which more closely matches what I am doing.

 

https://github.com/AuthorizeNet/accept-sample-app/blob/master/transactionCaller.php

 

Thanks for confirming,

Hello

 

I am doing an emergency CFM (Coldfusion conversion) to accept.js hosted form- is this possible? or should I follow the below sort of example?

 

Madeleine

Madeleine
Contributor

That's what we did here at AlbanyMed, so yes it is possible.  Using the Accept.js implementation together with the sample code above, you should be able to put together a prrof of concept.

 

Best of luck,