Class: Admin::OrdersController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/orders_controller.rb

Instance Method Summary collapse

Instance Method Details

#capture_paymentObject


7
8
9
10
11
12
13
14
# File 'app/controllers/admin/orders_controller.rb', line 7

def capture_payment
  respond_to do |format|
    format.html do
      @order.payment_method.kapture! @order
      redirect_to admin_order_path(@order), notice: "Amount was successfully captured"
    end
  end
end

#indexObject


25
26
27
28
# File 'app/controllers/admin/orders_controller.rb', line 25

def index
  @orders = Order.order('id desc')
  respond_with @orders
end

#purchase_paymentObject


16
17
18
19
20
21
22
23
# File 'app/controllers/admin/orders_controller.rb', line 16

def purchase_payment
  respond_to do |format|
    format.html do
      @order.purchase!
      redirect_to admin_order_path(@order), notice: "Amount was successfully paid"
    end
  end
end

#showObject


30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/admin/orders_controller.rb', line 30

def show
  if @order.shipments.any?
    @shipment = @order.shipments.first
  else
    @shipment = @order.shipments.build
    @shipment.notify_customer = 1
  end

  respond_with @order
end