Class: Workarea::Storefront::GiftCardsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/storefront/gift_cards_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
# File 'app/controllers/workarea/storefront/gift_cards_controller.rb', line 4

def index
end

#lookupObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/workarea/storefront/gift_cards_controller.rb', line 7

def lookup
  gift_card = Workarea::GiftCards.gateway.lookup(params)

  if gift_card.present?
    flash[:success] = t(
      'workarea.storefront.flash_messages.gift_card_balance',
      balance: gift_card.balance.format
    )
  else
    flash[:error] = t('workarea.storefront.flash_messages.gift_card_not_found')
  end

  redirect_to gift_cards_balance_path
end