square-php-sdk icon indicating copy to clipboard operation
square-php-sdk copied to clipboard

Update Customer empty request payload returns error

Open Dolaned opened this issue 3 years ago • 1 comments

https://github.com/square/square-php-sdk/blob/eae87553d5a2f2af5af403227ec43f9a3f6c6e77/src/ApiHelper.php#L173

image

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 avatar Oct 06 '21 01:10 Dolaned

@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.

wolfadex avatar Jan 19 '22 16:01 wolfadex

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!

zenmasterjobo avatar May 31 '23 18:05 zenmasterjobo