Class: RSpreedly::Transaction

Inherits:
Base
  • Object
show all
Defined in:
lib/rspreedly/transaction.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors

Class Method Summary collapse

Methods inherited from Base

api_request, #api_request, #attributes=, do_request, #initialize, #to_xml

Constructor Details

This class inherits a constructor from RSpreedly::Base

Instance Attribute Details

#activeObject

Returns the value of attribute active.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def active
  @active
end

#amountObject

Returns the value of attribute amount.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def amount
  @amount
end

#created_atObject

Returns the value of attribute created_at.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def created_at
  @created_at
end

#currency_codeObject

Returns the value of attribute currency_code.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def currency_code
  @currency_code
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def description
  @description
end

#detailObject

Returns the value of attribute detail.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def detail
  @detail
end

#detail_typeObject

Returns the value of attribute detail_type.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def detail_type
  @detail_type
end

#expiresObject

Returns the value of attribute expires.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def expires
  @expires
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def id
  @id
end

#invoice_idObject

Returns the value of attribute invoice_id.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def invoice_id
  @invoice_id
end

#priceObject

Returns the value of attribute price.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def price
  @price
end

#start_timeObject

Returns the value of attribute start_time.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def start_time
  @start_time
end

#subscriber_customer_idObject

Returns the value of attribute subscriber_customer_id.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def subscriber_customer_id
  @subscriber_customer_id
end

#termsObject

Returns the value of attribute terms.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def terms
  @terms
end

#updated_atObject

Returns the value of attribute updated_at.



5
6
7
# File 'lib/rspreedly/transaction.rb', line 5

def updated_at
  @updated_at
end

Class Method Details

.all(opts = {}) ⇒ Object

Get a list of 50 transactions Passing :since => id will get the 50 transactions since that one GET /api/v4/[short site name]/transactions.xml



26
27
28
29
30
31
32
33
34
35
# File 'lib/rspreedly/transaction.rb', line 26

def all(opts={})
  query_opts = {}
  if opts[:since]
    query_opts[:query] = {:since_id => opts[:since]}
  end

  response = api_request(:get, "/transactions.xml", query_opts)
  return [] unless response.has_key?("transactions")
  response["transactions"].collect{|data| Transaction.new(data)}
end