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

Deprecated: Return type of net\authorize\api\contract\v1\MerchantAuthenticationType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php on line 261 #437

Open
pthreat opened this issue Sep 13, 2022 · 25 comments

Comments

@pthreat
Copy link

pthreat commented Sep 13, 2022

Deprecated: Return type of net\authorize\api\contract\v1\MerchantAuthenticationType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php on line 261

For PHP 8.1

@efitz16
Copy link

efitz16 commented Oct 24, 2022

Bumping, as we are getting the same issue, and it's making implementation with 8.1 difficult.

@XIAOXIAOSIYU
Copy link

Same deprecation warning here:

( ! ) Deprecated: Return type of net\authorize\api\contract\v1\CreditCardSimpleType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in public_html\vendor\authorizenet\authorizenet\lib\net\authorize\api\contract\v1\CreditCardSimpleType.php on line 70

For PHP 8.1

@csears123
Copy link

Same error for me when running on PHP 8.1:

Error: 500
Return type of net\authorize\api\contract\v1\MerchantAuthenticationType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

This is a pretty critical issue, not supporting the latest PHP version. End of support for PHP 7.4 is only weeks away, and going back to 8.0 isn't ideal.

@zhartaunik
Copy link

#439

@csears123
Copy link

@zhartaunik, I ended up forking this repo and adding the return type 'mixed' to all the jsonSerialize() class methods.

The AuthorizeNet contributing guidelines below will not accept PRs for changes to the auto-generated request and response classes:
https://github.com/AuthorizeNet/sdk-php/blob/a3e76f96f674d16e892f87c58bedb99dada4b067/CONTRIBUTING.md

"Part of the SDK is auto-generated based on the XML schema. Due to this auto-generation, we cannot merge contributions for request or response classes. You are welcome to open an issue to report problems or suggest improvements. Auto-generated classes include all files inside contract/v1 and controller folders, except controller/base."

Hoping the AuthorizeNet sdk owners will make these simple changes to support PHP 8.1.

@zhartaunik
Copy link

@csears123 thanks for your response. Looks like I have to use my own fork for the client...

@eneerge
Copy link

eneerge commented Feb 13, 2023

Same issue today.

@Usmanbashir123
Copy link

Hi
Facing the same issue in Magento2.2.5p2(cloud) with PHP version 8.1 . Anyone got the solution of it ? I we add the #[\ReturnTypeWillChange] in core file function where its break , its behaves normally , But i don't want to change the core file . I tried to override the same file in custom module but code breaks on compile then . Anyone have the solution to make it work ?

@dustincochran
Copy link

Still waiting for the devs to make this simple adjustment or to accept the pull request. Looks like I'll need to use forked versions.

@Usmanbashir123
Copy link

Usmanbashir123 commented May 11, 2023 via email

@dustincochran
Copy link

dustincochran commented May 11, 2023 via email

@Usmanbashir123
Copy link

The packagist.org website has been updated to version 2.0.4 and the link to access it is https://packagist.org/packages/powersync/authorizenet-sdk-php.

@XIAOXIAOSIYU
Copy link

The packagist.org website has been updated to version 2.0.4 and the link to access it is https://packagist.org/packages/powersync/authorizenet-sdk-php.

Is this an official package from the Authorize.Net team?

@dustincochran
Copy link

dustincochran commented Jun 21, 2023 via email

@davidfeldt
Copy link

davidfeldt commented Dec 17, 2023

There are at least four locations in the codebase where this deprecated issue exists:

Deprecated: Return type of net\authorize\api\contract\v1\MerchantAuthenticationType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php on line 261


Deprecated: Return type of net\authorize\api\contract\v1\CreditCardSimpleType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardSimpleType.php on line 70


Deprecated: Return type of net\authorize\api\contract\v1\PaymentType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentType.php on line 233


Deprecated: Return type of net\authorize\api\contract\v1\OrderType::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/OrderType.php on line 502


Why haven't the Authorize.net developers updated / refactored this SDK to work with PHP8.1+? In over ONE YEAR?

