PDA

View Full Version : Authnet ADC Error with AABox



proton318
09-07-2003, 08:19 AM
When running transactions, I get the following error between the "Confirm Order" and "Finished" stages:


Warning: main(DIR_WS_CLASSESpayment.php): failed to open stream: No such file or directory in / ... /www.grapefish.com/www/catalog/checkout_process.php on line 14

Fatal error: main(): Failed opening required 'DIR_WS_CLASSESpayment.php' (include_path='.:/usr/local/lib/php') in / ... /www.grapefish.com/www/catalog/checkout_process.php on line 14

I haven't had any problems with my ADC Direct Connect prior to installing AABox and I have also checked to be sure that the file it is searching for (payment.php) is indeed in the classes folder. I have also attempted to compare my two payment.php files (old vs. AABox) and they appear to be the same file.

Can anyone point me in the right direction on how to fix this? I love the AABox package, but if I can't use Authnet ADC Direct Connect, I can't accept credit cards. :(

Thanks in advance for your help!

michael_s
09-07-2003, 09:07 AM
Warning: main(DIR_WS_CLASSESpayment.php): failed to open stream: No such file or directory in / ... /www.grapefish.com/www/catalog/checkout_process.php on line 14


The problem is that your path is not complete. It should not be sending DIR_WS_CLASSES, but rather the full path to the classes directory. Check your configure.php, and also check that all the files were uploaded correctly...

proton318
09-07-2003, 11:33 AM
I mostly understand your response, but could you be more specific? Do I need to actually go into the checkout_process.php file and point it to the complete directory (i.e. usr/home/ ... /classes/payment.php) or is there some thing in the config.php file that can be changed to accomplish this?

If you are refferring to the "/ ... /" in my last post, I erased the begining part of the path and added the "/ ... /" myself for the sake of saving space in the post, just like I did above.

I don't remember ever having to make path changes manually for my old version of osC, but I could be wrong. Also, when you say to check and see if the files were uploaded correctly, do you mean in ASCII format? If so, I always upload in that format.

Sometimes I can be a little dense, so please be very specific in your response. :oops:

Thanks again!

michael_s
09-07-2003, 04:57 PM
No. From your response, I think you are not on track.

There is a problem with your setup somewhere in configure.php because in the path of the error above it is showing DIR_WS_CLASSES instead of the actual path. This tells me that it is not correctly defined in configure.php. Fix it there, I think.

There is a problem somewhere in your setup, as this is not normal behavior after installation. I bet you are missing a single quote or a comma from the define('DIR_WS_CLASSES'.... line in configure.php

proton318
09-08-2003, 07:28 AM
Bad news. The syntax in the config.php file is perfect. The problem lies else where. Let me tell you what I did to add the ADC Module to AAbox. Maybe somewhere in this, you can help me dig up the answer to why it doesn't work.

I had to manually alter the checkout_process.php file to include these lines [8-38];


Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

// load selected payment module -- Added lines 13 to 36 for Authnet ADC
require(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment($payment);

// Need to be included before Authorizenet ADC Direct Connection
require(DIR_WS_CLASSES . 'order.php');
$order = new order;

//************************************************** **********
// Authorizenet ADC Direct Connection
// Make sure the /catalog/includes/class/order.php is included
// and $order object is created before this!!!
if(MODULE_PAYMENT_AUTHORIZENET_STATUS) {
include(DIR_WS_MODULES . 'authorizenet_direct.php');
}
//************************************************** **********

// load the before_process function from the payment modules
$payment_modules->before_process();

require(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;

$order_totals = $order_total_modules->process();

include('includes/application_top.php');

I did not add these lines, but the same file includes this syntax on lines 62-73;


// load selected payment module
require(DIR_WS_CLASSES . 'payment.php');
$payment_modules = new payment($payment);

// load the selected shipping module
require(DIR_WS_CLASSES . 'shipping.php');
$shipping_modules = new shipping($shipping);

require(DIR_WS_CLASSES . 'order.php');
$order = new order;

Could the duplicate "require" lines be causing a conflict?

I also had to add the following files to the AABox authroizenet_direct.php (I made no modifications) and I did have to replace your AABox /modules/payment/authorizenet.php file with an older version of the same file. Could this replacement with an older file cause it to not work? It's not what the error is saying, but is it possible?

Again, thanks for your time and input.

-Steve

proton318
09-08-2003, 08:57 AM
Okay, here's the latest. I have found a ADC contribution on the osC site that is compatable with the new structure. There is a hitch though ... I have to make manual changes to both the /catalog/checkout_process.php and the catalog/includes/modules/payment/authorizenet.php files of AABox. The reason for this is because both of those files in AABox contain code (like the GV code) that is not supplied in the latest ADC contribution. Did that make sense? :wink:

So I am going to review each file and make the changes accordingly. I will, of course, use myself as a test subject. If it turns out that it works with no bugs, I will be happy to leave an updated version of ADC here for anyone who wants to use it with AABox.

-Steve

Anonymous
11-10-2003, 08:34 PM
How did the test go, I am driving myself crazy trying to get this to work!