Class: TbCommerce::CheckoutController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tb_commerce/checkout_controller.rb

Instance Method Summary collapse

Instance Method Details

#billingObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/tb_commerce/checkout_controller.rb', line 14

def billing
  if tb_commerce_current_cart.order.blank?
    redirect_to tb_commerce_checkout_path and return
  end

  @credit_card = TbCommerce::CreditCard.new()
  if !Rails.env.production?
    # These values will work against the Stripe sandbox environment
    @credit_card.card_number = 4242424242424242
    @credit_card.card_ccv = 123
    @credit_card.card_expiration = Date.today.next_year
  end

  render 'billing'
end

#newObject



6
7
8
9
10
11
12
# File 'app/controllers/tb_commerce/checkout_controller.rb', line 6

def new
  @order = TbCommerce::Order.new()
  if current_user
    @order.email = current_user.email
  end
  render 'new'
end