mws-merchant_fulfillment 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 461cb90e26076c276d38439ade73f08fed606cae
4
- data.tar.gz: 18309e821be339668837be654a14d82aef60d3ea
3
+ metadata.gz: a495fb4fe78a584e5b82f765496825d5c06d0d16
4
+ data.tar.gz: ec3e5305274747bd98898fb22cc99728147d3e9d
5
5
  SHA512:
6
- metadata.gz: 30cfb04adc868b566c799deae42602972500fedb818e2637d5e3504d8219112bdbb2b9e6143952528bade46c50be47221334692cb18e1d43bbf626fcbd33f346
7
- data.tar.gz: 56504cc5309f27a06290cae93806c055237376b0aaa2b3e99e7af8f4d96f6fbfd0fd9113c0179637420b057fd0f6c08a193275dfd0daed23c6357b5b9b90ed78
6
+ metadata.gz: 4639e3c4a91864db03b081f7f9913824e3d35b5eaa00e68532e8dd94fb54cd1738172e59c5548d313c0d89a5165979aab00080bbde8ccb7dbdc4067e98ba91da
7
+ data.tar.gz: f2750afa638ca5083aab973d146763207177e66ff29f4fec3045d801c2438aa615deef977c4021fd66d37eef088a89d9b8cc0b25177ca23c77357f4f2ee3c3c3
data/README.md CHANGED
@@ -13,19 +13,17 @@ Create a client:
13
13
 
14
14
  ```ruby
15
15
  require "mws-merchant_fulfillment"
16
- client = MWS.merchant_fulfillment(marketplace: "ATVPDKIKX0DER",
17
- merchant_id: "123")
16
+ client = MWS.merchant_fulfillment(marketplace: "ATVPDKIKX0DER", merchant_id: "123")
18
17
  ```
19
18
 
20
- Set up credentials [when instantiating or with environment variables](https://github.com/Flowspace-Team/peddler#usage).
19
+ Set up credentials [when instantiating or with environment variables](https://github.com/hakanensari/peddler#usage).
21
20
 
22
21
  ### Eligible Shipping Services
23
22
 
24
23
  List orders created or updated during a time frame you specify:
25
24
 
26
25
  ```ruby
27
- response = client.list_orders(created_after: 1.month.ago)
28
- request_details = {
26
+ response = client.get_eligible_shipping_services(
29
27
  amazon_order_id: amazon_order_id,
30
28
  item_list: items,
31
29
  ship_from_address: shipping_from,
@@ -35,9 +33,7 @@ request_details = {
35
33
  delivery_experience: 'DeliveryConfirmationWithoutSignature',
36
34
  carrier_will_pick_up: false,
37
35
  },
38
- }
39
-
40
- response = client.get_eligible_shipping_services(request_details)
36
+ )
41
37
  shipping_services = response.parse
42
38
  puts shipping_services.rates.count # => 1
43
39
  puts shipping_services.rates.first.amount # => #<Money fractional:2 currency:USD>
@@ -19,11 +19,16 @@ module MWS
19
19
  node = find_result_node
20
20
 
21
21
  case node.name
22
+ when /GetServiceStatus/
23
+ ServiceStatus.new(node)
22
24
  when /GetEligibleShippingServices/
23
25
  ShippingServices.new(node)
24
26
  when /CreateShipment/
25
27
  shipment_node = node.children.find { |node| node.name == 'Shipment' }
26
28
  Shipment.new(shipment_node)
29
+ when /CancelShipment/
30
+ shipment_node = node.children.find { |node| node.name == 'Shipment' }
31
+ Shipment.new(shipment_node)
27
32
  else
28
33
  raise NotImplementedError
29
34
  end
@@ -17,7 +17,7 @@ module MWS
17
17
 
18
18
  attribute(:ship_to_address) do
19
19
  node = xpath('ShipToAddress').first
20
- Address.new(node)
20
+ Address.new(node) if node
21
21
  end
22
22
 
23
23
  attribute(:amazon_order_id) do
@@ -26,31 +26,35 @@ module MWS
26
26
 
27
27
  attribute(:weight) do
28
28
  node = xpath('Weight').first
29
- Weight.new(node)
29
+ Weight.new(node) if node
30
30
  end
31
31
 
32
32
  attribute(:label) do
33
33
  node = xpath('Label').first
34
- Label.new(node)
34
+ Label.new(node) if node
35
35
  end
36
36
 
37
37
  attribute(:shipping_service) do
38
38
  node = xpath('ShippingService').first
39
- ShippingService.new(node)
39
+ ShippingService.new(node) if node
40
40
  end
41
41
 
42
42
  attribute(:package_dimensions) do
43
43
  node = xpath('PackageDimensions').first
44
- PackageDimensions.new(node)
44
+ PackageDimensions.new(node) if node
45
45
  end
46
46
 
47
47
  attribute(:created_date) do
48
48
  time_at_xpath('CreatedDate')
49
49
  end
50
50
 
51
+ attribute(:last_updated_date) do
52
+ time_at_xpath('LastUpdatedDate')
53
+ end
54
+
51
55
  attribute(:ship_from_address) do
52
56
  node = xpath('ShipFromAddress').first
53
- Address.new(node)
57
+ Address.new(node) if node
54
58
  end
55
59
 
56
60
  attribute(:item_list) do
@@ -68,6 +72,10 @@ module MWS
68
72
  attribute(:shipment_id) do
69
73
  text_at_xpath('ShipmentId')
70
74
  end
75
+
76
+ attribute(:seller_order_id) do
77
+ text_at_xpath('SellerOrderId')
78
+ end
71
79
  end
72
80
  end
73
81
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module MWS
4
4
  module MerchantFulfillment
5
- VERSION = '1.0.3'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mws-merchant_fulfillment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Becker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-13 00:00:00.000000000 Z
11
+ date: 2019-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: money