Skip to content

Errors with PHP 8.1 and SDK 6.18 #345

@riwalker

Description

@riwalker

Using PHP 8.1, Opencart 3.0.3.9, and Braintree Payments 'BraintreePaymentGatewayPro-2024-3-12'
We were getting errors, which we know were related to lack of PHP 8.1 support from the SDK.
We only use the 'lib' folder from the SDK

“To install it, you unzip the bundle you download and find the "lib" directory inside. You use that to overwrite the /system/library/braintree/lib/ directory on your server. (I would advise making a backup of the existing "lib" directory first, just in case anything happens that will allow you to restore it easily.) ”

I performed an upgrade from the latest PHP library ‘braintree-php-6.19.0’
Seems to have gone ok, I complete a test purchase, and went through ok, and no PHP errors

with prior 6.18, we had the following errors:
2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Error\ErrorCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ErrorCollection.php on line 35 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 97 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 108 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 155 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 143 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 120 2024-08-14 20:54:11 - PHP Unknown: Return type of Braintree\Collection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 131 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Error\ErrorCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ErrorCollection.php on line 35 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 97 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 108 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 155 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 143 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 120 2024-08-14 20:55:27 - PHP Unknown: Return type of Braintree\Collection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 131 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Error\ErrorCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Error/ErrorCollection.php on line 35 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 97 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 108 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 155 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 143 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 120 2024-08-14 20:55:39 - PHP Unknown: Return type of Braintree\Collection::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/myweb/storage/vendor/braintree/braintree_php/lib/Braintree/Collection.php on line 131

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions