Class: Io::Flow::V0::Clients::OrderPromotions

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OrderPromotions

Returns a new instance of OrderPromotions.



2293
2294
2295
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2293

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#delete_by_key(organization, key) ⇒ Object

Deletes the order promotion with the specified key



2298
2299
2300
2301
2302
2303
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2298

def delete_by_key(organization, key)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('key', key, String)
  r = @client.request("/#{CGI.escape(organization)}/order/promotions/#{CGI.escape(key)}").delete
  nil
end