Class: Workarea::Admin::TransactionViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Admin::TransactionViewModel
- Defined in:
- app/view_models/workarea/admin/transaction_view_model.rb
Instance Method Summary collapse
- #can_be_captured? ⇒ Boolean
- #order_id ⇒ Object
- #payment_title ⇒ Object
- #payment_type ⇒ Object
- #status ⇒ Object
Instance Method Details
#can_be_captured? ⇒ Boolean
34 35 36 |
# File 'app/view_models/workarea/admin/transaction_view_model.rb', line 34 def can_be_captured? model.action == 'authorize' end |
#order_id ⇒ Object
4 5 6 |
# File 'app/view_models/workarea/admin/transaction_view_model.rb', line 4 def order_id model.payment_id end |
#payment_title ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/view_models/workarea/admin/transaction_view_model.rb', line 16 def payment_title if model.tender.present? payment_type.titleize else t('workarea.admin.payment_transactions.tender.title') end end |
#payment_type ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/view_models/workarea/admin/transaction_view_model.rb', line 8 def payment_type if model.tender.present? model.tender.class.name.demodulize.underscore else t('workarea.admin.payment_transactions.tender.missing') end end |
#status ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'app/view_models/workarea/admin/transaction_view_model.rb', line 24 def status if canceled? t('workarea.admin.payment_transactions.status.canceled') elsif success? t('workarea.admin.payment_transactions.status.success') else t('workarea.admin.payment_transactions.status.failure') end end |