ebay4r 2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README +426 -0
- data/contrib/ebay_platform_notifications.txt +68 -0
- data/contrib/get_and_store_ebay_categories.rb +240 -0
- data/examples/add_item.rb +57 -0
- data/examples/add_item2.rb +74 -0
- data/examples/get_account.rb +31 -0
- data/examples/get_account2.rb +31 -0
- data/examples/get_account3.rb +31 -0
- data/examples/get_categories.rb +35 -0
- data/examples/get_categories2.rb +35 -0
- data/examples/get_category_features.rb +38 -0
- data/examples/get_ebay_details.rb +39 -0
- data/examples/get_feedback.rb +48 -0
- data/examples/get_item.rb +24 -0
- data/examples/get_notification_preferences.rb +59 -0
- data/examples/get_notifications_usage.rb +48 -0
- data/examples/get_suggested_categories.rb +30 -0
- data/examples/hello_world.rb +25 -0
- data/examples/myCredentials.rb +6 -0
- data/examples/revise_item.rb +19 -0
- data/examples/set_notification_preferences.rb +28 -0
- data/examples/verify_add_item.rb +59 -0
- data/lib/.document +1 -0
- data/lib/RequesterCredentialsHandler.rb +56 -0
- data/lib/eBay.rb +41163 -0
- data/lib/eBayAPI.rb +233 -0
- data/lib/eBayAPIInterfaceServiceClient.rb +1931 -0
- data/lib/eBayDriver.rb +1321 -0
- data/lib/eBayMappingRegistry.rb +42631 -0
- data/test/TODO +16 -0
- data/test/myCredentials.rb +6 -0
- data/test/tc_hello_world.rb +46 -0
- data/test/tc_items.rb +96 -0
- data/test/tc_routing.rb +51 -0
- metadata +79 -0
data/test/TODO
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
TODO
|
2
|
+
----
|
3
|
+
|
4
|
+
There are many, many more tests that need to be performed.
|
5
|
+
|
6
|
+
The eBay API now has over 100 possible calls, so if you use this library in
|
7
|
+
your eBay application, please consider giving back to the project by writing
|
8
|
+
a test case or two.
|
9
|
+
|
10
|
+
Please email test cases to: gdolley@ucla.edu
|
11
|
+
|
12
|
+
Include your full name so I can give you credit and copyright stamp.
|
13
|
+
|
14
|
+
Thanks!
|
15
|
+
|
16
|
+
-- Garry
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# Fill these in before running the examples:
|
2
|
+
|
3
|
+
$appId = ' CrystalC-4f75-4a31-a866-f776cfcb3005'
|
4
|
+
$devId = 'C4R717157S1331817A1Z3F3164C16F'
|
5
|
+
$certId = 'fa3a209c-590a-4f70-9b89-4641f1331e16'
|
6
|
+
$authToken = "AgAAAA**AQAAAA**aAAAAA**VWVSVA**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AEmISiAZmEqA6dj6x9nY+seQ**szIAAA**AAMAAA**diarcjs51oQvvJPY3O3UNHqDDnBtesuTpEQSSAzANJFWwQRrM2f0bq85TwPGZ4+O+TkXPPfpmo9S+Y2HWg6kEklYQQLXP7wVvk66rr7qw8gai7tt5DnK8XWCe3w8xIX4mhXBM8wo+7iuWz1u4QusuWW2pdqw3CiLX/leLRvtr7ly8V2CaQgGJbAurrbEiUINVHdKDL3ge1Z+sdar5FW2qn9NCATXudsEt7uIkgSvX4iW5MC4Yrih7NwCq19uHNBlUG4vmJPUNHMwj/QLiq0gN83Rfz1v7vzGhxwEEYNy4wRq4OjkaMKzikmbU5RfCCaWk+mC/HlTJxI9fh40XfVIZQGmhy78dk9cL3HBq5EVINA58JKtkX+Umn4Yw3c92ctK1Evz2i50IGjyN3dmm8lTGsyBniib1QWySowaHfDC0Etim8adYvBli40KlbsNsAYcsMbMGa5Z/3mRhdIs6EStul2JKMNFCsNvh6Cs+w1D1nnhyYT6CMrM+XoIuJJ04coIOdUzDpqQXnuSyUoTobZTyBvh8IPuVFggXeo4OlxWX8Xeljtxe8FYoIemeQdWRhmjDbu2euZ8Fm7UK7sOZ2dXgTxnNAF2kbMKoxN30qMwD7MBUXg6EDvwuUjMuwjVjmsHNXa7kkQZwzbKwxE+I0dOnT1YgSoGhuwZ/rHv0/BL5qFULB6qvFArmcdwNdw38jSaWK+CDN7RNJBH1Ny7kzy5RJbFL0rc1vrkmunPSlocGsnmfA+MRfn6ztjXxjrxj3uq"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#--
|
4
|
+
# $Id: tc_hello_world.rb,v 1.2 2006/01/07 07:57:15 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)
|
35
|
+
|
36
|
+
class TestHelloWorld < Test::Unit::TestCase
|
37
|
+
def test_simplest_call
|
38
|
+
resp = $eBay.GeteBayOfficialTime
|
39
|
+
|
40
|
+
assert_respond_to(resp, "timestamp")
|
41
|
+
assert_respond_to(resp, "ack")
|
42
|
+
assert_equal(resp.ack, "Success")
|
43
|
+
|
44
|
+
assert(resp.timestamp != "")
|
45
|
+
end
|
46
|
+
end
|
data/test/tc_items.rb
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#--
|
4
|
+
# $Id: tc_items.rb,v 1.3 2006/01/07 07:57:15 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)
|
35
|
+
|
36
|
+
|
37
|
+
class TestItems < Test::Unit::TestCase
|
38
|
+
@@item_title = "eBay4R Test Case Item #{Time.new.to_i}" ;
|
39
|
+
@@item_descr = 'eBay API for Ruby @ http://ebay4r.rubyforge.org/ ';
|
40
|
+
|
41
|
+
def test_add_item
|
42
|
+
shipping_options = {
|
43
|
+
:ShippingType => "Flat",
|
44
|
+
:ShippingServiceOptions => EBay.ShippingServiceOptions({
|
45
|
+
:ShippingService => "UPSGround",
|
46
|
+
:ShippingServicePriority => 1,
|
47
|
+
:FreeShipping => true
|
48
|
+
})
|
49
|
+
}
|
50
|
+
return_policy_options = {
|
51
|
+
:Description => "no returns",
|
52
|
+
:ReturnsAcceptedOption => "ReturnsNotAccepted"
|
53
|
+
}
|
54
|
+
resp = $eBay.AddItem(:Item => EBay.Item(:PrimaryCategory => EBay.Category(:CategoryID => 268),
|
55
|
+
:Title => @@item_title,
|
56
|
+
:Description => @@item_descr,
|
57
|
+
:Location => 'RubyForge',
|
58
|
+
:StartPrice => '12.0',
|
59
|
+
:Quantity => 1,
|
60
|
+
:ListingDuration => "Days_7",
|
61
|
+
:Country => "US",
|
62
|
+
:Currency => "USD",
|
63
|
+
:ConditionID => 1000,
|
64
|
+
:DispatchTimeMax => 1,
|
65
|
+
:ShippingDetails => EBay.ShippingDetails(shipping_options),
|
66
|
+
:ReturnPolicy => EBay::ReturnPolicy(return_policy_options),
|
67
|
+
:PaymentMethods => ["VisaMC"]))
|
68
|
+
|
69
|
+
assert_respond_to(resp, "timestamp")
|
70
|
+
assert_respond_to(resp, "ack")
|
71
|
+
assert_equal(resp.ack, "Success")
|
72
|
+
|
73
|
+
assert_respond_to(resp, "itemID")
|
74
|
+
assert_not_nil(resp.itemID)
|
75
|
+
|
76
|
+
@@item_id = resp.itemID
|
77
|
+
|
78
|
+
assert_respond_to(resp, "fees")
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_add_item_no_params
|
82
|
+
assert_raise(EBay::Error::ApplicationError) { $eBay.AddItem() }
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_get_item
|
86
|
+
resp = $eBay.GetItem(:DetailLevel => 'ReturnAll', :ItemID => @@item_id)
|
87
|
+
|
88
|
+
assert_respond_to(resp, "timestamp")
|
89
|
+
assert_respond_to(resp, "ack")
|
90
|
+
assert_equal(resp.ack, "Success")
|
91
|
+
|
92
|
+
assert_equal(resp.item.title, @@item_title)
|
93
|
+
assert_equal(resp.item.description, @@item_descr)
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
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[0].categoryName, "eBay Motors")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ebay4r
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '2.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Garry Dolley
|
8
|
+
autorequire: eBayAPI
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email: gdolley@ucla.edu
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files:
|
18
|
+
- README
|
19
|
+
files:
|
20
|
+
- "./lib/.document"
|
21
|
+
- README
|
22
|
+
- contrib/ebay_platform_notifications.txt
|
23
|
+
- contrib/get_and_store_ebay_categories.rb
|
24
|
+
- examples/add_item.rb
|
25
|
+
- examples/add_item2.rb
|
26
|
+
- examples/get_account.rb
|
27
|
+
- examples/get_account2.rb
|
28
|
+
- examples/get_account3.rb
|
29
|
+
- examples/get_categories.rb
|
30
|
+
- examples/get_categories2.rb
|
31
|
+
- examples/get_category_features.rb
|
32
|
+
- examples/get_ebay_details.rb
|
33
|
+
- examples/get_feedback.rb
|
34
|
+
- examples/get_item.rb
|
35
|
+
- examples/get_notification_preferences.rb
|
36
|
+
- examples/get_notifications_usage.rb
|
37
|
+
- examples/get_suggested_categories.rb
|
38
|
+
- examples/hello_world.rb
|
39
|
+
- examples/myCredentials.rb
|
40
|
+
- examples/revise_item.rb
|
41
|
+
- examples/set_notification_preferences.rb
|
42
|
+
- examples/verify_add_item.rb
|
43
|
+
- lib/RequesterCredentialsHandler.rb
|
44
|
+
- lib/eBay.rb
|
45
|
+
- lib/eBayAPI.rb
|
46
|
+
- lib/eBayAPIInterfaceServiceClient.rb
|
47
|
+
- lib/eBayDriver.rb
|
48
|
+
- lib/eBayMappingRegistry.rb
|
49
|
+
- test/TODO
|
50
|
+
- test/myCredentials.rb
|
51
|
+
- test/tc_hello_world.rb
|
52
|
+
- test/tc_items.rb
|
53
|
+
- test/tc_routing.rb
|
54
|
+
homepage: http://ebay4r.rubyforge.org
|
55
|
+
licenses: []
|
56
|
+
metadata: {}
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubyforge_project:
|
73
|
+
rubygems_version: 2.2.2
|
74
|
+
signing_key:
|
75
|
+
specification_version: 4
|
76
|
+
summary: eBay4R is a Ruby wrapper for eBay's Web Services SOAP API. Emphasis is on
|
77
|
+
ease of use and small footprint.
|
78
|
+
test_files: []
|
79
|
+
has_rdoc: true
|