cancel
Showing results for 
Search instead for 
Did you mean: 

PHP 8 Support for AuthorizeNet/sdk-php

The official (version 2.0.1) Authorizenet/sdk-php on GitHub: https://github.com/AuthorizeNet/sdk-php is not compatible with PHP 8. The latest commit on February 4, 2020 does not address the error PHP Fatal Error. The issue report for PHP 8.0.x support can be found on https://github.com/AuthorizeNet/sdk-php/issues/407.

 

Error Message using PHP 8:

PHP Fatal error: Cannot use "parent" when current class scope has no parent in /home/****/project/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php on line 291


It looks like markonikolicdir has created a fork https://github.com/AuthorizeNet/sdk-php/pull/408 to address the error caused by upgrading from 7.4.x to 8.x.x. It has yet to be merged to the master branch. I have not tested the fork.

 

There is also a script that can be run in the same folder as your composer.json file to address the error as proposed by kkeith-adg: https://github.com/AuthorizeNet/sdk-php/issues/407#issuecomment-806344856. I have not tested this script.

 

It looks like this has been an ongoing issue since PHP 8's release on November 26, 2020. Can someone from Authorize.net update the sdk package on https://github.com/AuthorizeNet/sdk-php?

dblaze
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

These issues have been resolved as of March 2021 with the release of 2.0.2.

View solution in original post

dblaze
Contributor
2 REPLIES 2

These issues have been resolved as of March 2021 with the release of 2.0.2.

dblaze
Contributor

I am also encountering this issue. Dont know why its hapenning 

 

regard lesco bill

michael525
Member