Class: BillingsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/billings_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



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

def edit
  @account = 

  @account.cardholder_name = @account.credit_card.cardholder_name
  @account.billing_email = @account.customer.email
  @account.expiration_month = @account.credit_card.expiration_month
  @account.expiration_year = @account.credit_card.expiration_year
end

#showObject



4
5
# File 'app/controllers/billings_controller.rb', line 4

def show
end

#updateObject



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

def update
  @account = 
  if @account.save_braintree!(params[:account])
    redirect_to (@account), :notice => t('.update.notice', :default => "Billing information updated successfully")
  else
    render :edit
  end
end