Class: Spree::ReimbursementType::Exchange Private

Inherits:
Spree::ReimbursementType show all
Defined in:
app/models/spree/reimbursement_type/exchange.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants inherited from Spree::ReimbursementType

ORIGINAL

Class Method Summary collapse

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Methods included from Preferences::Preferable

#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Class Method Details

.reimburse(reimbursement, return_items, simulate) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



2
3
4
5
6
7
8
# File 'app/models/spree/reimbursement_type/exchange.rb', line 2

def self.reimburse(reimbursement, return_items, simulate)
  return [] unless return_items.present?

  exchange = Spree::Exchange.new(reimbursement.order, return_items)
  exchange.perform! unless simulate
  [exchange]
end