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-2.14.1 spec/dummy/app/models/payment_engines.rb
catarse_pagarme-2.14.0 spec/dummy/app/models/payment_engines.rb