square / connect-php-sdk

PHP client library for the Square Connect APIs
https://developer.squareup.com/docs
Apache License 2.0
114 stars 55 forks source link

Link Header case broke getV1BatchTokenFromHeaders #101

Closed thunberg closed 4 years ago

thunberg commented 4 years ago

getV1BatchTokenFromHeaders fails to parse the batch token using headers returned from a V1TransactionsApi listPaymentsWithHttpInfo call since it looks for isset($http_headers['Link']) and headers are now returned lowercase.

To be clear, a one character workaround is isset($http_headers['link']) on line 289 in ApiClient (note lowercase "link").

Any suggestions?

StephenJosey commented 4 years ago

Thanks for reporting! We'll take a look. To get around this, feel free to download the SDK repo locally and use it instead of via Composer etc, and make the change in your local SDK so it correctly retrieves the link header.

I'll update this once we actually resolve this or have more information, though.

StephenJosey commented 4 years ago

Just heard back from internal teams, the server behavior causing this has now been rolled back. So, Link will be served as you initially expected (with the first letter uppercase). So, if you did the change I suggested above, it would now break (sorry!). Please let me know if you do have additional questions, though!

thunberg commented 4 years ago

Thank you for the reply, but still coming through lowercase for me.

StephenJosey commented 4 years ago

...try again! No, seriously, we realized we missed a spot, and this should now really be resolved 😄. Sorry for the confusion, but appreciate you letting us know. Definitely let us know if you have any further issues or questions in the future!