cardmagic-etsy 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eec8961881be830735f90d86ab910aa53afbe431757a8e451550e81362c78f1e
4
- data.tar.gz: 46da72278963074e1eccf052a70649cd0a3576e0fd0728a1e4198a7b117007c9
3
+ metadata.gz: d5f5669efeefa71681adeae2718dca56afc37c9802b96734c55ffd905d166b86
4
+ data.tar.gz: 854ded82dd4c0fec5951967106b0b6bcf1ffe38c3f8a4cbd1b81b7f38e27be6b
5
5
  SHA512:
6
- metadata.gz: 1afb0eb77052556f9b162506dfcd8352257c6c0d7394114b5110748dbb972e2b455be00c48a5fd43b9e04ab527ac28f6ea71db8eaa4811ecbc1ec9748eadd50e
7
- data.tar.gz: 9c71f3748e7d86e99b2b908bbf52f5135c47f9e9bb151aef9ccde7e5cc2af86ca7c7a810c12fec71015f48cd7ea499d1720f230b339b664caf4bcbbc428e03a5
6
+ metadata.gz: 9bb983c8424b02719c844c78e6fe20ece46782d61f6f70aa74401cfef5ca67b9d576a5fc65a9623e7ee595c5949bd03c483b225f5bc00712c1a3b51d7b9cb032
7
+ data.tar.gz: a535540c5ed50cd8901f7dca76b4158545a5f92b3b574079a6d2a6693b5d0e3554810f4b171135cda6652de8c017914c90072d1eaa30e680a7c3da27191b0e69
data/etsy.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
14
  gem.name = "cardmagic-etsy"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = "0.3.4"
16
+ gem.version = "0.3.5"
17
17
  gem.license = 'MIT'
18
18
 
19
19
  gem.required_rubygems_version = Gem::Requirement.new(">= 0") if gem.respond_to? :required_rubygems_version=
data/lib/etsy/receipt.rb CHANGED
@@ -11,6 +11,10 @@ module Etsy
11
11
  attributes :quantity, :listing_id, :name, :first_line, :second_line, :city, :state, :zip, :country_id,
12
12
  :payment_email, :buyer_email
13
13
 
14
+ def self.find(*identifiers_and_options)
15
+ find_one_or_more('receipts', identifiers_and_options)
16
+ end
17
+
14
18
  def self.find_all_by_shop_id(shop_id, options = {})
15
19
  get_all("/shops/#{shop_id}/receipts", options)
16
20
  end
@@ -20,7 +24,7 @@ module Etsy
20
24
  end
21
25
 
22
26
  def created_at
23
- Time.at(creation)
27
+ Time.at(created)
24
28
  end
25
29
 
26
30
  def buyer
@@ -22,6 +22,22 @@ module Etsy
22
22
  get_all("/shops/#{shop_id}/transactions", options)
23
23
  end
24
24
 
25
+ def created_at
26
+ Time.at(created)
27
+ end
28
+
29
+ def shipped_at
30
+ Time.at(shipped)
31
+ end
32
+
33
+ def paid_at
34
+ Time.at(paid)
35
+ end
36
+
37
+ def self.find(*identifiers_and_options)
38
+ find_one_or_more('transactions', identifiers_and_options)
39
+ end
40
+
25
41
  #Find all Transactions by the buyer_id
26
42
  #
27
43
  def self.find_all_by_buyer_id(user_id, options = {})
@@ -32,6 +48,9 @@ module Etsy
32
48
  get_all("/receipts/#{receipt_id}/transactions", options)
33
49
  end
34
50
 
51
+ def receipt
52
+ @receipt ||= Receipt.find(receipt_id)
53
+ end
35
54
 
36
55
  def buyer
37
56
  @buyer ||= User.find(buyer_id)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cardmagic-etsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Reagan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-30 00:00:00.000000000 Z
12
+ date: 2018-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json