Class: Spree::ReimbursementPerformer

Inherits:
Object
  • Object
show all
Defined in:
core/app/models/spree/reimbursement_performer.rb

Class Method Summary collapse

Class Method Details

.perform(reimbursement, created_by: nil) ⇒ Object

Actually perform the reimbursement



22
23
24
25
26
27
# File 'core/app/models/spree/reimbursement_performer.rb', line 22

def perform(reimbursement, created_by: nil)
  unless created_by
    Spree::Deprecation.warn("Calling #perform on #{self} without created_by is deprecated")
  end
  execute(reimbursement, false, created_by: created_by)
end

.simulate(reimbursement, created_by: nil) ⇒ Object

Simulate performing the reimbursement without actually saving anything or refunding money, etc. This must return an array of objects that respond to the following methods:

  • #description

  • #display_amount

so they can be displayed in the Admin UI appropriately.



14
15
16
17
18
19
# File 'core/app/models/spree/reimbursement_performer.rb', line 14

def simulate(reimbursement, created_by: nil)
  unless created_by
    Spree::Deprecation.warn("Calling #simulate on #{self} without created_by is deprecated")
  end
  execute(reimbursement, true, created_by: created_by)
end