Sha256: 1c4cd806fba41bb178612f7be56fb6bbb709b612f80b1b92e4458cac7af42ece

Contents?: true

Size: 667 Bytes

Versions: 1

Compression:

Stored size: 667 Bytes

Contents

module FastshopCatalog
  class OrderPlacementService < FastshopCatalog::BaseService

    def initialize
      @service = :colocacao_pedido
      @interface = 'IColocacaoPedido'
      @soap_method = :incluir_pedido
      @return_key = 'NumeroPedidoFast'
      super
    end

    def place_order(order)
      payload = order.to_map
      items = []
      payload["Itens"].each do |item|
        items << item.to_map
      end
      payload["Itens"] = items
      payload = payload.to_json
      AUX_LOG.debug('Order as json: ' + payload)
      service_invoker_with_encryption('entrada', 'contrato' => order.contract_code,
      'entrada' => payload)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastshop_catalog-0.0.8 lib/fastshop_catalog/order_placement_service.rb