mercadolibre 0.3.4 → 0.4.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca5981ecdfaffc11a6dd83fbb8dcc46dcca69cbc
|
4
|
+
data.tar.gz: 541ea2124e4d1d45e77049e16b4facc87231d822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0e3817ff0d254f9c180092c37def9860dcc187a6e05cc40de023bf472d99bc43abcaab8c7dcb6342c460ae3a1473e5ac35351fd5c9ef9feb8097200beea53c
|
7
|
+
data.tar.gz: 36d3ee88b4deeca17c1917079f781f3eefd2b8e80003f0ec8e301c692d278dc6f96b5b57fd0ac664c98825b569dfd08a511ea39ddd7215b83efccda4c85c905d
|
data/CHANGELOG.md
CHANGED
@@ -100,71 +100,67 @@ module Mercadolibre
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def get_order_feedbacks(order_id)
|
103
|
-
filters = { access_token: @access_token }
|
103
|
+
filters = { version: '3.0', access_token: @access_token }
|
104
104
|
|
105
|
-
result = get_request("/orders/#{order_id}/feedback", filters)
|
105
|
+
result = get_request("/orders/#{order_id}/feedback", filters)
|
106
106
|
|
107
|
-
|
108
|
-
|
109
|
-
else
|
110
|
-
sale_feedback = nil
|
111
|
-
end
|
107
|
+
Mercadolibre::Entity::OrderFeedback.new(result[:body])
|
108
|
+
end
|
112
109
|
|
113
|
-
|
114
|
-
|
115
|
-
else
|
116
|
-
purchase_feedback = nil
|
117
|
-
end
|
110
|
+
def get_order_buyer_feedback(order_id)
|
111
|
+
filters = { version: '3.0', access_token: @access_token }
|
118
112
|
|
119
|
-
|
113
|
+
result = get_request("/orders/#{order_id}/feedback/purchase", filters)
|
114
|
+
|
115
|
+
Mercadolibre::Entity::Feedback.new(result[:body])
|
120
116
|
end
|
121
117
|
|
122
|
-
def
|
123
|
-
|
118
|
+
def get_order_seller_feedback(order_id)
|
119
|
+
filters = { version: '3.0', access_token: @access_token }
|
120
|
+
|
121
|
+
result = get_request("/orders/#{order_id}/feedback/sale", filters)
|
124
122
|
|
125
123
|
Mercadolibre::Entity::Feedback.new(result[:body])
|
126
124
|
end
|
127
125
|
|
128
|
-
def
|
129
|
-
|
126
|
+
def create_order_feedback(order_id, feedback_data)
|
127
|
+
payload = feedback_data.to_json
|
130
128
|
|
131
|
-
|
129
|
+
headers = { content_type: :json }
|
130
|
+
|
131
|
+
post_request("/orders/#{order_id}/feedback?version=3.0&access_token=#{@access_token}", payload, headers)[:body]
|
132
132
|
end
|
133
133
|
|
134
|
-
def
|
134
|
+
def change_order_seller_feedback(order_id, kind, feedback_data)
|
135
135
|
payload = feedback_data.to_json
|
136
136
|
|
137
137
|
headers = { content_type: :json }
|
138
138
|
|
139
|
-
|
139
|
+
put_request("/orders/#{order_id}/feedback/sale?version=3.0&access_token=#{@access_token}", payload, headers)[:body]
|
140
140
|
end
|
141
141
|
|
142
|
-
def
|
142
|
+
def change_order_buyer_feedback(order_id, kind, feedback_data)
|
143
143
|
payload = feedback_data.to_json
|
144
144
|
|
145
145
|
headers = { content_type: :json }
|
146
146
|
|
147
|
-
|
148
|
-
put_request("/orders/#{order_id}/feedback/purchase?access_token=#{@access_token}", payload, headers)[:body]
|
149
|
-
elsif kind.to_s == 'seller'
|
150
|
-
put_request("/orders/#{order_id}/feedback/sale?access_token=#{@access_token}", payload, headers)[:body]
|
151
|
-
else
|
152
|
-
raise 'invalid kind'
|
153
|
-
end
|
147
|
+
put_request("/orders/#{order_id}/feedback/purchase?version=3.0&access_token=#{@access_token}", payload, headers)[:body]
|
154
148
|
end
|
155
149
|
|
156
|
-
def
|
150
|
+
def change_order_feedback(feedback_id, feedback_data)
|
151
|
+
payload = feedback_data.to_json
|
152
|
+
|
153
|
+
headers = { content_type: :json }
|
154
|
+
|
155
|
+
put_request("/feedback/#{feedback_id}?version=3.0&access_token=#{@access_token}", payload, headers)[:body]
|
156
|
+
end
|
157
|
+
|
158
|
+
def reply_order_feedback(feedback_id, text)
|
157
159
|
payload = { reply: text }.to_json
|
158
160
|
|
159
161
|
headers = { content_type: :json }
|
160
162
|
|
161
|
-
|
162
|
-
post_request("/orders/#{order_id}/feedback/purchase?access_token=#{@access_token}", payload, headers)[:body]
|
163
|
-
elsif kind.to_s == 'seller'
|
164
|
-
post_request("/orders/#{order_id}/feedback/sale?access_token=#{@access_token}", payload, headers)[:body]
|
165
|
-
else
|
166
|
-
raise 'invalid kind'
|
167
|
-
end
|
163
|
+
post_request("/feedback/{feedback_id}/reply?version=3.0&access_token=#{@access_token}", payload, headers)[:body]
|
168
164
|
end
|
169
165
|
|
170
166
|
def get_site_payment_methods(site_id)
|
@@ -2,15 +2,23 @@ module Mercadolibre
|
|
2
2
|
module Entity
|
3
3
|
class Feedback
|
4
4
|
def self.attr_list
|
5
|
-
[:
|
5
|
+
[:to, :has_seller_refunded_money, :status, :reason, :site_id, :date_created, :from,
|
6
|
+
:order_id, :modified, :id, :message, :fulfilled, :item, :visibility_date, :reply,
|
7
|
+
:role, :app_id, :rating, :restock_item]
|
6
8
|
end
|
7
9
|
|
8
10
|
attr_reader *attr_list
|
9
11
|
|
10
12
|
def initialize(attributes={})
|
11
13
|
attributes.each do |k, v|
|
12
|
-
if k.to_s
|
14
|
+
if ['date_created', 'visibility_date'].include?(k.to_s)
|
13
15
|
self.date_created = Time.parse(v) unless v.nil?
|
16
|
+
elsif k.to_s == 'to'
|
17
|
+
self.to = User.new(v)
|
18
|
+
elsif k.to_s == 'from'
|
19
|
+
self.from = User.new(v)
|
20
|
+
elsif k.to_s == 'item'
|
21
|
+
self.item = Item.new(v)
|
14
22
|
else
|
15
23
|
self.send("#{k}=", v) if self.respond_to?(k)
|
16
24
|
end
|
@@ -2,14 +2,19 @@ module Mercadolibre
|
|
2
2
|
module Entity
|
3
3
|
class OrderFeedback
|
4
4
|
def self.attr_list
|
5
|
-
[:
|
5
|
+
[:sale, :purchase]
|
6
6
|
end
|
7
7
|
|
8
8
|
attr_reader *attr_list
|
9
9
|
|
10
10
|
def initialize(attributes={})
|
11
|
-
|
12
|
-
|
11
|
+
if attributes['sale'].present?
|
12
|
+
self.sale = Feedback.new(attributes['sale'])
|
13
|
+
end
|
14
|
+
|
15
|
+
if attributes['purchase'].present?
|
16
|
+
self.purchase = Feedback.new(attributes['purchase'])
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
private
|
@@ -4,7 +4,7 @@ module Mercadolibre
|
|
4
4
|
def self.attr_list
|
5
5
|
[:id, :nickname, :registration_date, :first_name, :last_name, :blocked,
|
6
6
|
:country_id, :email, :user_type, :points, :site_id, :permalink, :phone,
|
7
|
-
:alternative_phone, :billing_info]
|
7
|
+
:alternative_phone, :billing_info, :status]
|
8
8
|
end
|
9
9
|
|
10
10
|
attr_reader *attr_list
|
data/lib/mercadolibre/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercadolibre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias Hick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|