square-php-sdk
square-php-sdk copied to clipboard
Update Customer empty request payload returns error
https://github.com/square/square-php-sdk/blob/eae87553d5a2f2af5af403227ec43f9a3f6c6e77/src/ApiHelper.php#L173
When we called ->updateCustomer() on the package, if we sent up no parameters to the endpoint, it would return this error. As referenced in the code above, we believe that this is happening because the package is not performing any parsing because we sent no parameters (is returning [] instead of expected {}).
I believe that if the endpoint contains no parameters, it should do something like
json_encode( $array, JSON_FORCE_OBJECT )
to force {} instead of [].
@Dolaned is this still an issue with the latest (currently 17.0.0.20211215) SDK? I know we addressed a bug like this but I'd like to make certain it resolved your issue as well.
Closing this issue, but if anyone finds that they are still experiencing this with 17.0.0.20211215 or later, please feel free to reopen and provide more details
Cheers!