Class: SpreeCmCommissioner::Integrations::Larryta::Inventory::ExternalInventoryItemStatus

Inherits:
Object
  • Object
show all
Includes:
Spree::ServiceModule::Base
Defined in:
app/services/spree_cm_commissioner/integrations/larryta/inventory/external_inventory_item_status.rb

Overview

Fetches detailed status for a specific inventory item (seat) from Larryta Uses the check_transaction! API (aliased as inventory_item_status!)

Instance Method Summary collapse

Instance Method Details

#call(integration:, order:, options:) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/spree_cm_commissioner/integrations/larryta/inventory/external_inventory_item_status.rb', line 12

def call(integration:, order:, options:)
  @integration = integration
  @order = order
  @options = options
  validate_params!

  item_status = fetch_item_status

  success(item_status: item_status)
rescue SpreeCmCommissioner::Integrations::ExternalClientError => e
  failure(nil, e.message)
end