I do not want to use a non-official version (using composer).

@dustincochran
Copy link

dustincochran commented Dec 18, 2023 via email

@davidfeldt
Copy link

davidfeldt commented Dec 18, 2023 via email

@LEO-Network
Copy link

Is there a manual fix for this issue? I need to get this code up and running.

@dustincochran
Copy link

dustincochran commented Dec 29, 2023 via email

@LEO-Network
Copy link

Yes, you can manually change all 174 files like "zhartaunik" did. Or, you can just do what I did and use his version " https://github.com/zhartaunik/authorizenet-sdk-php" and don't update unless you review the changes. You can review the changes here: master...zhartaunik:authorizenet-sdk-php:master You will see 99% of the changes are just adding a function return type helper to the jsonSerialize function of "mixed".

On Thu, Dec 28, 2023 at 9:27 PM LEO-Network @.> wrote: Is there a manual fix for this issue? I need to get this code up and running. — Reply to this email directly, view it on GitHub <#437 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQDTA227MKUBGSBELJRIU3YLYTBHAVCNFSM6AAAAAAQLX6YRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGY4DEOBWGE . You are receiving this because you commented.Message ID: @.>
-- ~ Dustin

I'm still getting this error with php 8.0.

Deprecated: Creation of dynamic property net\authorize\util\Log::$sensitiveStringRegexes is deprecated in /home/mzkxqimy/public_html/sdk/lib/net/authorize/util/Log.php on line 366

@LEO-Network
Copy link

LEO-Network commented Jan 1, 2024

I'm at a loss here. I tried what you said, still didn't work. I found that people were saying 2.02 worked. I tried that, still doesn't work. 2.02 brings back to the json serialize errors as well as the $senstiiveStringRegexes error

@dustincochran
Copy link

dustincochran commented Jan 2, 2024 via email

@resumeblaze
Copy link

Yes, you can manually change all 174 files like "zhartaunik" did. Or, you can just do what I did and use his version " https://github.com/zhartaunik/authorizenet-sdk-php" and don't update unless you review the changes. You can review the changes here: master...zhartaunik:authorizenet-sdk-php:master You will see 99% of the changes are just adding a function return type helper to the jsonSerialize function of "mixed".

On Thu, Dec 28, 2023 at 9:27 PM LEO-Network @.> wrote: Is there a manual fix for this issue? I need to get this code up and running. — Reply to this email directly, view it on GitHub <#437 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQDTA227MKUBGSBELJRIU3YLYTBHAVCNFSM6AAAAAAQLX6YRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZRGY4DEOBWGE . You are receiving this because you commented.Message ID: @.>
-- ~ Dustin

I can confirm this worked for me. I was able to fork the official repository https://github.com/AuthorizeNet/sdk-php and suppress the error notices like @zhartaunik did. https://github.com/resumeblaze/sdk-php.

I also put in a ticket with Authorize.net support. I suggest that everyone does the same at https://support.authorize.net/. Hopefully more squeaky wheels will get an updated version. They did update the SDK to accommodate PHP 8.0 in 2021.

@JackStromberg
Copy link

JackStromberg commented Jan 17, 2024

Per support: "It looks like there are currently no plans to update SDK-PHP."

Hopefully more folks bubble up support cases on this; that's a massive segment of customers to lose if they abandon those using PHP based CMS systems.

@resumeblaze appreciate you championing a fork to support us running 8.2 and greater! Cheers!

@resumeblaze
Copy link

@JackStromberg, thank you for the update. That is funny, the support team told me something different. Based on your interaction with Authorize.net support, I published the forked repo I am using in production to packagist.org. I tested the repo on resumeblaze.com and there hasn't been any issues. We have been successfully processing credit cards using PHP8.3.

You can now use composer to install the releases that best suite your needs. The package can be found at https://packagist.org/packages/resumeblaze/authorizenet.

Version 2.0.3 - PHP8.1 Support
Version 2.0.4 - PHP8.2 Support
Version 2.0.5 - PHP8.3 Support

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