Class: Starling::Services::MerchantLocationsService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/starling/services/merchant_locations_service.rb

Overview

A service for accessing the Merchant API's Get Location endpoint

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from Starling::Services::BaseService

Instance Method Details

#get(merchant_id, merchant_location_id, params: {}, headers: {}) ⇒ Resources::MerchantLocationResource

Parameters:

  • merchant_id (String)

    The Starling internal ID of the merchant the merchant location belongs to

  • merchant_location_id (String)

    The Starling internal ID of the merchant location

  • params (Hash) (defaults to: {})

    Parameters which will be included in the HTTP request, included in the URL as a query string

  • headers (Hash) (defaults to: {})

    Headers which be included in the HTTP request, merged on top of the headers set at the Client level

Returns:

Raises:

  • (Errors::ApiError)

    if the HTTP request returns a status indicating that it was unsuccessful


16
17
18
19
20
21
22
23
24
25
# File 'lib/starling/services/merchant_locations_service.rb', line 16

def get(merchant_id, merchant_location_id, params: {}, headers: {})
  response = api_service.make_request(
    :get,
    "/merchants/#{merchant_id}/locations/#{merchant_location_id}",
    params: params,
    headers: headers
  )

  resource.new(response: response)
end