Class: Workarea::Api::Storefront::SavedCreditCardsController
Instance Method Summary
collapse
#assert_current_metrics_id, #cache_page, #skip_session
#authentication?, #current_user, find_user
Instance Method Details
#create ⇒ Object
15
16
17
18
|
# File 'app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb', line 15
def create
@credit_card = @payment_profile.credit_cards.create!(card_params)
render :show
end
|
#destroy ⇒ Object
27
28
29
30
|
# File 'app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb', line 27
def destroy
@payment_profile.credit_cards.find(params[:id]).destroy
head :no_content
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb', line 7
def index
@credit_cards = @payment_profile.credit_cards
end
|
#show ⇒ Object
11
12
13
|
# File 'app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb', line 11
def show
@credit_card = @payment_profile.credit_cards.find(params[:id])
end
|
#update ⇒ Object
20
21
22
23
24
25
|
# File 'app/controllers/workarea/api/storefront/saved_credit_cards_controller.rb', line 20
def update
@credit_card = @payment_profile.credit_cards.find(params[:id])
@credit_card.update_attributes!(card_params)
render :show
end
|