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.12.5 lib/caren/store/payment.rb
caren-api-0.12.4 lib/caren/store/payment.rb
caren-api-0.12.3 lib/caren/store/payment.rb
caren-api-0.12.2 lib/caren/store/payment.rb
caren-api-0.12.1 lib/caren/store/payment.rb
caren-api-0.12.0 lib/caren/store/payment.rb
caren-api-0.11.1 lib/caren/store/payment.rb
caren-api-0.11.0 lib/caren/store/payment.rb
caren-api-0.10.0 lib/caren/store/payment.rb
caren-api-0.9.10 lib/caren/store/payment.rb
caren-api-0.9.9 lib/caren/store/payment.rb
caren-api-0.9.8 lib/caren/store/payment.rb
caren-api-0.9.7 lib/caren/store/payment.rb
caren-api-0.9.6 lib/caren/store/payment.rb
caren-api-0.9.4 lib/caren/store/payment.rb
caren-api-0.9.3 lib/caren/store/payment.rb
caren-api-0.9.2 lib/caren/store/payment.rb
caren-api-0.9.1 lib/caren/store/payment.rb
caren-api-0.9.0 lib/caren/store/payment.rb
caren-api-0.8.0 lib/caren/store/payment.rb