简体   繁体   中英

Error integrating Authorize.net payment gateway: MerchantAuthenticationType not found

I am integrating Authorize.net payment gateway in my project in php. But here I am facing this error.

Fatal error: Class 'net\\authorize\\api\\contract\\v1\\MerchantAuthenticationType' not found in /opt/lampp/htdocs/payment/charge-credit-card.php on line 9

require 'vendor/autoload.php';
use net\authorize\api\contract\v1 as AnetAPI;
use net\authorize\api\controller as AnetController;
define("AUTHORIZENET_LOG_FILE","phplog");
// Common setup for API credentials
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType()

I have downloaded PHP-SDK from github and did as they say.

Try replacing: require 'vendor/autoload.php';

With: require 'autoload.php';

I am an amateur and I had used composer and it was doing weird things. I had to find and move a bunch of files to get the whole thing working. The hardest part was finding the right autoload.php.

I hope it helps...newbie here so...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM