Error [number 1] During inheritance of JsonSerializable: Uncaught ; File: folder_name/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php; Line: 11
Error [number 8192] 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; File: folder_name/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php; Line: 261
05-09-2023 05:49 AM
If anyone with the same problem comes across this message: in the end, we fixed it ourselves without any help from Authorize.net (can you tell how angry I am about their lack of support?). We took the advice of jdpace2 in the Issues section of the Github repo (https://github.com/AuthorizeNet/sdk-php/issues/440#issuecomment-1622942466
Search for all instances of
public function jsonSerialize()
Replace them with:
#[\ReturnTypeWillChange]
public function jsonSerialize()
This allowed us to move to PHP 8.1 without any issues. It's not a perfect solution, but it works for now.
08-22-2023 03:08 AM