[thelist] authorize.net form submission

|| cira || cira at bork.hampshire.edu
Tue Nov 11 00:54:17 CST 2003


Andrew Seguin wrote:

> but do take note that on php's page for "fsockopen" (
> http://www.php.net/manual/en/function.fsockopen.php ) that there is a link
> to the page that describes the "List of Supported Socket Transports" (
> http://www.php.net/manual/en/transports.php ) and there it says:
> 
> "ssl:// & tls:// since PHP 4.3"

So yeah, now that I've done a little more research I've found all I need 
to know from forums and the PHP manual.

This is my first time dealing with PHP, SSL, and Authorize.net. I think 
what confused me was the lack of explanation between the AIM and SIM 
methods in the authorize documentation. Also, the Authorize.net user 
interface combines all possible methods of connecting to the gateway, so 
in the settings page, there are options for both AIM and SIM and the 
interface doesn't explain which is which or really differ between the 
two.

The lowdown is that AIM is a direct response and the gateway will dump 
the response information right back to the browser when posting from a 
form, so that will not work. You have to use, like you said, the 
fsockopen() function to connect to the server and use PHP's urlencode() 
function to simulate the $_POST data. Previously, before PHP 4.3, the 
only way to connect to a secure socket was with the CURL functions, that 
is if you aren't using something like PayPal which PHP has specific 
functions for. 

Using the SIM method, you supply a URL for authorize to send the data to. 
I was under the impression that's what AIM was, which is where I was 
confused. Maybe I missed a big concept that other people didn't, but 
if the documentation had just explained the difference clearly, it would 
have helped a lot.

I hope this helps anyone who is building a similar app. A lot of the forum 
posts and articles out there were written before PHP 4.3 and are not 
up-to-date. I was able to write a very small script to send the $_POST 
data and and parse the response data using just a few built-in PHP 
functions.

-Samantha





More information about the thelist mailing list