Class: Etsy::Transaction
- Inherits:
-
Object
show all
- Includes:
- Model
- Defined in:
- lib/etsy/transaction.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Model
included, #initialize, #result, #secret, #token
Class Method Details
.find(*identifiers_and_options) ⇒ Object
37
38
39
|
# 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 = {}) ⇒ Object
Find all Transactions by the buyer_id
43
44
45
|
# 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 = {}) ⇒ Object
47
48
49
|
# 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 = {}) ⇒ Object
51
52
53
|
# 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 = {}) ⇒ Object
21
22
23
|
# 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
|
Instance Method Details
#buyer ⇒ Object
59
60
61
|
# File 'lib/etsy/transaction.rb', line 59
def buyer
@buyer ||= User.find(buyer_id, oauth)
end
|
#created_at ⇒ Object
25
26
27
|
# File 'lib/etsy/transaction.rb', line 25
def created_at
Time.at(created)
end
|
#listing ⇒ Object
63
64
65
|
# File 'lib/etsy/transaction.rb', line 63
def listing
@listing ||= Listing.find(listing_id, oauth)
end
|
#paid_at ⇒ Object
33
34
35
|
# File 'lib/etsy/transaction.rb', line 33
def paid_at
Time.at(paid)
end
|
#receipt ⇒ Object
55
56
57
|
# File 'lib/etsy/transaction.rb', line 55
def receipt
@receipt ||= Receipt.find(receipt_id, oauth)
end
|
#shipped_at ⇒ Object
29
30
31
|
# File 'lib/etsy/transaction.rb', line 29
def shipped_at
Time.at(shipped)
end
|