Class: Workarea::Storefront::RefundViewModel

Inherits:
ApplicationViewModel
  • Object
show all
Defined in:
app/view_models/workarea/storefront/refund_view_model.rb

Instance Method Summary collapse

Instance Method Details

#tendersObject



4
5
6
7
8
9
10
11
12
13
# File 'app/view_models/workarea/storefront/refund_view_model.rb', line 4

def tenders
  @tenders ||= Hash[
    model.amounts.map do |tender_id, amount|
      tender = payment.tenders.detect { |t| t.id.to_s == tender_id.to_s }
      amount = Money.demongoize(amount)

      [tender, amount]
    end
  ]
end