cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Class 'AuthorizeNetDPM' not found

Hi,

 

Working on a sandbox environment, installed api using composer.  this is how my index is setup:

 

 

<?php

//index.php

require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/Auth.php';

?>

and here is my auth

 

 

<?php 

	/**
	*  for authnet
	*/
	class Auth
	{
             public function post()
             {
                  $auth = new AuthorizeNetDPM;

                  /*
			$url = "http://YOUR_DOMAIN.com/direct_post.php";
			$api_login_id = 'YOUR_API_LOGIN_ID';
			$transaction_key = 'YOUR_TRANSACTION_KEY';
			$md5_setting = 'YOUR_API_LOGIN_ID'; // Your MD5 Setting
			$amount = "5.99";

			AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);
			*/
             }

        }
?>

I got a Class Not Found Error with this setup.

 

What have I missed please?

 

thanks.

 

nashsaint
Member
1 REPLY 1

Nothing here looks necessarily incorrect. You will want to make sure that you have setup your composer.json file in the same folder you are working in and that you have run the composer update. This should install everything into that same directory so that your references work.

 

Alternatively, you can always just require our autoload.php file directly. Usage of composer is not a requirement.

Trevor
Administrator Administrator
Administrator