Class: Payola::CardsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Payola::CardsController
- Defined in:
- app/controllers/payola/cards_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/payola/cards_controller.rb', line 6 def create if params[:customer_id].present? && params[:stripeToken].present? Payola::CreateCard.call(params[:customer_id], params[:stripeToken]) = { notice: t('payola.cards.created') } else = { alert: t('payola.cards.not_created') } end redirect_to return_to, flash: end |
#destroy ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/payola/cards_controller.rb', line 16 def destroy if params[:id].present? && params[:customer_id].present? Payola::DestroyCard.call(params[:id], params[:customer_id]) = { notice: t('payola.cards.destroyed') } else = { alert: t('payola.cards.not_destroyed') } end redirect_to return_to, flash: end |