Class: Workarea::Admin::PaymentViewModel

Inherits:
ApplicationViewModel
  • Object
show all
Defined in:
app/view_models/workarea/admin/payment_view_model.rb

Instance Method Summary collapse

Instance Method Details

#can_capture?Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'app/view_models/workarea/admin/payment_view_model.rb', line 15

def can_capture?
  return @can_capture if defined?(@can_capture)
  @can_capture = tenders.any?(&:capturable?)
end

#can_refund?Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'app/view_models/workarea/admin/payment_view_model.rb', line 10

def can_refund?
  return @can_refund if defined?(@can_refund)
  @can_refund = tenders.any?(&:refundable?)
end

#transactionsObject



4
5
6
7
8
# File 'app/view_models/workarea/admin/payment_view_model.rb', line 4

def transactions
  @transactions ||= TransactionViewModel.wrap(
    tenders.map(&:transactions).flatten
  )
end