Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 support #407

Closed
turbo124 opened this issue Feb 20, 2021 · 17 comments
Closed

PHP 8.0 support #407

turbo124 opened this issue Feb 20, 2021 · 17 comments

Comments

@turbo124
Copy link

I see there were issues with PHP 7.4 here #383, when running my tests against PHP 8.0 i also see the following:

PHPUnit\Framework\Exception: PHP Fatal error:  Cannot use "parent" when current class scope has no parent in vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php on line 29
@mav2287
Copy link

mav2287 commented Feb 22, 2021

Looks like this issue has been around since Jan 1 of 2020 with not official fix yet. Have look at: PHP 7.4 support #383 & Cannot use "parent" when current class scope has no parent #397

@turbo124
Copy link
Author

@mav2287 I was able to use #397 as a workaround, however this is no longer possible with PHP 8.0

@mav2287
Copy link

mav2287 commented Feb 22, 2021

Have you taken a look at the php-version-upgrade branch and this pull request? Updating generator to fix PHP74 related bug #395

@mav2287
Copy link

mav2287 commented Feb 22, 2021

Just tried switching to that branch with composer require authorizenet/authorizenet:dev-php-version-upgrade, deleted the vendor folder and then ran composer install , but I still get the same parent error on PHP 8.0.2. It does work correctly on php 7.4 though so I'm not sure what changed in PHP 8.0 that is causing it to throw that error.

@turbo124
Copy link
Author

@mav2287 I believe it is the stricter type checks in PHP 8

@mav2287
Copy link

mav2287 commented Feb 22, 2021

That would make sense. I dropped a comment on the merge request for the person who made the 7.4 patch to see if they are doing an 8.0 patch. If they do hopefully it gets merged in as well.

markonikolicdir pushed a commit to markonikolicdir/sdk-php that referenced this issue Feb 25, 2021
@skystebnicki
Copy link

Have there been any updates on this? We've been holding off on upgrading to php8 because of this bug, but it is starting to create some problems for us.

@turbo124
Copy link
Author

@skystebnicki have you tested @markonikolicdir PR as a fix for this? I am also in a similar position as this is the only package that is holding us back from PHP 8

@skystebnicki
Copy link

Unfortunately we were unable to get it to work, even with the PR fix, but we didn't spend too much time testing that because it's pretty critical we have the official package tested and working in our production environment.

@brada1703
Copy link

Any update on this? Running into the same problem on 8.0. I'd love to use the fix here, but can't until it's official :(

@midnightcorp
Copy link

+1 for PHP 8 support.

@kkeith-adg
Copy link

kkeith-adg commented Mar 25, 2021

Been trying to upgrade our app to PHP 8 for the last few days and this library is one of my main issues. Decided to write a PHP script to patch the files so I wouldn't have to use a fork of the official library. If you are looking for a temporary solution until they either fix this issue or you migrate away from Authorize.net (recommended), this could work.

  1. Setup this script in the same directory as your composer.json file
  2. Run via php name-of-script.php
  3. Install as a composer post-install-cmd script in your composer.json
    "scripts": {
        "post-install-cmd": [
            "php name-of-script.php"
        ]
    }

I tried to apply these changes to a private fork but all the composer dependencies are so old I couldn't update everything to run tests.

@skystebnicki
Copy link

Is anyone from Authorize.net even monitoring this repo? Maybe we're just screaming in the desert here. Seems like such a trivial fix to leave undone for so long.

@skystebnicki
Copy link

I just filed a ticket with their support to see if we can get some eyes on it. Note of businesses out there, if you publish a github repo, it's not a good look if you fail to respond to customers there.

@papercheck
Copy link

I posted the issue in the Authorize.net Developer Community forum under PHP 8 Support for AuthorizeNet/sdk-php.

@kkeith-adg
Copy link

Looks like this was fixed in version 2.0.2

@turbo124
Copy link
Author

turbo124 commented Apr 6, 2021

@kkeith-adg thanks for updating. All my tests are looking green now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants