ebay-ruby 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ebay/browse.rb +6 -6
- data/lib/ebay/finding.rb +5 -6
- data/lib/ebay/merchandising.rb +1 -1
- data/lib/ebay/shopping.rb +6 -6
- data/lib/ebay/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73f278dbdda87fd6d0e8a00df1201f53e5bbde96aef3ee4fb9aecf732d2a20f5
|
4
|
+
data.tar.gz: 6b4c462a508393a25d1e4961cfffb022d70982cfe64ca31009f83680f88565f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42515946f5c4c0fd3b2d509dcd9feb4b7ebf31ad3662d376c58349603cd6414510e407a5b3a64cb871f1936f6bc74bb16183f250d9ef19d4145b68df3323ca3e
|
7
|
+
data.tar.gz: 5456ee468e751528336a9610da8bc2f5f63d4224dd0d70efc980f3a03d474d1e918eca76ba522bfc56c854d7a5e40926277c8e6f1afd8d1469bef9f194b31161
|
data/lib/ebay/browse.rb
CHANGED
@@ -53,7 +53,7 @@ module Ebay
|
|
53
53
|
#
|
54
54
|
# @param [Hash] params
|
55
55
|
# @return [HTTP::Response]
|
56
|
-
def search(
|
56
|
+
def search(params = {})
|
57
57
|
url = build_url('item_summary', 'search')
|
58
58
|
http.headers(build_headers).get(url, params: params)
|
59
59
|
end
|
@@ -63,7 +63,7 @@ module Ebay
|
|
63
63
|
# @param [File] image
|
64
64
|
# @param [Hash] params
|
65
65
|
# @return [HTTP::Response]
|
66
|
-
def search_by_image(image,
|
66
|
+
def search_by_image(image, params = {})
|
67
67
|
url = build_url('item_summary', 'search_by_image')
|
68
68
|
headers = build_headers.update('CONTENT-TYPE' => 'application/json')
|
69
69
|
encoded_string = Base64.encode64(image.read)
|
@@ -77,9 +77,9 @@ module Ebay
|
|
77
77
|
# @param [String] item_id
|
78
78
|
# @param [Hash] params
|
79
79
|
# @return [HTTP::Response]
|
80
|
-
def get_item(item_id,
|
80
|
+
def get_item(item_id, params = {})
|
81
81
|
url = build_url('item', item_id)
|
82
|
-
params.
|
82
|
+
params = params.merge(item_id: item_id)
|
83
83
|
|
84
84
|
http.headers(build_headers).get(url, params: params)
|
85
85
|
end
|
@@ -89,9 +89,9 @@ module Ebay
|
|
89
89
|
# @param [String] legacy_item_id
|
90
90
|
# @param [Hash] params
|
91
91
|
# @return [HTTP::Response]
|
92
|
-
def get_item_by_legacy_id(legacy_item_id,
|
92
|
+
def get_item_by_legacy_id(legacy_item_id, params = {})
|
93
93
|
url = build_url('item', 'get_item_by_legacy_id')
|
94
|
-
params.
|
94
|
+
params = params.merge(legacy_item_id: legacy_item_id)
|
95
95
|
|
96
96
|
http.headers(build_headers).get(url, params: params)
|
97
97
|
end
|
data/lib/ebay/finding.rb
CHANGED
@@ -77,7 +77,7 @@ module Ebay
|
|
77
77
|
# @param [Hash] payload
|
78
78
|
# @return [HTTP::Response]
|
79
79
|
def find_items_by_keywords(keywords, payload = {})
|
80
|
-
payload.
|
80
|
+
payload = payload.merge('keywords' => keywords)
|
81
81
|
request('findItemsByKeywords', payload)
|
82
82
|
end
|
83
83
|
|
@@ -88,8 +88,8 @@ module Ebay
|
|
88
88
|
# @param [Hash] payload
|
89
89
|
# @return [HTTP::Response]
|
90
90
|
def find_items_by_product(product_id, product_id_type, payload = {})
|
91
|
-
payload.
|
92
|
-
|
91
|
+
payload = payload.merge('productId' => product_id,
|
92
|
+
'productId.@type' => product_id_type)
|
93
93
|
|
94
94
|
request('findItemsByProduct', payload)
|
95
95
|
end
|
@@ -133,12 +133,11 @@ module Ebay
|
|
133
133
|
params = { 'GLOBAL-ID' => global_id,
|
134
134
|
'MESSAGE-ENCODING' => message_encoding,
|
135
135
|
'OPERATION-NAME' => operation,
|
136
|
-
'REQUEST-DATA-FORMAT' => 'JSON',
|
137
136
|
'RESPONSE-DATA-FORMAT' => response_data_format,
|
138
137
|
'SECURITY-APPNAME' => security_appname,
|
139
|
-
'SERVICE-VERSION' => service_version }.compact
|
138
|
+
'SERVICE-VERSION' => service_version }.update(payload).compact
|
140
139
|
|
141
|
-
http.
|
140
|
+
http.get(endpoint, params: params)
|
142
141
|
end
|
143
142
|
end
|
144
143
|
end
|
data/lib/ebay/merchandising.rb
CHANGED
data/lib/ebay/shopping.rb
CHANGED
@@ -76,7 +76,7 @@ module Ebay
|
|
76
76
|
# @param [Hash] payload
|
77
77
|
# @return [HTTP::Response]
|
78
78
|
def get_category_info(category_id, payload = {})
|
79
|
-
payload.
|
79
|
+
payload = payload.merge('CategoryID' => category_id)
|
80
80
|
request('GetCategoryInfo', payload)
|
81
81
|
end
|
82
82
|
|
@@ -96,7 +96,7 @@ module Ebay
|
|
96
96
|
# @return [HTTP::Response]
|
97
97
|
def get_item_status(*item_ids)
|
98
98
|
payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {}
|
99
|
-
payload.
|
99
|
+
payload = payload.merge('ItemID' => item_ids.join(','))
|
100
100
|
request('GetItemStatus', payload)
|
101
101
|
end
|
102
102
|
|
@@ -108,7 +108,7 @@ module Ebay
|
|
108
108
|
# @return [HTTP::Response]
|
109
109
|
def get_multiple_items(*item_ids)
|
110
110
|
payload = item_ids.last.is_a?(Hash) ? item_ids.pop : {}
|
111
|
-
payload.
|
111
|
+
payload = payload.merge('ItemID' => item_ids.join(','))
|
112
112
|
|
113
113
|
request('GetMultipleItems', payload)
|
114
114
|
end
|
@@ -119,7 +119,7 @@ module Ebay
|
|
119
119
|
# @param [Hash] payload
|
120
120
|
# @return [HTTP::Response]
|
121
121
|
def get_shipping_costs(item_id, payload = {})
|
122
|
-
payload.
|
122
|
+
payload = payload.merge('ItemID' => item_id)
|
123
123
|
request('GetShippingCosts', payload)
|
124
124
|
end
|
125
125
|
|
@@ -129,7 +129,7 @@ module Ebay
|
|
129
129
|
# @param [Hash] payload
|
130
130
|
# @return [HTTP::Response]
|
131
131
|
def get_single_item(item_id, payload = {})
|
132
|
-
payload.
|
132
|
+
payload = payload.merge('ItemID' => item_id)
|
133
133
|
request('GetSingleItem', payload)
|
134
134
|
end
|
135
135
|
|
@@ -139,7 +139,7 @@ module Ebay
|
|
139
139
|
# @param [Hash] payload
|
140
140
|
# @return [HTTP::Response]
|
141
141
|
def get_user_profile(user_id, payload = {})
|
142
|
-
payload.
|
142
|
+
payload = payload.merge('UserID' => user_id)
|
143
143
|
request('GetUserProfile', payload)
|
144
144
|
end
|
145
145
|
|
data/lib/ebay/version.rb
CHANGED