Sha256: 25fa8ba2a32f25c47966aa6fbc42fa7479bc4983b440b51ea65f8c741e935b4c

Contents?: true

Size: 836 Bytes

Versions: 7

Compression:

Stored size: 836 Bytes

Contents

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

          def show
            render_serialized_payload { serialize_resource(resource) }
          end

          private

          def resource
            resource = resource_finder.new(number: params[:number], token: order_token).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
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_api-4.0.2 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.0 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.0.rc3 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.0.rc2 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.0.rc1 app/controllers/spree/api/v2/storefront/order_status_controller.rb
spree_api-4.0.0.beta app/controllers/spree/api/v2/storefront/order_status_controller.rb