Comments (3)
These deprecation notices were annoying enough that I forked and patched the code on our servers with the #[\ReturnTypeWillChange]
attribute, but it should be fixed for everyone.
I can't submit a pull request for this, apparently, as per the project guidelines:
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.
Temporary fixes:
-
There are 175
jsonSerialize()
method signatures, so if you want to patch your own fork, here's a regex to fix them all quickly:- Find:
\n(\s+)(.+)function jsonSerialize
- Replace:
\n$1#[\\ReturnTypeWillChange]\n$1$2function jsonSerialize
- Find:
-
Or you can use our fork by updating
composer.json
:"require": { ... "authorizenet/authorizenet": "dev-php8_1-jsonSerialize-deprecation-fix#b53902ebcd7d095cf5271da69db02d823ddc23d3", ... }, ... "repositories": [ { "type": "vcs", "url": "https://github.com/BrownBoots/authorizenet-sdk-php.git" } ]
from sdk-php.
@Zelfapp To be clear, my fork only suppresses the messages. The AuthorizeNet team might want to instead change the return type to mixed
for all of the functions. It depends on how they're going to handle compatibility — that return type didn't exist before PHP 8.0 — i.e. whether they're going to maintain a separate PHP branch, or if they're going to continue with one release branch for all PHP versions.
from sdk-php.
@LordPachelbel thank you for fork. PR's seem to be stuck for PHP 8.1 issues. Anet team, please get these PHP 8.1 updates pulled in.
from sdk-php.
Related Issues (20)
- Response class (file) does not exist. HOT 3
- getTransId() not returning expected result
- Need guide about fixing " Posts Are Returning 404 Errors" HOT 1
- TLS Issues with AWS HOT 2
- How to send extra options in charge Customer Profile? I want to send x_duplicate_window=0 in my function which is charging saved profile.
- Proxy server setting for SDK
- net\authorize\api\contract\v1\CreateCustomerProfileFromTransactionResponse does not exist HOT 3
- authorize SDK and PHP74 compatibility warnings and errors from PHP_CodeSniffer-3.6.1 and PHPCompatibility-9.3.5 HOT 1
- E00007:User authentication failed due to invalid authentication values. HOT 1
- Sdk
- CreateTransactionController returns null, conflicting examples HOT 3
- After upgrading from 1.9.9 to ^2.x having "className" not found during the class mapping
- AnetApiSchema.xsd.xml
- Error when scanning package for php 8.1 compatibility
- Incorrect responseType in CreateCustomerProfileFromTransactionController HOT 4
- 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 HOT 25
- No 8.1 support in 2023 is actually insane. HOT 40
- Payment decline but receive payment in my authorize wallet HOT 2
- method getSubscriptionId() not defined .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk-php.