Skip to content

request_options not passed to Square::Internal::JSON::Request in Square::Inventory::Client #219

@davidmtmdesign

Description

@davidmtmdesign

As an example, passing additional_headers doesn't work for Square::Inventory::Client because request_options is not passed to Square::Internal::JSON::Request#new. So it's not possible to set the Square-Version header.

Example of problematic code:

_request = Square::Internal::JSON::Request.new(
  base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
  method: "GET",
  path: "v2/inventory/#{params[:catalog_object_id]}",
  query: _query
)

Probably should be something like this:

_request = Square::Internal::JSON::Request.new(
  base_url: request_options[:base_url] || Square::Environment::PRODUCTION,
  method: "GET",
  path: "v2/inventory/#{params[:catalog_object_id]}",
  query: _query,
  request_options: request_options
)

This is how it's done in Square::Catalog::Client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions