muffin_man 1.5.4 → 1.5.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 815e6d799e774cb3a08322e50fb29485db132b069a976f16fd110b279286a95c
4
- data.tar.gz: c2c8054d5e139c4c92037d029feef98c606dca4e8162a7705f63b3cace9c4b4f
3
+ metadata.gz: 13ceb91a7ccf4877d5f956f95b024b02e4debef9c6de7095404430c2faa68ce3
4
+ data.tar.gz: 692982d4def515e28d7d1493349095b33ad9ea8a215a9b5c3ea16b0bda5e4623
5
5
  SHA512:
6
- metadata.gz: fad01d3bd223905a1060dda3f3f232bffc1c4d8ec7dd18a3289adcf2d67ab315678e420f73f3b35beb84e9187b73a84af4e5091f10f1394ca6f95513d9f70885
7
- data.tar.gz: cd4ff94c59ccc170b3753068ccc132df8f812a1bcbddf7fd5f4bfcac39dc953142f3276538c8f96b070bfccb5fb97260c91266751db57714dd314701d1d260fa
6
+ metadata.gz: b447651efebcbba439158667a5bc0e36d726beccb866ba8a6f94208db878c33e96ba75400891548174e8c935e20514faf36b31c948018fe8e7d06b5466b7c028
7
+ data.tar.gz: f881d61487f0933c645483b2b63ab7b9e2d2ae5c8dabaeb71067b7d6f8f62738541c7fef9c713adfa1134c27eabf8359e164438351a0867a1b0c2a5bc76f4a63
data/.rubocop.yml CHANGED
@@ -31,6 +31,9 @@ Metrics/BlockLength:
31
31
  Metrics/AbcSize:
32
32
  Enabled: false
33
33
 
34
+ Metrics/ParameterLists:
35
+ Enabled: false
36
+
34
37
  Style/Documentation:
35
38
  Enabled: false
36
39
 
@@ -44,4 +47,4 @@ RSpec/MultipleMemoizedHelpers:
44
47
  Enabled: false
45
48
 
46
49
  RSpec/MultipleExpectations:
47
- Enabled: false
50
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
- # Unreleased
1
+ # 1.5.6
2
2
 
3
- - Support for getInventorySummaries [#36](https://github.com/patterninc/muffin_man/pull/36)
3
+ - Sandbox support for create/delete shipments in Merchant Fulfillment [#42](https://github.com/patterninc/muffin_man/pull/42)
4
+
5
+ # 1.5.5
6
+
7
+ - Support for Merchant Fulfillment [#41](https://github.com/patterninc/muffin_man/pull/41)
4
8
 
5
9
  # 1.5.4
6
10
 
@@ -8,7 +12,8 @@
8
12
 
9
13
  # 1.5.3
10
14
 
11
- - Support for Fulfillment Outbound [#34](https://github.com/patterninc/muffin_man/pull/34)
15
+ - Support for getInventorySummaries [#36](https://github.com/patterninc/muffin_man/pull/36)
16
+ - Support for Fulfillment Outbound [#34](https://github.com/patterninc/muffin_man/pull/34)
12
17
 
13
18
  # 1.5.2
14
19
 
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MuffinMan
4
+ module MerchantFulfillment
5
+ class V0 < SpApiClient
6
+ def get_eligible_shipment_services(shipment_request_details, shipping_offering_filter = {})
7
+ @local_var_path = "/mfn/v0/eligibleShippingServices"
8
+ @request_body = {
9
+ "ShipmentRequestDetails" => shipment_request_details
10
+ }
11
+ @request_body["ShippingOfferingFilter"] = shipping_offering_filter unless shipping_offering_filter.empty?
12
+ @request_type = "POST"
13
+ call_api
14
+ end
15
+
16
+ def get_shipment(shipment_id)
17
+ @local_var_path = "/mfn/v0/shipments/#{shipment_id}"
18
+ @request_type = "GET"
19
+ call_api
20
+ end
21
+
22
+ CANCEL_SANDBOX_SHIPMENT_ID = "be7a0a53-00c3-4f6f-a63a-639f76ee9253"
23
+ def cancel_shipment(shipment_id)
24
+ shipment_id = CANCEL_SANDBOX_SHIPMENT_ID if sandbox
25
+ @local_var_path = "/mfn/v0/shipments/#{shipment_id}"
26
+ @request_type = "DELETE"
27
+ call_api
28
+ end
29
+
30
+ def create_shipment(shipment_request_details, shipping_service_id,
31
+ shipping_service_offering_id: nil, hazmat_type: nil, label_format_option: {},
32
+ shipment_level_seller_inputs_list: [])
33
+ @local_var_path = "/mfn/v0/shipments"
34
+ @request_body = {
35
+ "ShipmentRequestDetails" => shipment_request_details,
36
+ "ShippingServiceId" => shipping_service_id
37
+ }
38
+ @request_body["ShippingServiceOfferId"] = shipping_service_offering_id unless shipping_service_offering_id.nil?
39
+ @request_body["HazmatType"] = hazmat_type unless hazmat_type.nil?
40
+ @request_body["LabelFormatOption"] = label_format_option unless label_format_option.empty?
41
+ if shipment_level_seller_inputs_list.any?
42
+ @request_body["ShipmentLevelSellerInputsList"] = shipment_level_seller_inputs_list
43
+ end
44
+ if sandbox
45
+ @request_body = JSON.parse(
46
+ File.read("./lib/muffin_man/sandbox_helpers/merchant_fulfillment/create_shipment_body.json")
47
+ )
48
+ end
49
+ @request_type = "POST"
50
+ call_api
51
+ end
52
+
53
+ def get_additional_seller_inputs(shipping_service_id, ship_from_address, order_id)
54
+ @local_var_path = "/mfn/v0/additionalSellerInputs"
55
+ @request_body = {
56
+ "ShippingServiceId" => shipping_service_id,
57
+ "ShipFromAddress" => ship_from_address,
58
+ "OrderId" => order_id
59
+ }
60
+ @request_type = "POST"
61
+ call_api
62
+ end
63
+ end
64
+ end
65
+ end
@@ -28,7 +28,6 @@ module MuffinMan
28
28
  # @param [MuffinMan::RequestHelpers::OutboundFulfillment::Address] destination_address in form of object
29
29
  # @param [MuffinMan::RequestHelpers::OutboundFulfillment::Item] items in the form of list of items objects
30
30
  # @param [Hash] optional_params optional sp-api attributes in the form of hash
31
- # rubocop:disable Metrics/ParameterLists
32
31
  def initialize(seller_fulfillment_order_id, displayable_order_id, displayable_order_date_time,
33
32
  displayable_order_comment, shipping_speed_category, destination_address, items,
34
33
  optional_params = {})
@@ -42,7 +41,6 @@ module MuffinMan
42
41
  @items = items
43
42
  @optional_params = optional_params
44
43
  end
45
- # rubocop:enable Metrics/ParameterLists
46
44
 
47
45
  # Check to see if the all the properties in the model are valid
48
46
  # @return true if the model is valid
@@ -21,7 +21,6 @@ module MuffinMan
21
21
  }.merge(optional_params))
22
22
  end
23
23
 
24
- # rubocop:disable Metrics/ParameterLists
25
24
  def self.fulfillment_order_request(seller_fulfillment_order_id, displayable_order_id,
26
25
  displayable_order_date_time,
27
26
  displayable_order_comment, shipping_speed_category,
@@ -30,7 +29,6 @@ module MuffinMan
30
29
  displayable_order_comment, shipping_speed_category, destination_address,
31
30
  items, optional_params)
32
31
  end
33
- # rubocop:enable Metrics/ParameterLists
34
32
 
35
33
  def self.fulfillment_preview_request(address, items, optional_params = {})
36
34
  FulfillmentPreviewRequest.new(address, items, optional_params)
@@ -0,0 +1,38 @@
1
+ {
2
+ "ShipmentRequestDetails": {
3
+ "AmazonOrderId": "903-5563053-5647845",
4
+ "ItemList": [
5
+ {
6
+ "OrderItemId": "52986411826454",
7
+ "Quantity": 1
8
+ }
9
+ ],
10
+ "ShipFromAddress": {
11
+ "Name": "John Doe",
12
+ "AddressLine1": "300 Turnbull Ave",
13
+ "Email": "jdoeasdfllkj@yahoo.com",
14
+ "City": "Detroit",
15
+ "StateOrProvinceCode": "MI",
16
+ "PostalCode": "48123",
17
+ "CountryCode": "US",
18
+ "Phone": "7132341234"
19
+ },
20
+ "PackageDimensions": {
21
+ "Length": 10,
22
+ "Width": 10,
23
+ "Height": 10,
24
+ "Unit": "inches"
25
+ },
26
+ "Weight": {
27
+ "Value": 10,
28
+ "Unit": "oz"
29
+ },
30
+ "ShippingServiceOptions": {
31
+ "DeliveryExperience": "NoTracking",
32
+ "CarrierWillPickUp": false,
33
+ "CarrierWillPickUpOption": "ShipperWillDropOff"
34
+ }
35
+ },
36
+ "ShippingServiceId": "UPS_PTP_2ND_DAY_AIR",
37
+ "ShippingServiceOfferId": "WHgxtyn6qjGGaCzOCog1azF5HLHje5Pz3Lc2Fmt5eKoZAReW8oJ1SMumuBS8lA/Hjuglhyiu0+KRLvyJxFV0PB9YFMDhygs3VyTL0WGYkGxiuRkmuEvpqldUn9rrkWVodqnR4vx2VtXvtER/Ju6RqYoddJZGy6RS2KLzzhQ2NclN0NYXMZVqpOe5RsRBddXaGuJr7oza3M52+JzChocAHzcurIhCRynpbxfmNLzZMQEbgnpGLzuaoSMzfxg90/NaXFR/Ou01du/uKd5AbfMW/AxAKP9ht6Oi9lDHq6WkGqvjkVLW0/jj/fBgblIwcs+t"
38
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "1.5.4"
4
+ VERSION = "1.5.6"
5
5
  end
data/lib/muffin_man.rb CHANGED
@@ -19,6 +19,7 @@ require "muffin_man/fba_inventory/v1"
19
19
  require "muffin_man/request_helpers"
20
20
  require "muffin_man/feeds/v20210630"
21
21
  require "muffin_man/notifications/v1"
22
+ require "muffin_man/merchant_fulfillment/v0"
22
23
 
23
24
  module MuffinMan
24
25
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.4
4
+ version: 1.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-11-09 00:00:00.000000000 Z
13
+ date: 2022-11-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -165,6 +165,7 @@ files:
165
165
  - lib/muffin_man/fulfillment_outbound/v20200701.rb
166
166
  - lib/muffin_man/listings/v20210801.rb
167
167
  - lib/muffin_man/lwa/auth_helper.rb
168
+ - lib/muffin_man/merchant_fulfillment/v0.rb
168
169
  - lib/muffin_man/notifications/v1.rb
169
170
  - lib/muffin_man/orders/v0.rb
170
171
  - lib/muffin_man/product_fees/v0.rb
@@ -178,6 +179,7 @@ files:
178
179
  - lib/muffin_man/request_helpers/outbound_fulfillment/fulfillment_preview_request.rb
179
180
  - lib/muffin_man/request_helpers/outbound_fulfillment/item.rb
180
181
  - lib/muffin_man/request_helpers/outbound_fulfillment/v20200701.rb
182
+ - lib/muffin_man/sandbox_helpers/merchant_fulfillment/create_shipment_body.json
181
183
  - lib/muffin_man/solicitations/v1.rb
182
184
  - lib/muffin_man/sp_api_client.rb
183
185
  - lib/muffin_man/tokens/v20210301.rb