Sha256: dc8b8777800aef7e8c316a8d5f24c91113a3cfb894ac2ac4e3fbe19f3dab78cd

Contents?: true

Size: 837 Bytes

Versions: 4

Compression:

Stored size: 837 Bytes

Contents

module FastshopCatalog
  class CheckAvailabilityService < FastshopCatalog::BaseService

    def initialize
      @service = 'FastServices.WsConsultaDisponibilidade/ConsultaDisponibilidade.svc/service'
      @interface = 'IConsultaDisponibilidade'
      @soap_method = :retorna_dados
      @return_key = 'Disponibilidade'
      super(:namespaces => {'xmlns:fas' => 'http://schemas.datacontract.org/2004/07/FastServices.WsConsultaDisponibilidade.Componentes'})
    end

    def check(order)
      root_attributes = order.to_map
      adapted_items = []
      root_attributes['Itens'].each do |item|
        adapted_items << {'fas:PedidoItensEntity' => adapt_output(item.to_map, 'fas')}
      end
      root_attributes['Itens'] = adapted_items
      service_invoker('dadosPedido' => adapt_output(root_attributes, 'fas'))
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.7 lib/fastshop_catalog/check_availability_service.rb
fastshop_catalog-0.0.6 lib/fastshop_catalog/check_availability_service.rb
fastshop_catalog-0.0.5 lib/fastshop_catalog/check_availability_service.rb
fastshop_catalog-0.0.3 lib/fastshop_catalog/check_availability_service.rb