Sha256: ecef4614f8126187dd9e9ada8bd80d04e3dbdd5e45ac15fd66f3ef9e1f443d88

Contents?: true

Size: 866 Bytes

Versions: 24

Compression:

Stored size: 866 Bytes

Contents

module Effective
  module Providers
    module Cheque
      extend ActiveSupport::Concern

      def pay_by_cheque
        @order ||= Order.find(params[:id])

        @order.purchase_state = EffectiveOrders::PENDING
        @order.payment_provider = 'cheque'

        EffectiveOrders.authorized?(self, :update, @order)

        @page_title = 'Payment Required'

        if @order.save
          @order.send_pending_order_invoice_to_buyer!
          current_cart.try(:destroy)
          flash.now[:success] = 'Successfully indicated order will be payed by cheque.'
        else
          flash[:danger] = "Unable to save your order: #{@order.errors.full_messages.to_sentence}. Please try again."
          redirect_to effective_orders.order_path(@order)
          return
        end

        render 'effective/orders/cheque/pay_by_cheque'
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
effective_orders-2.2.4 app/controllers/effective/providers/cheque.rb
effective_orders-2.2.3 app/controllers/effective/providers/cheque.rb
effective_orders-2.2.2 app/controllers/effective/providers/cheque.rb
effective_orders-2.2.1 app/controllers/effective/providers/cheque.rb
effective_orders-2.2.0 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.17 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.16 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.15 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.14 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.13 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.12 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.10 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.9 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.8 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.7 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.6 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.5 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.4 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.3 app/controllers/effective/providers/cheque.rb
effective_orders-2.1.2 app/controllers/effective/providers/cheque.rb