Class: ChargifyApi::Transactions

Inherits:
Object
  • Object
show all
Defined in:
lib/transactions.rb

Constant Summary collapse

URI =
'/transactions.json'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Transactions

Returns a new instance of Transactions.



7
8
9
10
# File 'lib/transactions.rb', line 7

def initialize(connection)
  @connection = connection
  @uri        = URI
end

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



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

def connection
  @connection
end

#uriObject

Returns the value of attribute uri.



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

def uri
  @uri
end

Instance Method Details

#get(options = {}) ⇒ Object

Returns all transactions matching ‘options` passed Valid options are: kinds: An array of transaction types. Must be any of the following: charge, refund, payment, credit, payment_authorization, info, adjustment since_id: Returns transactions with an id greater than or equal to the one specified max_id: Returns transactions with an id less than or equal to the one specified since_date (format YYYY-MM-DD): Returns transactions with a created_at date greater than or equal to the one specified until_date (format YYYY-MM-DD): Returns transactions with a created_at date less than or equal to the one specified page and per_page: The page number and number of results used for pagination. By default results are paginated 20 per page. A few usage examples: Last 15 transactions that are “payment” or “payment_authorizations”: @chargify.transactions.get(:kinds => [’payment’, ‘payment_authorizations’], :per_page => 15) 50 transactions per page, second page. @chargify.transactions.get(:page => 2, :per_page => 50) Last 6 days worth of transactions: @chargify.transactions.get(:since_date => Date.today - 7, :until_date => Date.today - 1)



28
29
30
# File 'lib/transactions.rb', line 28

def get(options = {})
  self.get_all(options)
end