ebay 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +27 -8
- data/contrib/get_and_store_ebay_categories.rb +240 -0
- data/examples/add_item.rb +12 -12
- data/examples/get_categories.rb +2 -2
- data/examples/get_categories2.rb +2 -2
- data/examples/get_feedback.rb +2 -1
- data/examples/get_notification_preferences.rb +52 -0
- data/examples/get_notifications_usage.rb +52 -0
- data/examples/get_suggested_categories.rb +31 -0
- data/examples/set_notification_preferences.rb +28 -0
- data/examples/verify_add_item.rb +12 -12
- data/lib/eBay.rb +6403 -3128
- data/lib/eBayAPI.rb +4 -4
- data/lib/eBayDriver.rb +49 -0
- data/test/tc_hello_world.rb +1 -0
- data/test/tc_items.rb +1 -0
- data/test/tc_routing.rb +51 -0
- metadata +8 -2
data/lib/eBayAPI.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#--
|
2
|
-
# $Id: eBayAPI.rb,v 1.
|
2
|
+
# $Id: eBayAPI.rb,v 1.28 2006/03/10 02:35:18 garrydolley Exp $
|
3
3
|
#
|
4
|
-
# Copyright (c) 2005 Garry C. Dolley
|
4
|
+
# Copyright (c) 2005,2006 Garry C. Dolley
|
5
5
|
#
|
6
6
|
# This file is part of eBay4R.
|
7
7
|
#
|
@@ -63,7 +63,7 @@ class API
|
|
63
63
|
# special (e.g. "eBay Motors") sites.
|
64
64
|
#
|
65
65
|
def initialize(auth_token, dev_id, app_id, cert_id, opt = {})
|
66
|
-
@ver =
|
66
|
+
@ver = 449
|
67
67
|
@debug = false
|
68
68
|
@app_id = app_id
|
69
69
|
@header_handler = RequesterCredentialsHandler.new(auth_token, dev_id, app_id, cert_id)
|
@@ -96,7 +96,7 @@ class API
|
|
96
96
|
resp = eval("service.#{call_name}(request)")
|
97
97
|
|
98
98
|
# Handle eBay Application-level error
|
99
|
-
if resp.ack
|
99
|
+
if resp.ack == "Failure"
|
100
100
|
err_string = ''
|
101
101
|
|
102
102
|
if resp.errors.is_a?(Array) # Something tells me there is a better way to do this
|
data/lib/eBayDriver.rb
CHANGED
@@ -69,6 +69,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
69
69
|
{ :request_style => :document, :request_use => :literal,
|
70
70
|
:response_style => :document, :response_use => :literal }
|
71
71
|
],
|
72
|
+
[ "",
|
73
|
+
"approveLiveAuctionBidders",
|
74
|
+
[ ["in", "ApproveLiveAuctionBiddersRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "ApproveLiveAuctionBiddersRequest"], true],
|
75
|
+
["out", "ApproveLiveAuctionBiddersResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "ApproveLiveAuctionBiddersResponse"], true] ],
|
76
|
+
{ :request_style => :document, :request_use => :literal,
|
77
|
+
:response_style => :document, :response_use => :literal }
|
78
|
+
],
|
72
79
|
[ "",
|
73
80
|
"completeSale",
|
74
81
|
[ ["in", "CompleteSaleRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "CompleteSaleRequest"], true],
|
@@ -279,6 +286,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
279
286
|
{ :request_style => :document, :request_use => :literal,
|
280
287
|
:response_style => :document, :response_use => :literal }
|
281
288
|
],
|
289
|
+
[ "",
|
290
|
+
"getLiveAuctionBidders",
|
291
|
+
[ ["in", "GetLiveAuctionBiddersRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetLiveAuctionBiddersRequest"], true],
|
292
|
+
["out", "GetLiveAuctionBiddersResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetLiveAuctionBiddersResponse"], true] ],
|
293
|
+
{ :request_style => :document, :request_use => :literal,
|
294
|
+
:response_style => :document, :response_use => :literal }
|
295
|
+
],
|
282
296
|
[ "",
|
283
297
|
"getLiveAuctionCatalogDetails",
|
284
298
|
[ ["in", "GetLiveAuctionCatalogDetailsRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetLiveAuctionCatalogDetailsRequest"], true],
|
@@ -335,6 +349,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
335
349
|
{ :request_style => :document, :request_use => :literal,
|
336
350
|
:response_style => :document, :response_use => :literal }
|
337
351
|
],
|
352
|
+
[ "",
|
353
|
+
"getNotificationsUsage",
|
354
|
+
[ ["in", "GetNotificationsUsageRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetNotificationsUsageRequest"], true],
|
355
|
+
["out", "GetNotificationsUsageResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetNotificationsUsageResponse"], true] ],
|
356
|
+
{ :request_style => :document, :request_use => :literal,
|
357
|
+
:response_style => :document, :response_use => :literal }
|
358
|
+
],
|
338
359
|
[ "",
|
339
360
|
"getOrders",
|
340
361
|
[ ["in", "GetOrdersRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetOrdersRequest"], true],
|
@@ -475,6 +496,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
475
496
|
{ :request_style => :document, :request_use => :literal,
|
476
497
|
:response_style => :document, :response_use => :literal }
|
477
498
|
],
|
499
|
+
[ "",
|
500
|
+
"getStoreCategoryUpdateStatus",
|
501
|
+
[ ["in", "GetStoreCategoryUpdateStatusRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetStoreCategoryUpdateStatusRequest"], true],
|
502
|
+
["out", "GetStoreCategoryUpdateStatusResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetStoreCategoryUpdateStatusResponse"], true] ],
|
503
|
+
{ :request_style => :document, :request_use => :literal,
|
504
|
+
:response_style => :document, :response_use => :literal }
|
505
|
+
],
|
478
506
|
[ "",
|
479
507
|
"getStoreCustomPage",
|
480
508
|
[ ["in", "GetStoreCustomPageRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "GetStoreCustomPageRequest"], true],
|
@@ -573,6 +601,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
573
601
|
{ :request_style => :document, :request_use => :literal,
|
574
602
|
:response_style => :document, :response_use => :literal }
|
575
603
|
],
|
604
|
+
[ "",
|
605
|
+
"placeOffer",
|
606
|
+
[ ["in", "PlaceOfferRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "PlaceOfferRequest"], true],
|
607
|
+
["out", "PlaceOfferResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "PlaceOfferResponse"], true] ],
|
608
|
+
{ :request_style => :document, :request_use => :literal,
|
609
|
+
:response_style => :document, :response_use => :literal }
|
610
|
+
],
|
576
611
|
[ "",
|
577
612
|
"relistItem",
|
578
613
|
[ ["in", "RelistItemRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "RelistItemRequest"], true],
|
@@ -622,6 +657,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
622
657
|
{ :request_style => :document, :request_use => :literal,
|
623
658
|
:response_style => :document, :response_use => :literal }
|
624
659
|
],
|
660
|
+
[ "",
|
661
|
+
"reviseLiveAuctionItem",
|
662
|
+
[ ["in", "ReviseLiveAuctionItemRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "ReviseLiveAuctionItemRequest"], true],
|
663
|
+
["out", "ReviseLiveAuctionItemResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "ReviseLiveAuctionItemResponse"], true] ],
|
664
|
+
{ :request_style => :document, :request_use => :literal,
|
665
|
+
:response_style => :document, :response_use => :literal }
|
666
|
+
],
|
625
667
|
[ "",
|
626
668
|
"reviseMyMessages",
|
627
669
|
[ ["in", "ReviseMyMessagesRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "ReviseMyMessagesRequest"], true],
|
@@ -685,6 +727,13 @@ class EBayAPIInterface < ::SOAP::RPC::Driver
|
|
685
727
|
{ :request_style => :document, :request_use => :literal,
|
686
728
|
:response_style => :document, :response_use => :literal }
|
687
729
|
],
|
730
|
+
[ "",
|
731
|
+
"setStoreCategories",
|
732
|
+
[ ["in", "SetStoreCategoriesRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "SetStoreCategoriesRequest"], true],
|
733
|
+
["out", "SetStoreCategoriesResponse", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "SetStoreCategoriesResponse"], true] ],
|
734
|
+
{ :request_style => :document, :request_use => :literal,
|
735
|
+
:response_style => :document, :response_use => :literal }
|
736
|
+
],
|
688
737
|
[ "",
|
689
738
|
"setStoreCustomPage",
|
690
739
|
[ ["in", "SetStoreCustomPageRequest", ["::SOAP::SOAPElement", "urn:ebay:apis:eBLBaseComponents", "SetStoreCustomPageRequest"], true],
|
data/test/tc_hello_world.rb
CHANGED
data/test/tc_items.rb
CHANGED
data/test/tc_routing.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#--
|
4
|
+
# $Id: tc_routing.rb,v 1.1 2006/01/07 08:15:48 garrydolley Exp $
|
5
|
+
#
|
6
|
+
# Copyright (c) 2005 Garry C. Dolley
|
7
|
+
#
|
8
|
+
# This file is part of eBay4R.
|
9
|
+
#
|
10
|
+
# eBay4R is free software; you can redistribute it and/or modify it under the
|
11
|
+
# terms of the GNU General Public License as published by the Free Software
|
12
|
+
# Foundation; either version 2 of the License, or (at your option) any later
|
13
|
+
# version.
|
14
|
+
#
|
15
|
+
# eBay4R is distributed in the hope that it will be useful, but WITHOUT ANY
|
16
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
17
|
+
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
18
|
+
# details.
|
19
|
+
#
|
20
|
+
# You should have received a copy of the GNU General Public License along with
|
21
|
+
# eBay4R; if not, write to the Free Software Foundation, Inc., 51 Franklin
|
22
|
+
# Street, Fifth Floor, Boston, MA 02110-1301, USA
|
23
|
+
#
|
24
|
+
#++
|
25
|
+
|
26
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
27
|
+
|
28
|
+
require 'test/unit'
|
29
|
+
require 'eBayAPI'
|
30
|
+
|
31
|
+
# This file must be in the current directory your $RUBYLIB environment var.
|
32
|
+
load('myCredentials.rb')
|
33
|
+
|
34
|
+
$eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true, :site_id => 100)
|
35
|
+
|
36
|
+
class TestRouting < Test::Unit::TestCase
|
37
|
+
|
38
|
+
# If our routing works correctly, the GetCategories call should go to eBay Motors instead of default US site
|
39
|
+
def test_ebay_motors_categories
|
40
|
+
|
41
|
+
# Call "GetCategories"
|
42
|
+
resp = $eBay.GetCategories(:DetailLevel => 'ReturnAll', :CategorySideID => 100, :LevelLimit => 1)
|
43
|
+
|
44
|
+
assert_respond_to(resp, "timestamp")
|
45
|
+
assert_respond_to(resp, "ack")
|
46
|
+
assert_equal(resp.ack, "Success")
|
47
|
+
|
48
|
+
assert_equal(resp.categoryArray.category.categoryName, "eBay Motors")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ebay
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.6.0
|
7
|
+
date: 2006-04-23 00:00:00 -07:00
|
8
8
|
summary: "eBay4R is a Ruby wrapper for eBay's Web Services SOAP API. Emphasis is on ease
|
9
9
|
of use and small footprint."
|
10
10
|
require_paths:
|
@@ -34,12 +34,16 @@ files:
|
|
34
34
|
- examples/get_account3.rb
|
35
35
|
- examples/verify_add_item.rb
|
36
36
|
- examples/get_categories2.rb
|
37
|
+
- examples/set_notification_preferences.rb
|
37
38
|
- examples/myCredentials.rb
|
38
39
|
- examples/revise_item.rb
|
40
|
+
- examples/get_notification_preferences.rb
|
39
41
|
- examples/hello_world.rb
|
40
42
|
- examples/get_account.rb
|
41
43
|
- examples/get_categories.rb
|
42
44
|
- examples/get_item.rb
|
45
|
+
- examples/get_notifications_usage.rb
|
46
|
+
- examples/get_suggested_categories.rb
|
43
47
|
- examples/add_item.rb
|
44
48
|
- examples/get_feedback.rb
|
45
49
|
- lib/eBayAPI.rb
|
@@ -49,6 +53,8 @@ files:
|
|
49
53
|
- test/TODO
|
50
54
|
- test/tc_items.rb
|
51
55
|
- test/tc_hello_world.rb
|
56
|
+
- test/tc_routing.rb
|
57
|
+
- contrib/get_and_store_ebay_categories.rb
|
52
58
|
- "./lib/.document"
|
53
59
|
- README
|
54
60
|
test_files: []
|