cancel
Showing results for 
Search instead for 
Did you mean: 

Updating old authnetcc class from authorize net for new API release

Background

I am working on a 10 year old website that uses a very old AIM class from authorize.net. The end point that this website is using to hit authorize.net api is deprecated on the 28th of this month. I was told that I must use the new URL endpoint.

A full list of URLs scheduled for disablement can be found here.

The site is currently using

https://secure.authorize.net/gateway/transact.dll

This is the suggested production URL

https://test.authorize.net/xml/v1/request.api

This is the suggested sandbox URL

https://apitest.authorize.net/xml/v1/request.api

I am trying to figure out the easiest way to update the SDK with minimal amounts of changes to the existing code base. We are in the process of creating a new site and do not want to spend more time than necessary to keep this one working.

When I change the URL, the request fails with an error. The current site is sending key name value pairs in a URL string.

When looking for information about how to update this I found this paragraph on their website.

Advanced Integration Method (AIM)

STATUS: Supported but no longer updated

ALTERNATIVE SOLUTION: Use the methods described in Payment Transactions in the the API Reference using XML or JSON.

DESCRIPTION: All of the transaction methods previously available through AIM are possible using the methods described in Payment Transactions in the the API Reference using XML or JSON. If you are using transaction methods documented as part of what we previously called our "AIM XML" API, these transaction methods have been incorporated into our current broader Authorize.Net API. These transaction requests can continue to be used as is.

If you are using our legacy AIM Name Value Pair (NVP) method, you're posting your transaction requests to a URL ending in "transact.dll", and the form field names begin with "x_". These types of transaction requests can be brought current by recreating them using the methods described in Payment Transactions in the the API Reference using XML or JSON.

If you are using our legacy AIM Name Value Pair (NVP) method and need to troubleshoot existing code, you may find it helpful to refer to the existing AIM NVP documentation: AIM NVP Guide (PDF), PayPal AIM NVP Guide (PDF)

I am a confused by this line,

These types of transaction requests can be brought current by recreating them using the methods described in Payment Transactions in the the API Reference using XML or JSON.

I know they are referring to their new API which can be seen here. /echatspin But I am confused about the "recreating them using the methods" part.

Question

In what way can we update this old class to work with the new authroize.net api? Is the suggested way to completely rewrite the whole existing class to be functions from their new api using their new SDK? The statement mentioned above is unclear to me.

Does anyone know if this has been done open source by anyone I could quickly update the class in our project with?

Old authnetcc class

class authnetcc {

 This is documented in the AIM Developer Guide (PDF) /echatrandom on Page 34

2 REPLIES 2

Authorize.Net is one of the world's largest payment gateways, serving over 400,000 merchants. Their services allow you to accept payment from your customers, by credit card or eCheck, straight from your website. You must have an Authorize.Net account to use this extension (account fees will vary).

Melvinavilles
Member

Since the new API uses different data structures than name/value pairs, you cannot just switch out the endpoint. If you are using an SDK for the deprecated AIM method, you'll likely need to use a newer SDK for the Payment API method. The methods part is referring to the new API methods for Payment Transactions.

Otherwise, you'll need to create the XML/JSON, send the request to the new API endpoints, and parse the response. I recently upgraded a legacy ASP classic site to replace AIM with the Payment API method and it was fairly easy to create a class to do this. This may be your best option if you do not want to replace the SDK.

hawc2k
Contributor
Contributor