braintree / braintree_php

Braintree PHP library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
547 stars 224 forks source link

Fatal error with PHP8 and v3 #299

Closed ziemkowski closed 3 years ago

ziemkowski commented 3 years ago

General information

Issue description

The latest v3 release has a fatal error in php8:

PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported
in composer/braintree/braintree_php/lib/Braintree/Digest.php on line 53
crookedneighbor commented 3 years ago

:wave: v6.x is the actively maintained version of this SDK. Does the same issue happen when running PHP 8 against v6 of the SDK?

ziemkowski commented 3 years ago

@crookedneighbor Thanks for the quick response. We're not in a position to be able to refactor our usage, since v4 introduced a significantly different design pattern.

I wouldn't have submitted the issue, but the readme says v3 is still supported, so figured I would.

scannillo commented 3 years ago

👋 Hello - our Deprecation Policy defines an "Inactive" SDK as one where "No new features will be added, only security updates."

Since this is not a security issue, and our "active" SDK version offers official support for PHP 8+, we encourage you to update to v6.x of our PHP SDK if you want to use PHP 8.

ziemkowski commented 3 years ago

Do you know if there is a migration guide still available for v4? I thought that the upgrade path from v3 was heavier than the v5/v6 migration guide suggests.

crookedneighbor commented 3 years ago

Looking at the v4 changelog, most of the breaking changes were removing classes for APIs that are no longer in use: https://github.com/braintree/braintree_php/blob/master/CHANGELOG.md#400

The only other potentially breaking changes I see are the removal of some snake case properties in favor of camel case properties:

Remove riskData, applePay, applePayCard, threeDSecure, and venmo.profileId snakecase attributes

And renaming DownForMaintance error to ServiceUnavailable