Sha256: a74c007c2abd8f59864151454018ad322a7dcf83b8758bf6cc1b6341979e9ae2

Contents?: true

Size: 382 Bytes

Versions: 22

Compression:

Stored size: 382 Bytes

Contents

class PaymentEngines
  def self.new_payment(attributes={})
    Payment.new attributes
  end

  def self.find_contribution(id)
    Contribution.find id
  end

  def self.find_payment filter
    Payment.where(filter).first
  end

  def self.was_credit_card_used_before?(card_id)
    Payment.where(state: 'paid').where("gateway_data -> 'card' ->> 'id' = ?", card_id).exists?
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
catarse_pagarme-3.0.1 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-3.0.0 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.16.3 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.16.2 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.16.1 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.16.0 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.15.0 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.14 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.13 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.12 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.11 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.10 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.9 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.8 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.7 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.6 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.5 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.4 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.3 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.2 spec/dummy/app/models/payment_engines.rb