channel_advisor 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README +46 -0
- data/lib/channel_advisor/admin_service/client.rb +63 -0
- data/lib/channel_advisor/admin_service/mapping_registry.rb +206 -0
- data/lib/channel_advisor/admin_service/types.rb +175 -0
- data/lib/channel_advisor/admin_service.rb +14 -0
- data/lib/channel_advisor/auth_handler.rb +21 -0
- data/lib/channel_advisor/cart_service/client.rb +79 -0
- data/lib/channel_advisor/cart_service/mapping_registry.rb +344 -0
- data/lib/channel_advisor/cart_service/types.rb +386 -0
- data/lib/channel_advisor/cart_service.rb +14 -0
- data/lib/channel_advisor/errors.rb +13 -0
- data/lib/channel_advisor/inventory_service/client.rb +223 -0
- data/lib/channel_advisor/inventory_service/mapping_registry.rb +1765 -0
- data/lib/channel_advisor/inventory_service/types.rb +1708 -0
- data/lib/channel_advisor/inventory_service.rb +14 -0
- data/lib/channel_advisor/listing_service/client.rb +55 -0
- data/lib/channel_advisor/listing_service/mapping_registry.rb +153 -0
- data/lib/channel_advisor/listing_service/types.rb +125 -0
- data/lib/channel_advisor/listing_service.rb +14 -0
- data/lib/channel_advisor/marketplace_ad_service/client.rb +71 -0
- data/lib/channel_advisor/marketplace_ad_service/mapping_registry.rb +334 -0
- data/lib/channel_advisor/marketplace_ad_service/types.rb +317 -0
- data/lib/channel_advisor/marketplace_ad_service.rb +14 -0
- data/lib/channel_advisor/message_code.rb +30 -0
- data/lib/channel_advisor/order_service/client.rb +111 -0
- data/lib/channel_advisor/order_service/mapping_registry.rb +1696 -0
- data/lib/channel_advisor/order_service/types.rb +1781 -0
- data/lib/channel_advisor/order_service.rb +14 -0
- data/lib/channel_advisor/service_proxy.rb +62 -0
- data/lib/channel_advisor/shared_requires.rb +11 -0
- data/lib/channel_advisor/shipping_service/client.rb +79 -0
- data/lib/channel_advisor/shipping_service/mapping_registry.rb +500 -0
- data/lib/channel_advisor/shipping_service/types.rb +431 -0
- data/lib/channel_advisor/shipping_service.rb +14 -0
- data/lib/channel_advisor/store_service/client.rb +55 -0
- data/lib/channel_advisor/store_service/mapping_registry.rb +250 -0
- data/lib/channel_advisor/store_service/types.rb +180 -0
- data/lib/channel_advisor/store_service.rb +14 -0
- data/lib/channel_advisor/tax_service/client.rb +55 -0
- data/lib/channel_advisor/tax_service/mapping_registry.rb +233 -0
- data/lib/channel_advisor/tax_service/types.rb +221 -0
- data/lib/channel_advisor/tax_service.rb +14 -0
- data/lib/channel_advisor.rb +4 -0
- data/spec/integration/inventory_sync_spec.rb +55 -0
- data/spec/lib/channel_advisor/admin_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/auth_handler_spec.rb +46 -0
- data/spec/lib/channel_advisor/cart_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/errors_spec.rb +23 -0
- data/spec/lib/channel_advisor/inventory_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/marketplace_ad_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/message_code_spec.rb +40 -0
- data/spec/lib/channel_advisor/order_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/service_proxy_spec.rb +130 -0
- data/spec/lib/channel_advisor/shipping_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/store_service_spec.rb +12 -0
- data/spec/lib/channel_advisor/tax_service_spec.rb +12 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +4 -0
- metadata +170 -0
@@ -0,0 +1,233 @@
|
|
1
|
+
module ChannelAdvisor; module TaxServiceSOAP
|
2
|
+
|
3
|
+
module DefaultMappingRegistry
|
4
|
+
EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
|
5
|
+
LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
|
6
|
+
NsWebservices = "http://api.channeladvisor.com/webservices/"
|
7
|
+
|
8
|
+
EncodedRegistry.register(
|
9
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APIResultOfTaxRateResult,
|
10
|
+
:schema_type => XSD::QName.new(NsWebservices, "APIResultOfTaxRateResult"),
|
11
|
+
:schema_element => [
|
12
|
+
["status", ["ChannelAdvisor::TaxServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
|
13
|
+
["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
|
14
|
+
["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
|
15
|
+
["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
|
16
|
+
["resultData", ["ChannelAdvisor::TaxServiceSOAP::TaxRateResult", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
|
17
|
+
]
|
18
|
+
)
|
19
|
+
|
20
|
+
EncodedRegistry.register(
|
21
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxRateResult,
|
22
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxRateResult"),
|
23
|
+
:schema_element => [
|
24
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
25
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
26
|
+
["itemDetailList", ["ChannelAdvisor::TaxServiceSOAP::ArrayOfTaxItemBase", XSD::QName.new(NsWebservices, "ItemDetailList")], [0, 1]]
|
27
|
+
]
|
28
|
+
)
|
29
|
+
|
30
|
+
EncodedRegistry.register(
|
31
|
+
:class => ChannelAdvisor::TaxServiceSOAP::ArrayOfTaxItemBase,
|
32
|
+
:schema_type => XSD::QName.new(NsWebservices, "ArrayOfTaxItemBase"),
|
33
|
+
:schema_element => [
|
34
|
+
["taxItemBase", ["ChannelAdvisor::TaxServiceSOAP::TaxItemBase[]", XSD::QName.new(NsWebservices, "TaxItemBase")], [0, nil]]
|
35
|
+
]
|
36
|
+
)
|
37
|
+
|
38
|
+
EncodedRegistry.register(
|
39
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxItemProduct,
|
40
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxItemProduct"),
|
41
|
+
:schema_basetype => XSD::QName.new(NsWebservices, "TaxItemBase"),
|
42
|
+
:schema_element => [
|
43
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
44
|
+
["taxRate", ["SOAP::SOAPDouble", XSD::QName.new(NsWebservices, "TaxRate")]],
|
45
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
46
|
+
["quantity", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "Quantity")]],
|
47
|
+
["unitPrice", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "UnitPrice")]],
|
48
|
+
["lineItemID", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "LineItemID")]],
|
49
|
+
["title", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Title")], [0, 1]],
|
50
|
+
["sKU", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "SKU")], [0, 1]]
|
51
|
+
]
|
52
|
+
)
|
53
|
+
|
54
|
+
EncodedRegistry.register(
|
55
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxItemVatShipping,
|
56
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxItemVatShipping"),
|
57
|
+
:schema_basetype => XSD::QName.new(NsWebservices, "TaxItemBase"),
|
58
|
+
:schema_element => [
|
59
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
60
|
+
["taxRate", ["SOAP::SOAPDouble", XSD::QName.new(NsWebservices, "TaxRate")]],
|
61
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
62
|
+
["shippingCost", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "ShippingCost")]]
|
63
|
+
]
|
64
|
+
)
|
65
|
+
|
66
|
+
EncodedRegistry.register(
|
67
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APICredentials,
|
68
|
+
:schema_type => XSD::QName.new(NsWebservices, "APICredentials"),
|
69
|
+
:schema_element => [
|
70
|
+
["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
|
71
|
+
["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
|
72
|
+
]
|
73
|
+
)
|
74
|
+
|
75
|
+
EncodedRegistry.register(
|
76
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APIResultOfString,
|
77
|
+
:schema_type => XSD::QName.new(NsWebservices, "APIResultOfString"),
|
78
|
+
:schema_element => [
|
79
|
+
["status", ["ChannelAdvisor::TaxServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
|
80
|
+
["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
|
81
|
+
["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
|
82
|
+
["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
|
83
|
+
["resultData", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
|
84
|
+
]
|
85
|
+
)
|
86
|
+
|
87
|
+
EncodedRegistry.register(
|
88
|
+
:class => ChannelAdvisor::TaxServiceSOAP::ResultStatus,
|
89
|
+
:schema_type => XSD::QName.new(NsWebservices, "ResultStatus")
|
90
|
+
)
|
91
|
+
|
92
|
+
EncodedRegistry.register(
|
93
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxTypeCode,
|
94
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxTypeCode")
|
95
|
+
)
|
96
|
+
|
97
|
+
LiteralRegistry.register(
|
98
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APIResultOfTaxRateResult,
|
99
|
+
:schema_type => XSD::QName.new(NsWebservices, "APIResultOfTaxRateResult"),
|
100
|
+
:schema_element => [
|
101
|
+
["status", ["ChannelAdvisor::TaxServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
|
102
|
+
["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
|
103
|
+
["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
|
104
|
+
["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
|
105
|
+
["resultData", ["ChannelAdvisor::TaxServiceSOAP::TaxRateResult", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
|
106
|
+
]
|
107
|
+
)
|
108
|
+
|
109
|
+
LiteralRegistry.register(
|
110
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxRateResult,
|
111
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxRateResult"),
|
112
|
+
:schema_element => [
|
113
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
114
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
115
|
+
["itemDetailList", ["ChannelAdvisor::TaxServiceSOAP::ArrayOfTaxItemBase", XSD::QName.new(NsWebservices, "ItemDetailList")], [0, 1]]
|
116
|
+
]
|
117
|
+
)
|
118
|
+
|
119
|
+
LiteralRegistry.register(
|
120
|
+
:class => ChannelAdvisor::TaxServiceSOAP::ArrayOfTaxItemBase,
|
121
|
+
:schema_type => XSD::QName.new(NsWebservices, "ArrayOfTaxItemBase"),
|
122
|
+
:schema_element => [
|
123
|
+
["taxItemBase", ["ChannelAdvisor::TaxServiceSOAP::TaxItemBase[]", XSD::QName.new(NsWebservices, "TaxItemBase")], [0, nil]]
|
124
|
+
]
|
125
|
+
)
|
126
|
+
|
127
|
+
LiteralRegistry.register(
|
128
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxItemProduct,
|
129
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxItemProduct"),
|
130
|
+
:schema_basetype => XSD::QName.new(NsWebservices, "TaxItemBase"),
|
131
|
+
:schema_element => [
|
132
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
133
|
+
["taxRate", ["SOAP::SOAPDouble", XSD::QName.new(NsWebservices, "TaxRate")]],
|
134
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
135
|
+
["quantity", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "Quantity")]],
|
136
|
+
["unitPrice", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "UnitPrice")]],
|
137
|
+
["lineItemID", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "LineItemID")]],
|
138
|
+
["title", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Title")], [0, 1]],
|
139
|
+
["sKU", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "SKU")], [0, 1]]
|
140
|
+
]
|
141
|
+
)
|
142
|
+
|
143
|
+
LiteralRegistry.register(
|
144
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxItemVatShipping,
|
145
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxItemVatShipping"),
|
146
|
+
:schema_basetype => XSD::QName.new(NsWebservices, "TaxItemBase"),
|
147
|
+
:schema_element => [
|
148
|
+
["taxAmount", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "TaxAmount")]],
|
149
|
+
["taxRate", ["SOAP::SOAPDouble", XSD::QName.new(NsWebservices, "TaxRate")]],
|
150
|
+
["taxType", ["ChannelAdvisor::TaxServiceSOAP::TaxTypeCode", XSD::QName.new(NsWebservices, "TaxType")]],
|
151
|
+
["shippingCost", ["SOAP::SOAPDecimal", XSD::QName.new(NsWebservices, "ShippingCost")]]
|
152
|
+
]
|
153
|
+
)
|
154
|
+
|
155
|
+
LiteralRegistry.register(
|
156
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APICredentials,
|
157
|
+
:schema_type => XSD::QName.new(NsWebservices, "APICredentials"),
|
158
|
+
:schema_element => [
|
159
|
+
["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
|
160
|
+
["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
|
161
|
+
]
|
162
|
+
)
|
163
|
+
|
164
|
+
LiteralRegistry.register(
|
165
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APIResultOfString,
|
166
|
+
:schema_type => XSD::QName.new(NsWebservices, "APIResultOfString"),
|
167
|
+
:schema_element => [
|
168
|
+
["status", ["ChannelAdvisor::TaxServiceSOAP::ResultStatus", XSD::QName.new(NsWebservices, "Status")]],
|
169
|
+
["messageCode", ["SOAP::SOAPInt", XSD::QName.new(NsWebservices, "MessageCode")]],
|
170
|
+
["message", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Message")], [0, 1]],
|
171
|
+
["data", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Data")], [0, 1]],
|
172
|
+
["resultData", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "ResultData")], [0, 1]]
|
173
|
+
]
|
174
|
+
)
|
175
|
+
|
176
|
+
LiteralRegistry.register(
|
177
|
+
:class => ChannelAdvisor::TaxServiceSOAP::ResultStatus,
|
178
|
+
:schema_type => XSD::QName.new(NsWebservices, "ResultStatus")
|
179
|
+
)
|
180
|
+
|
181
|
+
LiteralRegistry.register(
|
182
|
+
:class => ChannelAdvisor::TaxServiceSOAP::TaxTypeCode,
|
183
|
+
:schema_type => XSD::QName.new(NsWebservices, "TaxTypeCode")
|
184
|
+
)
|
185
|
+
|
186
|
+
LiteralRegistry.register(
|
187
|
+
:class => ChannelAdvisor::TaxServiceSOAP::GetTaxRateList,
|
188
|
+
:schema_name => XSD::QName.new(NsWebservices, "GetTaxRateList"),
|
189
|
+
:schema_element => [
|
190
|
+
["accountID", "SOAP::SOAPString", [0, 1]],
|
191
|
+
["cartID", "SOAP::SOAPInt"],
|
192
|
+
["street", "SOAP::SOAPString", [0, 1]],
|
193
|
+
["city", "SOAP::SOAPString", [0, 1]],
|
194
|
+
["state", "SOAP::SOAPString", [0, 1]],
|
195
|
+
["postalCode", "SOAP::SOAPString", [0, 1]],
|
196
|
+
["country", "SOAP::SOAPString", [0, 1]],
|
197
|
+
["shippingCost", "SOAP::SOAPDecimal"]
|
198
|
+
]
|
199
|
+
)
|
200
|
+
|
201
|
+
LiteralRegistry.register(
|
202
|
+
:class => ChannelAdvisor::TaxServiceSOAP::GetTaxRateListResponse,
|
203
|
+
:schema_name => XSD::QName.new(NsWebservices, "GetTaxRateListResponse"),
|
204
|
+
:schema_element => [
|
205
|
+
["getTaxRateListResult", ["ChannelAdvisor::TaxServiceSOAP::APIResultOfTaxRateResult", XSD::QName.new(NsWebservices, "GetTaxRateListResult")], [0, 1]]
|
206
|
+
]
|
207
|
+
)
|
208
|
+
|
209
|
+
LiteralRegistry.register(
|
210
|
+
:class => ChannelAdvisor::TaxServiceSOAP::APICredentials,
|
211
|
+
:schema_name => XSD::QName.new(NsWebservices, "APICredentials"),
|
212
|
+
:schema_element => [
|
213
|
+
["developerKey", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "DeveloperKey")], [0, 1]],
|
214
|
+
["password", ["SOAP::SOAPString", XSD::QName.new(NsWebservices, "Password")], [0, 1]]
|
215
|
+
]
|
216
|
+
)
|
217
|
+
|
218
|
+
LiteralRegistry.register(
|
219
|
+
:class => ChannelAdvisor::TaxServiceSOAP::Ping,
|
220
|
+
:schema_name => XSD::QName.new(NsWebservices, "Ping"),
|
221
|
+
:schema_element => []
|
222
|
+
)
|
223
|
+
|
224
|
+
LiteralRegistry.register(
|
225
|
+
:class => ChannelAdvisor::TaxServiceSOAP::PingResponse,
|
226
|
+
:schema_name => XSD::QName.new(NsWebservices, "PingResponse"),
|
227
|
+
:schema_element => [
|
228
|
+
["pingResult", ["ChannelAdvisor::TaxServiceSOAP::APIResultOfString", XSD::QName.new(NsWebservices, "PingResult")], [0, 1]]
|
229
|
+
]
|
230
|
+
)
|
231
|
+
end
|
232
|
+
|
233
|
+
end; end
|
@@ -0,0 +1,221 @@
|
|
1
|
+
module ChannelAdvisor; module TaxServiceSOAP
|
2
|
+
|
3
|
+
|
4
|
+
# {http://api.channeladvisor.com/webservices/}APIResultOfTaxRateResult
|
5
|
+
# status - ChannelAdvisor::TaxServiceSOAP::ResultStatus
|
6
|
+
# messageCode - SOAP::SOAPInt
|
7
|
+
# message - SOAP::SOAPString
|
8
|
+
# data - SOAP::SOAPString
|
9
|
+
# resultData - ChannelAdvisor::TaxServiceSOAP::TaxRateResult
|
10
|
+
class APIResultOfTaxRateResult
|
11
|
+
attr_accessor :status
|
12
|
+
attr_accessor :messageCode
|
13
|
+
attr_accessor :message
|
14
|
+
attr_accessor :data
|
15
|
+
attr_accessor :resultData
|
16
|
+
|
17
|
+
def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
|
18
|
+
@status = status
|
19
|
+
@messageCode = messageCode
|
20
|
+
@message = message
|
21
|
+
@data = data
|
22
|
+
@resultData = resultData
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# {http://api.channeladvisor.com/webservices/}TaxRateResult
|
27
|
+
# taxAmount - SOAP::SOAPDecimal
|
28
|
+
# taxType - ChannelAdvisor::TaxServiceSOAP::TaxTypeCode
|
29
|
+
# itemDetailList - ChannelAdvisor::TaxServiceSOAP::ArrayOfTaxItemBase
|
30
|
+
class TaxRateResult
|
31
|
+
attr_accessor :taxAmount
|
32
|
+
attr_accessor :taxType
|
33
|
+
attr_accessor :itemDetailList
|
34
|
+
|
35
|
+
def initialize(taxAmount = nil, taxType = nil, itemDetailList = nil)
|
36
|
+
@taxAmount = taxAmount
|
37
|
+
@taxType = taxType
|
38
|
+
@itemDetailList = itemDetailList
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# {http://api.channeladvisor.com/webservices/}ArrayOfTaxItemBase
|
43
|
+
class ArrayOfTaxItemBase < ::Array
|
44
|
+
end
|
45
|
+
|
46
|
+
# {http://api.channeladvisor.com/webservices/}TaxItemBase
|
47
|
+
# abstract
|
48
|
+
# taxAmount - SOAP::SOAPDecimal
|
49
|
+
# taxRate - SOAP::SOAPDouble
|
50
|
+
# taxType - ChannelAdvisor::TaxServiceSOAP::TaxTypeCode
|
51
|
+
class TaxItemBase
|
52
|
+
attr_accessor :taxAmount
|
53
|
+
attr_accessor :taxRate
|
54
|
+
attr_accessor :taxType
|
55
|
+
|
56
|
+
def initialize(taxAmount = nil, taxRate = nil, taxType = nil)
|
57
|
+
@taxAmount = taxAmount
|
58
|
+
@taxRate = taxRate
|
59
|
+
@taxType = taxType
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# {http://api.channeladvisor.com/webservices/}TaxItemProduct
|
64
|
+
# taxAmount - SOAP::SOAPDecimal
|
65
|
+
# taxRate - SOAP::SOAPDouble
|
66
|
+
# taxType - ChannelAdvisor::TaxServiceSOAP::TaxTypeCode
|
67
|
+
# quantity - SOAP::SOAPInt
|
68
|
+
# unitPrice - SOAP::SOAPDecimal
|
69
|
+
# lineItemID - SOAP::SOAPInt
|
70
|
+
# title - SOAP::SOAPString
|
71
|
+
# sKU - SOAP::SOAPString
|
72
|
+
class TaxItemProduct < TaxItemBase
|
73
|
+
attr_accessor :taxAmount
|
74
|
+
attr_accessor :taxRate
|
75
|
+
attr_accessor :taxType
|
76
|
+
attr_accessor :quantity
|
77
|
+
attr_accessor :unitPrice
|
78
|
+
attr_accessor :lineItemID
|
79
|
+
attr_accessor :title
|
80
|
+
attr_accessor :sKU
|
81
|
+
|
82
|
+
def initialize(taxAmount = nil, taxRate = nil, taxType = nil, quantity = nil, unitPrice = nil, lineItemID = nil, title = nil, sKU = nil)
|
83
|
+
@taxAmount = taxAmount
|
84
|
+
@taxRate = taxRate
|
85
|
+
@taxType = taxType
|
86
|
+
@quantity = quantity
|
87
|
+
@unitPrice = unitPrice
|
88
|
+
@lineItemID = lineItemID
|
89
|
+
@title = title
|
90
|
+
@sKU = sKU
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# {http://api.channeladvisor.com/webservices/}TaxItemVatShipping
|
95
|
+
# taxAmount - SOAP::SOAPDecimal
|
96
|
+
# taxRate - SOAP::SOAPDouble
|
97
|
+
# taxType - ChannelAdvisor::TaxServiceSOAP::TaxTypeCode
|
98
|
+
# shippingCost - SOAP::SOAPDecimal
|
99
|
+
class TaxItemVatShipping < TaxItemBase
|
100
|
+
attr_accessor :taxAmount
|
101
|
+
attr_accessor :taxRate
|
102
|
+
attr_accessor :taxType
|
103
|
+
attr_accessor :shippingCost
|
104
|
+
|
105
|
+
def initialize(taxAmount = nil, taxRate = nil, taxType = nil, shippingCost = nil)
|
106
|
+
@taxAmount = taxAmount
|
107
|
+
@taxRate = taxRate
|
108
|
+
@taxType = taxType
|
109
|
+
@shippingCost = shippingCost
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# {http://api.channeladvisor.com/webservices/}APICredentials
|
114
|
+
# developerKey - SOAP::SOAPString
|
115
|
+
# password - SOAP::SOAPString
|
116
|
+
class APICredentials
|
117
|
+
attr_accessor :developerKey
|
118
|
+
attr_accessor :password
|
119
|
+
|
120
|
+
def initialize(developerKey = nil, password = nil)
|
121
|
+
@developerKey = developerKey
|
122
|
+
@password = password
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# {http://api.channeladvisor.com/webservices/}APIResultOfString
|
127
|
+
# status - ChannelAdvisor::TaxServiceSOAP::ResultStatus
|
128
|
+
# messageCode - SOAP::SOAPInt
|
129
|
+
# message - SOAP::SOAPString
|
130
|
+
# data - SOAP::SOAPString
|
131
|
+
# resultData - SOAP::SOAPString
|
132
|
+
class APIResultOfString
|
133
|
+
attr_accessor :status
|
134
|
+
attr_accessor :messageCode
|
135
|
+
attr_accessor :message
|
136
|
+
attr_accessor :data
|
137
|
+
attr_accessor :resultData
|
138
|
+
|
139
|
+
def initialize(status = nil, messageCode = nil, message = nil, data = nil, resultData = nil)
|
140
|
+
@status = status
|
141
|
+
@messageCode = messageCode
|
142
|
+
@message = message
|
143
|
+
@data = data
|
144
|
+
@resultData = resultData
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# {http://api.channeladvisor.com/webservices/}ResultStatus
|
149
|
+
class ResultStatus < ::String
|
150
|
+
Failure = ResultStatus.new("Failure")
|
151
|
+
Success = ResultStatus.new("Success")
|
152
|
+
end
|
153
|
+
|
154
|
+
# {http://api.channeladvisor.com/webservices/}TaxTypeCode
|
155
|
+
class TaxTypeCode < ::String
|
156
|
+
NoChange = TaxTypeCode.new("NoChange")
|
157
|
+
NoTax = TaxTypeCode.new("NoTax")
|
158
|
+
TaxUS = TaxTypeCode.new("TaxUS")
|
159
|
+
VatExclusive = TaxTypeCode.new("VatExclusive")
|
160
|
+
VatInclusive = TaxTypeCode.new("VatInclusive")
|
161
|
+
end
|
162
|
+
|
163
|
+
# {http://api.channeladvisor.com/webservices/}GetTaxRateList
|
164
|
+
# accountID - SOAP::SOAPString
|
165
|
+
# cartID - SOAP::SOAPInt
|
166
|
+
# street - SOAP::SOAPString
|
167
|
+
# city - SOAP::SOAPString
|
168
|
+
# state - SOAP::SOAPString
|
169
|
+
# postalCode - SOAP::SOAPString
|
170
|
+
# country - SOAP::SOAPString
|
171
|
+
# shippingCost - SOAP::SOAPDecimal
|
172
|
+
class GetTaxRateList
|
173
|
+
attr_accessor :accountID
|
174
|
+
attr_accessor :cartID
|
175
|
+
attr_accessor :street
|
176
|
+
attr_accessor :city
|
177
|
+
attr_accessor :state
|
178
|
+
attr_accessor :postalCode
|
179
|
+
attr_accessor :country
|
180
|
+
attr_accessor :shippingCost
|
181
|
+
|
182
|
+
def initialize(accountID = nil, cartID = nil, street = nil, city = nil, state = nil, postalCode = nil, country = nil, shippingCost = nil)
|
183
|
+
@accountID = accountID
|
184
|
+
@cartID = cartID
|
185
|
+
@street = street
|
186
|
+
@city = city
|
187
|
+
@state = state
|
188
|
+
@postalCode = postalCode
|
189
|
+
@country = country
|
190
|
+
@shippingCost = shippingCost
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# {http://api.channeladvisor.com/webservices/}GetTaxRateListResponse
|
195
|
+
# getTaxRateListResult - ChannelAdvisor::TaxServiceSOAP::APIResultOfTaxRateResult
|
196
|
+
class GetTaxRateListResponse
|
197
|
+
attr_accessor :getTaxRateListResult
|
198
|
+
|
199
|
+
def initialize(getTaxRateListResult = nil)
|
200
|
+
@getTaxRateListResult = getTaxRateListResult
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# {http://api.channeladvisor.com/webservices/}Ping
|
205
|
+
class Ping
|
206
|
+
def initialize
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# {http://api.channeladvisor.com/webservices/}PingResponse
|
211
|
+
# pingResult - ChannelAdvisor::TaxServiceSOAP::APIResultOfString
|
212
|
+
class PingResponse
|
213
|
+
attr_accessor :pingResult
|
214
|
+
|
215
|
+
def initialize(pingResult = nil)
|
216
|
+
@pingResult = pingResult
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
|
221
|
+
end; end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'shared_requires.rb'))
|
2
|
+
['types.rb', 'mapping_registry.rb', 'client.rb'].each do |required|
|
3
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'tax_service', required))
|
4
|
+
end
|
5
|
+
|
6
|
+
module ChannelAdvisor
|
7
|
+
class TaxService
|
8
|
+
include ChannelAdvisor::ServiceProxy
|
9
|
+
define_service_methods(
|
10
|
+
ChannelAdvisor::TaxServiceSOAP,
|
11
|
+
ChannelAdvisor::TaxServiceSOAP::TaxServiceSoap
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
###############################################################
|
2
|
+
## # ## # ##### ## ### ### ## ### #### # #
|
3
|
+
# ## # ## # # ## # # ## # ## # # #
|
4
|
+
# ## # # # # # ### # # ### # # # #
|
5
|
+
# ## # #### ### # ### # # ### # ### # #
|
6
|
+
# ## # # # ## # ## # # ## ## #
|
7
|
+
# # # ## ### ## ### # ### ### # #### # #
|
8
|
+
|
9
|
+
# This spec will actually push information up to your channel advisor account!!!!
|
10
|
+
# Don't check in your account credentials!!!!!!
|
11
|
+
#
|
12
|
+
# Uncomment ACCOUNT_CREDENTIALS and enter your acct info to run
|
13
|
+
#
|
14
|
+
###############################################################
|
15
|
+
|
16
|
+
|
17
|
+
# Fill this out and uncomment it to run the spec.
|
18
|
+
# DON'T CHECK THIS INFO IN!!!!!!!!!!!!!!!!
|
19
|
+
#
|
20
|
+
# ACCOUNT_CREDENTIALS = {
|
21
|
+
# :account_id => '',
|
22
|
+
# :developer_key => '',
|
23
|
+
# :password => ''
|
24
|
+
# }
|
25
|
+
|
26
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
27
|
+
|
28
|
+
describe "Inventory Sync" do
|
29
|
+
|
30
|
+
it 'should only be run manually, as it will actually push information up to your channel advisor account' do
|
31
|
+
true
|
32
|
+
end
|
33
|
+
|
34
|
+
if defined?(ACCOUNT_CREDENTIALS)
|
35
|
+
it 'should push a sku up to your account' do
|
36
|
+
item = ChannelAdvisor::InventoryServiceSOAP::InventoryItemSubmit.new
|
37
|
+
item.sku = "FAKESKU"
|
38
|
+
inventory = ChannelAdvisor::InventoryService.new
|
39
|
+
result = inventory.doesSkuExist("FAKESKU", ACCOUNT_CREDENTIALS)
|
40
|
+
result.should eql("false")
|
41
|
+
result = inventory.synchInventoryItem(item, ACCOUNT_CREDENTIALS)
|
42
|
+
result.should be_true
|
43
|
+
result = inventory.doesSkuExist("FAKESKU", ACCOUNT_CREDENTIALS)
|
44
|
+
result.should eql("true")
|
45
|
+
end
|
46
|
+
else
|
47
|
+
it "** passing automatically --!-- INVENTORY SYNC HAS NOT BEEN TESTED **" do
|
48
|
+
true
|
49
|
+
end
|
50
|
+
it "** (ACCOUNT_CREDENTIALS must be defined in #{__FILE__} in order to test)" do
|
51
|
+
true
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::AdminService do
|
4
|
+
|
5
|
+
describe "proxy configuration" do
|
6
|
+
it "should define soap dependencies" do
|
7
|
+
ChannelAdvisor::AdminService::SOAP_CLASS.should == ChannelAdvisor::AdminServiceSOAP::AdminServiceSoap
|
8
|
+
ChannelAdvisor::AdminService::SERVICE_MODULE.should == ChannelAdvisor::AdminServiceSOAP
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::AuthHandler do
|
4
|
+
before(:each) do
|
5
|
+
configatron.channel_advisor.developer_key = 'test_developer_key'
|
6
|
+
configatron.channel_advisor.password = 'test_password'
|
7
|
+
end
|
8
|
+
|
9
|
+
it "uses configatron for the authentication keys" do
|
10
|
+
auth = ChannelAdvisor::AuthHandler.new
|
11
|
+
|
12
|
+
auth.developer_key.should == 'test_developer_key'
|
13
|
+
auth.password.should == 'test_password'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "uses values in the constructor if supplied" do
|
17
|
+
auth = ChannelAdvisor::AuthHandler.new('blurb', 'drab')
|
18
|
+
|
19
|
+
auth.developer_key.should == 'blurb'
|
20
|
+
auth.password.should == 'drab'
|
21
|
+
end
|
22
|
+
|
23
|
+
it "sets up the key and password for outbound requests" do
|
24
|
+
auth = ChannelAdvisor::AuthHandler.new('blurb', 'drab')
|
25
|
+
|
26
|
+
credentials = auth.on_simple_outbound
|
27
|
+
credentials[ChannelAdvisor::AuthHandler::DEVELOPER_KEY].should == 'blurb'
|
28
|
+
credentials[ChannelAdvisor::AuthHandler::PASSWORD].should == 'drab'
|
29
|
+
end
|
30
|
+
|
31
|
+
it "sets up the qname for the auth header element" do
|
32
|
+
auth = ChannelAdvisor::AuthHandler.new('blurb', 'drab')
|
33
|
+
auth.elename.should == ChannelAdvisor::AuthHandler::API_CREDENTIALS
|
34
|
+
end
|
35
|
+
|
36
|
+
it "sets up qnames for api credentials" do
|
37
|
+
ChannelAdvisor::AuthHandler::API_CREDENTIALS.namespace.should == 'http://api.channeladvisor.com/webservices/'
|
38
|
+
ChannelAdvisor::AuthHandler::API_CREDENTIALS.name.should == 'APICredentials'
|
39
|
+
|
40
|
+
ChannelAdvisor::AuthHandler::DEVELOPER_KEY.namespace.should == 'http://api.channeladvisor.com/webservices/'
|
41
|
+
ChannelAdvisor::AuthHandler::DEVELOPER_KEY.name.should == 'DeveloperKey'
|
42
|
+
|
43
|
+
ChannelAdvisor::AuthHandler::PASSWORD.namespace.should == 'http://api.channeladvisor.com/webservices/'
|
44
|
+
ChannelAdvisor::AuthHandler::PASSWORD.name.should == 'Password'
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::CartService do
|
4
|
+
|
5
|
+
describe "proxy configuration" do
|
6
|
+
it "should define soap dependencies" do
|
7
|
+
ChannelAdvisor::CartService::SOAP_CLASS.should == ChannelAdvisor::CartServiceSOAP::CartServiceSoap
|
8
|
+
ChannelAdvisor::CartService::SERVICE_MODULE.should == ChannelAdvisor::CartServiceSOAP
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::Error do
|
4
|
+
before(:each) do
|
5
|
+
@code = ChannelAdvisor::MessageCode::Unexpected
|
6
|
+
@response = ChannelAdvisor::InventoryServiceSOAP::APIResultOfBoolean.new('Failure', @code.code, 'Something was broken')
|
7
|
+
end
|
8
|
+
|
9
|
+
it "can be instantiated with no arguments" do
|
10
|
+
lambda { ChannelAdvisor::Error.new(nil, nil) }.should_not raise_error
|
11
|
+
end
|
12
|
+
|
13
|
+
it "allows access to the response and message code as attributes" do
|
14
|
+
error = ChannelAdvisor::Error.new(@response, @code)
|
15
|
+
error.message_code.should == @code
|
16
|
+
error.response.should == @response
|
17
|
+
end
|
18
|
+
|
19
|
+
it "sets the error message" do
|
20
|
+
error = ChannelAdvisor::Error.new(@response, @code)
|
21
|
+
error.message.should == "[1]: Unexpected - Something was broken"
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::InventoryService do
|
4
|
+
|
5
|
+
describe "proxy configuration" do
|
6
|
+
it "should define soap dependencies" do
|
7
|
+
ChannelAdvisor::InventoryService::SOAP_CLASS.should == ChannelAdvisor::InventoryServiceSOAP::InventoryServiceSoap
|
8
|
+
ChannelAdvisor::InventoryService::SERVICE_MODULE.should == ChannelAdvisor::InventoryServiceSOAP
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
|
3
|
+
describe ChannelAdvisor::MarketplaceAdService do
|
4
|
+
|
5
|
+
describe "proxy configuration" do
|
6
|
+
it "should define soap dependencies" do
|
7
|
+
ChannelAdvisor::MarketplaceAdService::SOAP_CLASS.should == ChannelAdvisor::MarketplaceAdServiceSOAP::MarketplaceAdServiceSoap
|
8
|
+
ChannelAdvisor::MarketplaceAdService::SERVICE_MODULE.should == ChannelAdvisor::MarketplaceAdServiceSOAP
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|