Sha256: 8a57eacd0ca29ab5aae7e0b069691e21c921ba6fa7b01881a6d5c60f735653f9

Contents?: true

Size: 1.12 KB

Versions: 59

Compression:

Stored size: 1.12 KB

Contents

class Caren::Store::Payment < Caren::Base

  def self.keys
    [:id,                 # Integer (Caren id)
     :invoice_id,         # Integer (Caren invoice id)
     :person_id,          # Integer (Caren person id)
     :auth_code,          # String
     :psp_reference,      # String
     :refusal_reason,     # String
     :result_code,        # String
     :status,             # String (new, pending,paid,failed)
     :currency,           # String (EUR)
     :amount_in_cents,    # Integer
     :gateway,            # String (ideal)
    ] + super
  end

  def self.search key, value, session
    from_xml session.get( self.search_url(key,value) )
  end

  def self.find id, session
    from_xml session.get(self.resource_url(id))
  end

  def self.all_with_filter filter, session
    from_xml session.get(self.filter_url(filter))
  end

  def self.all session
    from_xml session.get(self.resource_url)
  end

  def self.array_root
    :payments
  end

  def self.node_root
    :payment
  end

  def self.filter_url filter
    "#{self.resource_url}?filter=#{filter}"
  end

  def self.resource_location
    "/api/pro/store/payments"
  end

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
caren-api-0.5.20 lib/caren/store/payment.rb
caren-api-0.5.19 lib/caren/store/payment.rb
caren-api-0.5.18 lib/caren/store/payment.rb
caren-api-0.5.17 lib/caren/store/payment.rb
caren-api-0.5.16 lib/caren/store/payment.rb
caren-api-0.5.15 lib/caren/store/payment.rb
caren-api-0.5.14 lib/caren/store/payment.rb
caren-api-0.5.13 lib/caren/store/payment.rb
caren-api-0.5.12 lib/caren/store/payment.rb
caren-api-0.5.10 lib/caren/store/payment.rb
caren-api-0.5.9 lib/caren/store/payment.rb
caren-api-0.5.8 lib/caren/store/payment.rb
caren-api-0.5.7 lib/caren/store/payment.rb
caren-api-0.5.6 lib/caren/store/payment.rb
caren-api-0.5.5 lib/caren/store/payment.rb
caren-api-0.5.4 lib/caren/store/payment.rb
caren-api-0.5.3 lib/caren/store/payment.rb
caren-api-0.5.2 lib/caren/store/payment.rb
caren-api-0.5.1 lib/caren/store/payment.rb