Sha256: a380aa2e7f921cfcb202c7cbfa97f990309e6fa122bff84b179019b5725c5ac8

Contents?: true

Size: 925 Bytes

Versions: 36

Compression:

Stored size: 925 Bytes

Contents

module Spree
  module Api
    module V2
      module Storefront
        class OrderStatusController < ::Spree::Api::V2::ResourceController
          include Spree::Api::V2::Storefront::OrderConcern

          before_action :ensure_order_token

          private

          def resource
            resource = resource_finder.new(number: params[:number], token: order_token, store: current_store).execute.take
            raise ActiveRecord::RecordNotFound if resource.nil?

            resource
          end

          def resource_finder
            Spree::Api::Dependencies.storefront_completed_order_finder.constantize
          end

          def resource_serializer
            Spree::Api::Dependencies.storefront_cart_serializer.constantize
          end

          def ensure_order_token
            raise ActiveRecord::RecordNotFound unless order_token.present?
          end
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 3 rubygems

Version Path
spree_api-4.10.1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.10.0 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.9.0 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.8.3 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.8.2 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.7.3 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.6 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.5.5 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.3.3 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.4.1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.5.4 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.5 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.7.2 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.7.1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.4 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.7.0 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.3 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.2 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.6.0 app/controllers/spree/api/v2/storefront/order_status_controller.rb