cardmagic-etsy 0.3.3 → 0.3.4

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: 54fe363772c315079279cbf2634bc060d11ffcb3eaff81fe45c248eee43a1e5b
4
- data.tar.gz: e06934f7865228d73981791ab5a1c931062627ce42c549b46466b3ccc401d609
3
+ metadata.gz: eec8961881be830735f90d86ab910aa53afbe431757a8e451550e81362c78f1e
4
+ data.tar.gz: 46da72278963074e1eccf052a70649cd0a3576e0fd0728a1e4198a7b117007c9
5
5
  SHA512:
6
- metadata.gz: cf3b87cebfd12638a9842e0fe562906dd0504bcfd2c5e837bf75c281439de78e9bc648f0eafd2a18db30b9a6034c627076021a3348cfbe6b775dd134e0a86d28
7
- data.tar.gz: e69eda5a45f3aa0bebe0a8e904a31ae831d71d1b9444b03a6898538942020b103f6537660fbe1a42bf2ddb8ebe34a98ec0be62f0fe564c0095b49c56db0501ad
6
+ metadata.gz: 1afb0eb77052556f9b162506dfcd8352257c6c0d7394114b5110748dbb972e2b455be00c48a5fd43b9e04ab527ac28f6ea71db8eaa4811ecbc1ec9748eadd50e
7
+ data.tar.gz: 9c71f3748e7d86e99b2b908bbf52f5135c47f9e9bb151aef9ccde7e5cc2af86ca7c7a810c12fec71015f48cd7ea499d1720f230b339b664caf4bcbbc428e03a5
data/etsy.gemspec CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |gem|
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
13
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = "etsy"
14
+ gem.name = "cardmagic-etsy"
15
15
  gem.require_paths = ["lib"]
16
- gem.version = Etsy::VERSION
16
+ gem.version = "0.3.4"
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
@@ -5,8 +5,11 @@ module Etsy
5
5
  attribute :id, :from => :receipt_id
6
6
  attribute :buyer_id, :from => :buyer_user_id
7
7
 
8
+ attribute :created, :from => :creation_tsz
9
+ attribute :last_modified, :from => :last_modified_tsz
10
+
8
11
  attributes :quantity, :listing_id, :name, :first_line, :second_line, :city, :state, :zip, :country_id,
9
- :payment_email, :buyer_email, :creation_tsz
12
+ :payment_email, :buyer_email
10
13
 
11
14
  def self.find_all_by_shop_id(shop_id, options = {})
12
15
  get_all("/shops/#{shop_id}/receipts", options)
@@ -17,7 +20,7 @@ module Etsy
17
20
  end
18
21
 
19
22
  def created_at
20
- Time.at(creation_tsz)
23
+ Time.at(creation)
21
24
  end
22
25
 
23
26
  def buyer
@@ -4,8 +4,20 @@ module Etsy
4
4
 
5
5
  attribute :id, :from => :transaction_id
6
6
  attribute :buyer_id, :from => :buyer_user_id
7
+ attribute :seller_id, :from => :seller_user_id
7
8
  attributes :quantity, :listing_id
8
9
 
10
+ attribute :created, :from => :creation_tsz
11
+ attribute :shipped, :from => :shipped_tsz
12
+ attribute :paid, :from => :paid_tsz
13
+
14
+ attributes :title, :description, :price, :currency_code, :quantity,
15
+ :tags, :materials, :image_listing_id, :receipt_id,
16
+ :is_digital, :file_data, :listing_id, :url, :product_data,
17
+ :variations, :transaction_type, :buyer_feedback_id,
18
+ :seller_feedback_id
19
+
20
+
9
21
  def self.find_all_by_shop_id(shop_id, options = {})
10
22
  get_all("/shops/#{shop_id}/transactions", options)
11
23
  end
data/lib/etsy/user.rb CHANGED
@@ -19,6 +19,8 @@ module Etsy
19
19
 
20
20
  association :profile, :from => 'Profile'
21
21
  association :shops, :from => 'Shops'
22
+ association :bill_charges, :from => 'BillCharges'
23
+ association :bill_payments, :from => 'BillPayments'
22
24
 
23
25
  # Retrieve one or more users by name or ID:
24
26
  #
@@ -81,6 +83,34 @@ module Etsy
81
83
  @shops
82
84
  end
83
85
 
86
+ def bill_charges
87
+ unless @bill_charges
88
+ if associated_bill_charges
89
+ @bill_charges = associated_bill_charges.map { |bill_charge| BillCharge.new(bill_charge) }
90
+ else
91
+ options = {:fields => 'user_id', :includes => 'BillCharges'}
92
+ options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
93
+ tmp = User.find(username, options)
94
+ @bill_charges = tmp.associated_bill_charges.map { |bill_charge| BillCharge.new(bill_charge) }
95
+ end
96
+ end
97
+ @bill_charges
98
+ end
99
+
100
+ def bill_payments
101
+ unless @bill_payments
102
+ if associated_bill_payments
103
+ @bill_payments = associated_bill_payments.map { |bill_payment| BillPayment.new(bill_payment) }
104
+ else
105
+ options = {:fields => 'user_id', :includes => 'BillPayments'}
106
+ options = options.merge(:access_token => token, :access_secret => secret) if (token && secret)
107
+ tmp = User.find(username, options)
108
+ @bill_payments = tmp.associated_bill_payments.map { |bill_payment| BillPayment.new(bill_payment) }
109
+ end
110
+ end
111
+ @bill_payments
112
+ end
113
+
84
114
  # Time that this user was created
85
115
  #
86
116
  def created_at
data/lib/etsy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Etsy
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.2"
3
3
  end
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.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Reagan