Sha256: f21a7001d9611b26beafe93c3d4876904733b5204517d58a9f349ee7bd7af70f

Contents?: true

Size: 1.4 KB

Versions: 29

Compression:

Stored size: 1.4 KB

Contents

module MuffinMan
  module Orders
    class V0 < SpApiClient

      GET_ORDERS_PARAMS = %w[
        CreatedAfter
        CreatedBefore
        LastUpdatedAfter
        LastUpdatedBefore
        OrderStatuses
        FulfillmentChannels
        PaymentMethods
        BuyerEmail
        SellerOrderId
        MaxResultsPerPage
        EasyShipShipmentStatuses
        NextToken
        AmazonOrderIds
        ActualFulfillmentSupplySourceId
        IsISPU
        StoreChainStoreId
      ].freeze

      GET_ORDER_ITEMS_PARAMS = %w[
        NextToken
      ].freeze

      PII_DATA_ELEMENTS = %w[
        buyerInfo shippingAddress buyerTaxInformation
      ]

      def get_orders(marketplace_ids, params = {}, pii_data_elements: [])
        @local_var_path = "/orders/v0/orders"
        @pii_data_elements = pii_data_elements & PII_DATA_ELEMENTS
        @query_params = params.slice(*GET_ORDERS_PARAMS)
        @query_params["MarketplaceIds"] = marketplace_ids
        @request_type = "GET"
        call_api
      end

      def get_order_items(order_id, params = {})
        @query_params = params.slice(*GET_ORDER_ITEMS_PARAMS)
        @local_var_path = "/orders/v0/orders/#{order_id}/orderItems"
        @request_type = "GET"
        call_api
      end

      def get_order_address(order_id)
        @local_var_path = "/orders/v0/orders/#{order_id}/address"
        @request_type = "GET"
        call_api
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
muffin_man-2.0.5 lib/muffin_man/orders/v0.rb
muffin_man-2.0.4 lib/muffin_man/orders/v0.rb
muffin_man-2.0.3 lib/muffin_man/orders/v0.rb
muffin_man-2.0.2 lib/muffin_man/orders/v0.rb
muffin_man-2.0.1 lib/muffin_man/orders/v0.rb
muffin_man-2.0.0 lib/muffin_man/orders/v0.rb
muffin_man-1.5.12 lib/muffin_man/orders/v0.rb
muffin_man-1.5.11 lib/muffin_man/orders/v0.rb
muffin_man-1.5.10 lib/muffin_man/orders/v0.rb
muffin_man-1.5.9 lib/muffin_man/orders/v0.rb
muffin_man-1.5.8 lib/muffin_man/orders/v0.rb
muffin_man-1.5.7 lib/muffin_man/orders/v0.rb
muffin_man-1.5.6 lib/muffin_man/orders/v0.rb
muffin_man-1.5.5 lib/muffin_man/orders/v0.rb
muffin_man-1.5.4 lib/muffin_man/orders/v0.rb
muffin_man-1.5.3 lib/muffin_man/orders/v0.rb
muffin_man-1.5.2 lib/muffin_man/orders/v0.rb
muffin_man-1.5.1 lib/muffin_man/orders/v0.rb
muffin_man-1.5.0 lib/muffin_man/orders/v0.rb
muffin_man-1.4.13 lib/muffin_man/orders/v0.rb