Sha256: e5be8be6ade1c0e3a5ecc34d066ab8c3792b8a7c878671f3c9385185a5f5c2bb

Contents?: true

Size: 290 Bytes

Versions: 16

Compression:

Stored size: 290 Bytes

Contents

class Payment < ActiveRecord::Base
  belongs_to :order 
  after_save :check_payments
  after_destroy :check_payments
  
  private
  def check_payments                            
    return unless order.checkout_complete       
    order.pay! if order.payment_total >= order.total
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
kdmny-spree-0.0.1 app/models/payment.rb
spree-enriquez-0.9.4 app/models/payment.rb
spree-0.9.4 app/models/payment.rb
spree-0.9.3 app/models/payment.rb
spree-0.9.2 app/models/payment.rb
spree-0.9.1 app/models/payment.rb
spree-0.9.0 app/models/payment.rb
spree-0.8.4 app/models/payment.rb
spree-0.8.5 app/models/payment.rb
spree-0.6.0 app/models/payment.rb
spree-0.7.0 app/models/payment.rb
spree-0.7.1 app/models/payment.rb
spree-0.8.0 app/models/payment.rb
spree-0.8.1 app/models/payment.rb
spree-0.8.2 app/models/payment.rb
spree-0.8.3 app/models/payment.rb