Reply
Highlighted
Contributor
Posts: 18
Registered: ‎12-06-2019
Accepted Solution

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?


Accepted Solutions
Solution
Accepted by topic author dblaze
‎04-01-2021 01:49 PM
Contributor
Posts: 18
Registered: ‎12-06-2019

Re: PHP 8 Support for AuthorizeNet/sdk-php

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

View solution in original post


All Replies
Solution
Accepted by topic author dblaze
‎04-01-2021 01:49 PM
Contributor
Posts: 18
Registered: ‎12-06-2019

Re: PHP 8 Support for AuthorizeNet/sdk-php

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

Member
Posts: 1
Registered: ‎06-06-2021

Re: PHP 8 Support for AuthorizeNet/sdk-php

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

 

regard lesco bill