Please update paypal SDK to latest version #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I get this error: geting error sizeof(): Parameter must be an array or an object that implements Countable
The error is in the paypal\rest-api-sdk-php package you are using. The version of the package you are using is, apparently, not exactly compatible with PHP 7.2.
The specific error you are getting has been fixed in the latest version of the package (1.13.0). Update the package to the latest version, and this issue will be fixed. I cannot say what other issues may pop up, though.
In the 1.12.0 version, the specific line that is failing is:
} elseif (sizeof($v) <= 0 && is_array($v)) {
In PHP 7.2, if $v is not Countable, the sizeof() call will emit a warning, and Laravel will turn that warning into an exception.
In the 1.13.0 version, they updated the condition to be
} elseif (is_array($v) && sizeof($v) <= 0) {
Now, sizeof() will only be called when $v is an array, and therefore is guaranteed to be Countable, thus eliminating the warning.
https://stackoverflow.com/a/49506993