Sha256: cde6633827a53ba537b312141163f9405a6899c252ac975d7d673e21a293ae6c

Contents?: true

Size: 388 Bytes

Versions: 2

Compression:

Stored size: 388 Bytes

Contents

Spree::Order.class_eval do

  state_machine do
    before_transition :to => :complete, :do => :calcuate_order_adjustement
  end

  def calcuate_order_adjustement
    updater.update_adjustment_total
    updater.update_order_total
    persist_totals
  end


  def cash_on_delivery_payment?
    payments && payments.last.payment_method.is_a?(Spree::CashOnDelivery::PaymentMethod)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_pay_cash_on_delivery-0.1.1 app/models/spree/order_decorator.rb
spree_pay_cash_on_delivery-0.1.0 app/models/spree/order_decorator.rb