class Etsy::Transaction

Public Class Methods

find(*identifiers_and_options) click to toggle source
# File lib/etsy/transaction.rb, line 37
def self.find(*identifiers_and_options)
  find_one_or_more('transactions', identifiers_and_options)
end
find_all_by_buyer_id(user_id, options = {}) click to toggle source

Find all Transactions by the buyer_id

# File lib/etsy/transaction.rb, line 43
def self.find_all_by_buyer_id(user_id, options = {})
  get_all("/users/#{user_id}/transactions", options)
end
find_all_by_listing_id(listing_id, options = {}) click to toggle source
# File lib/etsy/transaction.rb, line 47
def self.find_all_by_listing_id(listing_id, options = {})
  get_all("/listings/#{listing_id}/transactions", options)
end
find_all_by_receipt_id(receipt_id, options = {}) click to toggle source
# File lib/etsy/transaction.rb, line 51
def self.find_all_by_receipt_id(receipt_id, options = {})
  get_all("/receipts/#{receipt_id}/transactions", options)
end
find_all_by_shop_id(shop_id, options = {}) click to toggle source
# File lib/etsy/transaction.rb, line 21
def self.find_all_by_shop_id(shop_id, options = {})
  get_all("/shops/#{shop_id}/transactions", options)
end

Public Instance Methods

buyer() click to toggle source
# File lib/etsy/transaction.rb, line 59
def buyer
  @buyer ||= User.find(buyer_id, oauth)
end
created_at() click to toggle source
# File lib/etsy/transaction.rb, line 25
def created_at
  Time.at(created)
end
listing() click to toggle source
# File lib/etsy/transaction.rb, line 63
def listing
  @listing ||= Listing.find(listing_id, oauth)
end
paid_at() click to toggle source
receipt() click to toggle source
# File lib/etsy/transaction.rb, line 55
def receipt
  @receipt ||= Receipt.find(receipt_id, oauth)
end
shipped_at() click to toggle source
# File lib/etsy/transaction.rb, line 29
def shipped_at
  Time.at(shipped)
end

Private Instance Methods

oauth() click to toggle source
# File lib/etsy/transaction.rb, line 69
def oauth
  oauth = (token && secret) ? {:access_token => token, :access_secret => secret} : {}
end