Sha256: bc331f09a86d3de2c4f341d100c3835b1a459f321fec474cf5923a65bc445b8c

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

Spree::PaymentMethod.class_eval do
  calculated_adjustments
  
  def self.send_calculator(id = nil)
    if id
      if Spree::PaymentMethod.find(id).class.to_s.match(/Gateway/)
        return Spree::Gateway.calculators.sort_by(&:name)
      elsif Spree::PaymentMethod.find(id).class.to_s.match(/BillingIntegration/)
        return Spree::BillingIntegration.calculators.sort_by(&:name)
      else
        return Spree::PaymentMethod.calculators.sort_by(&:name)
      end
    else
      return Spree::PaymentMethod.calculators.sort_by(&:name)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_payment_calculator-1.1.0 app/model/spree/payment_method_decorator.rb
spree_payment_calculator-1.0.2 app/model/spree/payment_method_decorator.rb
spree_payment_calculator-1.0.1 app/model/spree/payment_method_decorator.rb