Sha256: 91f33148eb4e523cd60c6a0a8da8ce5c703634cebdb85f8eb006b6921e37f39a

Contents?: true

Size: 590 Bytes

Versions: 8

Compression:

Stored size: 590 Bytes

Contents

# frozen_string_literal: true

module FlowcommerceSpree
  class OrdersController < ApplicationController
    wrap_parameters false

    skip_before_action :setup_tracking, only: :order_completed

    # proxy enpoint between flow and thankyou page.
    # /flow/order_completed endpoint
    def order_completed
      order = Spree::Order.find_by number: params[:order], guest_token: params[:t]

      flow_updater = FlowcommerceSpree::OrderUpdater.new(order: order)
      flow_updater.complete_checkout

      redirect_to "/thankyou?order=#{params[:order]}&t=#{params[:t]}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
flowcommerce_spree-0.0.13 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.12 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.11 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.10 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.9 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.8 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.7 app/controllers/flowcommerce_spree/orders_controller.rb
flowcommerce_spree-0.0.6 app/controllers/flowcommerce_spree/orders_controller.rb