Jump to content
Larry Ullman's Book Forums

Authorize.net Setup Changed 2014 No Authorizenet.php File


Recommended Posts

HI all,

 

After attempting to test authorize.net to run some test transactions i couldn't find the necessary file to include, after browsing all files and folders in the downloaded sdk directory i soon found they had changed the files, i have since changed the path to the correct file however im receiving errors, i would appreciate it if someone could check this over to confirm if its still possible to run everything smoothly, i thought it was also important to bring this to larry's attention to make the required changes corresponding to the authorize.net setup in the book for future prints.

 

thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

I had the Authorize.net working beautifully, but it does seem to have stopped working. Getting a Response code |3|, Response Reason Code |49| error: |The transaction amount submitted was greater than the maximum amount allowed. Downloaded the new SDK but it looks confusing... Any magic fixes?

Link to comment
Share on other sites

  • 8 months later...

Hi Everyone

 

I am struggling with the same issue. The AuthorizeNet.php file is missing in the download. There is however a file under the LIB folder AthorizeNetAIM.php.

Unfortunately using this file creates another error which relates to a class AuthorizeNetRequest which it cannot find (line 42 in the script)

 

AuthorizeNet website does not really offer much in terms of a solution either.

 

Anybody got any idea how to fix this?

 

regards

johannsnr

Link to comment
Share on other sites

Hi Everyone,

 

After struggling for some fare amount of time with this I have found that the AuthorizeNet.php should be replaced with autoload.php found in the anet_php_sdk folder. In billing.php on line 158 where it is asking for ./AuthorizeNet.php it should point to ./autoload.php.

 

Once I did that I had to change my php configuration to allow for the function curl_init() to be active.

Remove the ; in front of extension = php_curl.dll (line 883 on my installation of php.ini).

 

After that the system asked for class zend mime part. in email_receipt.php. I commented out lines 64 to 98 to test if it will work. It did but without sending the mail obviously.

 

Larry please correct me if there is a mistake in my method here. This worked for me so far except the section about class zend mime which I have no clue about how to fix.

 

With the changes and testing the site it at is giving me the ORDER COMPLETE page.

 

regards

johannsnr

Link to comment
Share on other sites

The most important thing is that it works. So that's good. As for cURL, you did that right (and restart the server after making that change). For Authorize.net, either they changed their setup or you downloaded a different library than the one I used for the book. In any case, you can check Authorize.net's site to confirm that the order went through.

 

As for Zend MIME, you'll need to install that library to get it to work. 

Link to comment
Share on other sites

  • 1 year later...

Hi Larry et al,
I finally got this all working again as nicely as it used to, with much stumbling around. Your results may vary:

 

Authorize.net changed their setup drastically. What worked for me (sure there's other solutions around):

 

Download their latest SDK. (v1.9 as of today)

Will NOT work out of the box, need to run Composer to download dependencies. Contrary to their documentation their "convenient" autoloader is not an option, many dependencies, such as serializer, etc will error fatally.

 

In the experimentation and/or after download, the directory structure will be different (e.g., a new subdirectory also called vendor.

 

Especially to the above Zend email problem in email_receipt.php included in final.php:

Recall line 64-65 or so:

// Uses Composer to autoload the Zend Framework files:
require('includes/vendor/autoload.php');
 
Will now be out of sync? Had to copy the 32 character string part in something like ComposerAutoloaderInit16b7c79bcea786795d7edd9ece25a4bd, from vendor/composer/autoload_real.php to match the line 7 in includes/vendor/autoload.php ( required above from email_receipt.php) ComposerAutoloaderInit16b7c79bcea786795d7edd9ece25a4bd::getLoader();
 
Basically, I had to also download AND run composer on their sample-code-php-master and use that to follow and replace Larry's excellent comments line by line in billing.php. Also to store full response in database, have to use $full_response = addslashes(serialize($response));
 

Following their sample code authorize-credit-card.php (prolly want to rename it as an *.inc and remove it's function call), the database call now looked something like:

 

// Record the transaction:
 
 $r = mysqli_query($dbc, "CALL add_transaction($order_id, 'auth_only', $order_total, {$tresponse->getResponseCode()}, '$reason_text', {$tresponse->getTransId()}, '$full_response')");

 

Might have changed some semantics  from anet's, e.g, $amount to $order_total, maybe a few more like "description" to "reason", etc....

 

It CAN work like it used to, just need a coffee or a beer now before tackling the admin capture part....

Link to comment
Share on other sites

Woops, not done yet correcting billing.php, it works but forgot I had commented out the error section around line 183 or so:

 

else { // Do different things based upon the response:
 
// switch ($response->response_code) {
 
Using authorize. net's "AIM_guide_XML.pdf", forgot where the download link was, but looking at page 67 "Response Reason Codes and Response Reason Text" Table to redo that code section...
Link to comment
Share on other sites

 Share

×
×
  • Create New...