mws-orders 0.5.1 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/mws/orders/entity.rb +2 -0
- data/lib/mws/orders/parser.rb +13 -17
- data/lib/mws/orders/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9b872550f745217030c7b4b5540a0a268f6661491943041008ae73b9213f35
|
4
|
+
data.tar.gz: fe4f6c37733c721c1bf8bf0991ab88448739b614d976445e90ae42f2f6be5569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f80e42ed08d572f4e239688fdc7f22b0f41185ae3c85967ab0e4043b0473f4cfdda3138aa73781a71ca47764cfb895dcaac675e362b1f5296a70b36da756ac96
|
7
|
+
data.tar.gz: 74ba62af68cba110d61d32f1a4c37caad9dde7e0a26237485184b3f50653f045923ad69349c1f0085ecf6b6a8ad2f6972255458fe4515b923eb3852d4d69823e
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# MWS Orders
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Build](https://github.com/hakanensari/mws-orders/workflows/build/badge.svg)](https://github.com/hakanensari/mws-orders/actions)
|
4
4
|
|
5
|
-
**MWS Orders** is a full-featured Ruby interface to the [Amazon Marketplace Web Service (MWS) Orders API](
|
5
|
+
**MWS Orders** is a full-featured Ruby interface to the [Amazon Marketplace Web Service (MWS) Orders API](https://docs.developer.amazonservices.com/en_UK/orders-2013-09-01/). With the MWS Orders API, you can list orders created or updated during a time frame you specify or retrieve information about specific orders.
|
6
6
|
|
7
7
|
To use Amazon MWS, you must have an eligible seller account.
|
8
8
|
|
@@ -27,7 +27,6 @@ response = client.list_orders(created_after: 1.month.ago)
|
|
27
27
|
orders = response.parse
|
28
28
|
puts orders.count # => 100
|
29
29
|
orders.first.inspect # => #<MWS::Orders::Order 902-3159896-1390916>
|
30
|
-
)
|
31
30
|
```
|
32
31
|
|
33
32
|
List the next page of orders:
|
@@ -40,8 +39,8 @@ Get one or more orders based on their order numbers:
|
|
40
39
|
|
41
40
|
```ruby
|
42
41
|
response = client.get_order('902-3159896-1390916')
|
43
|
-
|
44
|
-
|
42
|
+
orders = response.parse
|
43
|
+
orders.first.inspect # => #<MWS::Orders::Order 902-3159896-1390916>
|
45
44
|
```
|
46
45
|
|
47
46
|
### Order Items
|
data/lib/mws/orders/entity.rb
CHANGED
data/lib/mws/orders/parser.rb
CHANGED
@@ -21,38 +21,34 @@ module MWS
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def parse
|
24
|
-
case
|
25
|
-
when /
|
26
|
-
when /
|
27
|
-
when /
|
28
|
-
when
|
24
|
+
case payload.name
|
25
|
+
when /GetOrderResult/ then orders
|
26
|
+
when /ListOrders.*Result/ then orders
|
27
|
+
when /ListOrderItems.*Result/ then order_items
|
28
|
+
when 'GetServiceStatusResult' then service_status
|
29
29
|
else raise NotImplementedError
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
def order
|
36
|
-
orders.first
|
33
|
+
def payload
|
34
|
+
@payload ||= find_payload
|
37
35
|
end
|
38
36
|
|
37
|
+
private
|
38
|
+
|
39
39
|
def orders
|
40
|
-
Orders.new(
|
40
|
+
Orders.new(payload)
|
41
41
|
end
|
42
42
|
|
43
43
|
def order_items
|
44
|
-
OrderItems.new(
|
44
|
+
OrderItems.new(payload)
|
45
45
|
end
|
46
46
|
|
47
47
|
def service_status
|
48
|
-
ServiceStatus.new(
|
49
|
-
end
|
50
|
-
|
51
|
-
def result_node
|
52
|
-
@result_node ||= find_result_node
|
48
|
+
ServiceStatus.new(payload)
|
53
49
|
end
|
54
50
|
|
55
|
-
def
|
51
|
+
def find_payload
|
56
52
|
xml = Nokogiri(response.body)
|
57
53
|
root = xml.children.first
|
58
54
|
|
data/lib/mws/orders/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mws-orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.1.2
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: A Ruby interface to the Amazon MWS Orders API, built on Peddler
|