Forum Moderators: coopster

Message Too Old, No Replies

Authorize.net script not working

         

SeanF

12:51 pm on Apr 27, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



Hi:

I have been using the Authorize.net API for a payment gateway for a number of years and have not had a problem. Recently, I upgraded my development machine (MacBook Pro) with a new SSD hard drive which required re-installing the web server (XAMPP). All of the domains on the server work fine but the Authorize.net toolkit is not functioning.

I am pretty sure I have tracked it to the following code:

<?php
require 'anet_sdk/autoload.php';
use net\authorize\api\contract\v1 as AnetAPI;
use net\authorize\api\controller as AnetController;
//define("AUTHORIZENET_LOG_FILE", "phplog");
$customerProfileId = $anet_profile_id;
$customerPaymentProfileId = $anet_payment_profile;
// Common setup for API credentials (merchant)
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
[rest of script]

The "$merchantAuthentication = ..." line is causing the script to fail with no errors. The page just terminates at that point.

The script works fine on the production server and the code has not changed on the development server.

Can someone suggest what I should be looking for to identify the cause?

Thanks

lammert

3:29 pm on Apr 27, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would check the logs on the gateway side. All payment processors I know have a very detailed server-side log facility. Logs are often not stored client-side for security and privacy reasons.

SeanF

1:02 pm on Apr 30, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



Thank you for your reply. Sorry I did not respond sooner... got called off on other issues

I checked the Authorize.net code and the various routines define the log file as such:
define("AUTHORIZENET_LOG_FILE", "phplog");

When I look at that file which resides in the top level directory of the domain, it has not been written to since January.
If I change the name of the file, in the define() statement, no new file is created

I have changed the permission to that directory to 777 to make sure the file can be written to and checked the permissions of the phplog file itself and it shows as -rwxrwxrwx@. (not sure what the ampersand signifies)

So, perhaps the issue is that Autorize.net can not write to the log file in the first place which is causing the script to abort.

What would cause a failure in writing to the log file?

Thanks