Reply
Member
Posts: 3
Registered: ‎06-09-2016

HTTP GET vs HTTP POST

Greetings-

 

We have received an email that Authorize.net will no longer allow HTTP GET methods for transaction requests.  Does this mean that we simply need to update the transact.dll URL in our code or does it mean I need to do a complete payment system revamp?

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: HTTP GET vs HTTP POST

The URL would be the same, it how you passing the param.

Member
Posts: 3
Registered: ‎06-09-2016

Re: HTTP GET vs HTTP POST

I'm sorry, but this will be my first time working with the Authorize.net API.  Could you provide an example of what is and is not correct?

 

Thanks.

Posts: 321
Topics: 5
Kudos: 37
Blog Posts: 5
Ideas: 0
Solutions: 26
Registered: ‎11-09-2011

Re: HTTP GET vs HTTP POST

@chrisdrzal It's hard to get into specifics without knowing much more about your development environment, scripting languages, etc.

But, I hope this link helps explain the difference:

http://www.w3schools.com/tags/ref_httpmethods.asp

 

In brief: You shouldn't use parameterized URLs to submit API information to Transact. Instead, you should use the HTTP body of the request to submit that information.

If you do have some details to share about your integration, the community may be able to assist you with the specific changes you need to make.

--
"Move fast and break things," out. "Move carefully and fix what you break," in.
Member
Posts: 3
Registered: ‎06-09-2016

Re: HTTP GET vs HTTP POST

@Lilith thanks for your response.  A little background; this is a legacy asp.net web application.  I say legacy, but in truth its just old - very old.  After a little investigating today, it looks like Authorize.net wants me to use WebClient.OpenWrite as opposed to WebClient.OpenRead.  Below is the code in question:

StringBuilder uri = new StringBuilder("?x_delim_data=True");
string gatewayUrl = "https://secure.authorize.net/gateway/transact.dll";
string versionNumber = "3.1";

BankResponse br = new BankResponse( _payment );

/*
  Some code to build the uri string
*/

WebClient wc = new WebClient();  

// Build the uRI
string Uri = gatewayUrl  + uri.ToString();			

try
    {
        // Perform the web GET operation
        StreamReader sr  = new StreamReader(wc.OpenRead(Uri));
		
	br.GenericResponseCode = GenericResponseTypes.MAPError;

	br.BankData = sr.ReadToEnd();
/*
  Code to interpret the response
*/
    } catch (Exception e) {....}
    
return br;

My question now is, how can I implement OpenWrite and still get the response code this method requires?

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: HTTP GET vs HTTP POST

Member
Posts: 3
Registered: ‎06-09-2016

Re: HTTP GET vs HTTP POST

I've been struggling with this as well.

 

When I pass the parameters as an array via cURL to https://test.authorize.net/gateway/transact.dll, I get a "merchant login id or password invalid" error. However, if I switch it back to sending a url encoded string, it works.

 

I can't seem to piece any of the documentation together to get the right combination of sandbox urls and correct cURL settings. Any ideas?

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: HTTP GET vs HTTP POST

Member
Posts: 3
Registered: ‎06-09-2016

Re: HTTP GET vs HTTP POST

Yes, I remember going through that article as well. However, if this is the model you use, I will try it again and follow it exactly.

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: HTTP GET vs HTTP POST

there are sample on php curl site to

http://php.net/manual/en/curl.examples.php