Class: Square::Fee

Overview

Class Method Summary collapse

Methods included from APIOperations::Delete

delete

Methods included from APIOperations::Update

update

Methods included from APIOperations::Create

create

Methods included from APIOperations::Retrieve

retrieve

Methods included from APIOperations::List

list

Methods inherited from APIResource

data_type, endpoint_base, nested_under

Class Method Details

.apply(item_id, fee_id, params = {}) ⇒ Square::DataType

Adjust inventory for a varation.

Parameters:

  • item_id (String)

    Item ID.

  • fee_id (String)

    Fee ID.

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

    Params hash. Optional.

Returns:


20
21
22
23
24
25
26
27
28
29
# File 'lib/square/fee.rb', line 20

def self.apply(item_id, fee_id, params = {})
  response = Square.make_request(
    method: 'PUT',
    endpoint: "items/#{item_id}/fees/#{fee_id}",
    params: params
  )

  response = Square.parse_response(response)
  Square::DataTypes::Item.new(response)
end

.remove(item_id, fee_id, params = {}) ⇒ Square::DataType

Adjust inventory for a varation.

Parameters:

  • item_id (String)

    Item ID.

  • fee_id (String)

    Fee ID.

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

    Params hash. Optional.

Returns:


38
39
40
41
42
43
44
45
46
47
# File 'lib/square/fee.rb', line 38

def self.remove(item_id, fee_id, params = {})
  response = Square.make_request(
    method: 'DELETE',
    endpoint: "items/#{item_id}/fees/#{fee_id}",
    params: params
  )

  response = Square.parse_response(response)
  Square::DataTypes::Item.new(response)
end