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-1.4.12 lib/muffin_man/orders/v0.rb
muffin_man-1.4.11 lib/muffin_man/orders/v0.rb
muffin_man-1.4.10 lib/muffin_man/orders/v0.rb
muffin_man-1.4.9 lib/muffin_man/orders/v0.rb
muffin_man-1.4.8 lib/muffin_man/orders/v0.rb
muffin_man-1.4.7 lib/muffin_man/orders/v0.rb
muffin_man-1.4.6 lib/muffin_man/orders/v0.rb
muffin_man-1.4.5 lib/muffin_man/orders/v0.rb
muffin_man-1.4.4 lib/muffin_man/orders/v0.rb