You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Language, language version, and OS: PHP 8.0 on Linux
Issue description
[TypeError]
array_map(): Argument #2 ($array) must be of type array, null given
Exception trace:
at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:97
Braintree\Base->Braintree{closure}() at n/a:n/a
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:97
Braintree\Base->Braintree{closure}() at n/a:n/a
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at ...
The problem occurs within your toArray() function when $this->_attributes is null as PHP expects array for array_map.
In our case the problem occurs with riskData->liabilityShift is null. riskData->decisionReasons is an empty array for example and that works.
The text was updated successfully, but these errors were encountered:
👋 @asdfklgash sorry for the delay. We can absolutely fix up our code to be more defensive. Would you mind also contacting Technical Support, as I think something might have changed with our API that's resulting in this error in the SDK? They'll need recent example API calls where you've encountered this scenario so that they can find any related logs and communicate with our API engineering teams.
General information
Issue description
[TypeError]
array_map(): Argument #2 ($array) must be of type array, null given
Exception trace:
at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:97
Braintree\Base->Braintree{closure}() at n/a:n/a
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:97
Braintree\Base->Braintree{closure}() at n/a:n/a
array_map() at /var/www/vendor/braintree/braintree_php/lib/Braintree/Base.php:101
Braintree\Base->toArray() at ...
The problem occurs within your
toArray()
function when$this->_attributes
isnull
as PHP expectsarray
forarray_map
.In our case the problem occurs with
riskData->liabilityShift
isnull
.riskData->decisionReasons
is an empty array for example and that works.The text was updated successfully, but these errors were encountered: