amazon-mws-plus 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.project +12 -0
  4. data/Gemfile +13 -0
  5. data/README.markdown +30 -0
  6. data/Rakefile +50 -0
  7. data/amazon-mws-plus.gemspec +23 -0
  8. data/amazon-mws.tmproj +27 -0
  9. data/examples/xml/cancel_feed_submissions.xml +16 -0
  10. data/examples/xml/cancel_fulfillment_order.xml +6 -0
  11. data/examples/xml/cancel_report_requests.xml +18 -0
  12. data/examples/xml/create_fulfillment_order.xml +6 -0
  13. data/examples/xml/error.xml +10 -0
  14. data/examples/xml/get_feed_submission_count.xml +10 -0
  15. data/examples/xml/get_feed_submission_list.xml +18 -0
  16. data/examples/xml/get_feed_submission_list_by_next_token.xml +16 -0
  17. data/examples/xml/get_feed_submission_result.xml +30 -0
  18. data/examples/xml/get_fulfillment_order.xml +113 -0
  19. data/examples/xml/get_fulfillment_preview.xml +148 -0
  20. data/examples/xml/get_matching_product.xml +115 -0
  21. data/examples/xml/get_matching_product_for_id.xml +119 -0
  22. data/examples/xml/get_report.xml +237 -0
  23. data/examples/xml/get_report_count.xml +9 -0
  24. data/examples/xml/get_report_list.xml +17 -0
  25. data/examples/xml/get_report_request_count.xml +8 -0
  26. data/examples/xml/get_report_request_list.xml +120 -0
  27. data/examples/xml/get_report_request_list_by_next_token.xml +20 -0
  28. data/examples/xml/get_report_schedule_count.xml +10 -0
  29. data/examples/xml/get_report_schedule_list.xml +15 -0
  30. data/examples/xml/get_report_schedule_list_by_next_token.xml +15 -0
  31. data/examples/xml/list_all_fulfillment_orders.xml +69 -0
  32. data/examples/xml/list_all_fulfillment_orders_by_next_token.xml +61 -0
  33. data/examples/xml/manage_report_schedule.xml +14 -0
  34. data/examples/xml/orders_request.xml +39 -0
  35. data/examples/xml/request_order_items.xml +51 -0
  36. data/examples/xml/request_order_items_by_next_token.xml +51 -0
  37. data/examples/xml/request_orders.xml +43 -0
  38. data/examples/xml/request_orders_by_next_token.xml +69 -0
  39. data/examples/xml/request_report.xml +17 -0
  40. data/examples/xml/submit_feed.xml +14 -0
  41. data/examples/xml/update_report_acknowledgements.xml +18 -0
  42. data/examples/xsd/Inventory.xsd +49 -0
  43. data/examples/xsd/Item.xsd +285 -0
  44. data/examples/xsd/Listings.xsd +32 -0
  45. data/examples/xsd/OrderAcknowledgement.xsd +55 -0
  46. data/examples/xsd/OrderAdjustment.xsd +94 -0
  47. data/examples/xsd/OrderFulfillment.xsd +57 -0
  48. data/examples/xsd/Override.xsd +48 -0
  49. data/examples/xsd/Price.xsd +59 -0
  50. data/examples/xsd/ProcessingReport.xsd +87 -0
  51. data/examples/xsd/Product.xsd +220 -0
  52. data/examples/xsd/Product/AutoAccessory.xsd +807 -0
  53. data/examples/xsd/Product/Beauty.xsd +114 -0
  54. data/examples/xsd/Product/CE.xsd +544 -0
  55. data/examples/xsd/Product/CameraPhoto.xsd +2410 -0
  56. data/examples/xsd/Product/FoodAndBeverages.xsd +270 -0
  57. data/examples/xsd/Product/Gourmet.xsd +85 -0
  58. data/examples/xsd/Product/Health.xsd +189 -0
  59. data/examples/xsd/Product/Home.xsd +654 -0
  60. data/examples/xsd/Product/Jewelry.xsd +603 -0
  61. data/examples/xsd/Product/Miscellaneous.xsd +157 -0
  62. data/examples/xsd/Product/MusicalInstruments.xsd +853 -0
  63. data/examples/xsd/Product/Office.xsd +550 -0
  64. data/examples/xsd/Product/PetSupplies.xsd +40 -0
  65. data/examples/xsd/Product/ProductClothing.xsd +197 -0
  66. data/examples/xsd/Product/SWVG.xsd +238 -0
  67. data/examples/xsd/Product/Sports.xsd +308 -0
  68. data/examples/xsd/Product/TiresAndWheels.xsd +159 -0
  69. data/examples/xsd/Product/Tools.xsd +62 -0
  70. data/examples/xsd/Product/ToysBaby.xsd +241 -0
  71. data/examples/xsd/Product/Wireless.xsd +77 -0
  72. data/examples/xsd/ProductImage.xsd +39 -0
  73. data/examples/xsd/Relationship.xsd +47 -0
  74. data/examples/xsd/SettlementReport.xsd +158 -0
  75. data/examples/xsd/amzn-base.xsd +1600 -0
  76. data/examples/xsd/amzn-envelope.xsd +98 -0
  77. data/examples/xsd/amzn-header.xsd +45 -0
  78. data/lib/amazon-mws.rb +6 -0
  79. data/lib/amazon/mws.rb +69 -0
  80. data/lib/amazon/mws/authentication.rb +10 -0
  81. data/lib/amazon/mws/authentication/query_string.rb +36 -0
  82. data/lib/amazon/mws/authentication/signature.rb +43 -0
  83. data/lib/amazon/mws/base.rb +74 -0
  84. data/lib/amazon/mws/connection.rb +107 -0
  85. data/lib/amazon/mws/connection/management.rb +95 -0
  86. data/lib/amazon/mws/connection/request_builder.rb +67 -0
  87. data/lib/amazon/mws/exceptions.rb +55 -0
  88. data/lib/amazon/mws/lib/extensions.rb +178 -0
  89. data/lib/amazon/mws/lib/memoizable.rb +10 -0
  90. data/lib/amazon/mws/request/feed.rb +276 -0
  91. data/lib/amazon/mws/request/feed_builder.rb +83 -0
  92. data/lib/amazon/mws/request/fulfillment.rb +50 -0
  93. data/lib/amazon/mws/request/orders.rb +107 -0
  94. data/lib/amazon/mws/request/products.rb +38 -0
  95. data/lib/amazon/mws/request/report.rb +330 -0
  96. data/lib/amazon/mws/response.rb +43 -0
  97. data/lib/amazon/mws/response/feed/cancel_feed_submissions_response.rb +15 -0
  98. data/lib/amazon/mws/response/feed/get_feed_submission_count_response.rb +13 -0
  99. data/lib/amazon/mws/response/feed/get_feed_submission_list_by_next_token_response.rb +17 -0
  100. data/lib/amazon/mws/response/feed/get_feed_submission_list_response.rb +16 -0
  101. data/lib/amazon/mws/response/feed/get_feed_submission_result_response.rb +54 -0
  102. data/lib/amazon/mws/response/feed/models/feed_submission.rb +16 -0
  103. data/lib/amazon/mws/response/feed/submit_feed_response.rb +15 -0
  104. data/lib/amazon/mws/response/fulfillment_order/cancel_fulfillment_order_response.rb +11 -0
  105. data/lib/amazon/mws/response/fulfillment_order/create_fulfillment_order_response.rb +12 -0
  106. data/lib/amazon/mws/response/fulfillment_order/get_fulfillment_order_response.rb +19 -0
  107. data/lib/amazon/mws/response/fulfillment_order/list_all_fulfillment_orders_by_next_token_response.rb +16 -0
  108. data/lib/amazon/mws/response/fulfillment_order/list_all_fulfillment_orders_response.rb +15 -0
  109. data/lib/amazon/mws/response/fulfillment_order/models/fulfillment_address.rb +18 -0
  110. data/lib/amazon/mws/response/fulfillment_order/models/fulfillment_order.rb +24 -0
  111. data/lib/amazon/mws/response/fulfillment_order/models/fulfillment_order_item.rb +20 -0
  112. data/lib/amazon/mws/response/fulfillment_order/models/fulfillment_shipment.rb +18 -0
  113. data/lib/amazon/mws/response/fulfillment_order/models/fulfillment_shipment_item.rb +14 -0
  114. data/lib/amazon/mws/response/order/models/order.rb +43 -0
  115. data/lib/amazon/mws/response/order/models/order_item.rb +48 -0
  116. data/lib/amazon/mws/response/order/models/promotion_id.rb +9 -0
  117. data/lib/amazon/mws/response/order/request_get_order_response.rb +15 -0
  118. data/lib/amazon/mws/response/order/request_order_items_response.rb +25 -0
  119. data/lib/amazon/mws/response/order/request_orders_response.rb +28 -0
  120. data/lib/amazon/mws/response/product/get_matching_proudct.rb +31 -0
  121. data/lib/amazon/mws/response/product/models/product.rb +36 -0
  122. data/lib/amazon/mws/response/report/cancel_report_requests_response.rb +16 -0
  123. data/lib/amazon/mws/response/report/get_report_count_response.rb +13 -0
  124. data/lib/amazon/mws/response/report/get_report_list_response.rb +17 -0
  125. data/lib/amazon/mws/response/report/get_report_request_count_response.rb +13 -0
  126. data/lib/amazon/mws/response/report/get_report_request_list_by_next_token_response.rb +17 -0
  127. data/lib/amazon/mws/response/report/get_report_request_list_response.rb +17 -0
  128. data/lib/amazon/mws/response/report/get_report_schedule_count_response.rb +13 -0
  129. data/lib/amazon/mws/response/report/get_report_schedule_list_by_next_token_response.rb +17 -0
  130. data/lib/amazon/mws/response/report/get_report_schedule_list_response.rb +17 -0
  131. data/lib/amazon/mws/response/report/manage_report_schedule_response.rb +16 -0
  132. data/lib/amazon/mws/response/report/models/report_info.rb +16 -0
  133. data/lib/amazon/mws/response/report/models/report_request.rb +20 -0
  134. data/lib/amazon/mws/response/report/models/report_schedule.rb +13 -0
  135. data/lib/amazon/mws/response/report/request_report_response.rb +15 -0
  136. data/lib/amazon/mws/response/report/update_reports_acknowledgements_response.rb +16 -0
  137. data/lib/amazon/mws/response/response.rb +43 -0
  138. data/lib/amazon/mws/response/response_error.rb +21 -0
  139. data/test/connection_test.rb +14 -0
  140. data/test/feed_builder_test.rb +74 -0
  141. data/test/feed_test.rb +144 -0
  142. data/test/fulfillment_order.rb +49 -0
  143. data/test/orders_test.rb +78 -0
  144. data/test/products_test.rb +28 -0
  145. data/test/query_string_test.rb +18 -0
  146. data/test/report_test.rb +88 -0
  147. data/test/response_test.rb +172 -0
  148. data/test/signature_test.rb +32 -0
  149. data/test/test_config.yml +6 -0
  150. data/test/test_helper.rb +33 -0
  151. metadata +335 -0
@@ -0,0 +1,43 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class Response
5
+ include ROXML
6
+ xml_convention :camelcase
7
+
8
+ # This is the factoryish method that is called!, not new
9
+ def self.format(response)
10
+ if response.content_type =~ /xml/ || response.body =~ /<?xml/
11
+ parse_xml(response)
12
+ else
13
+ response.body
14
+ end
15
+ end
16
+
17
+ def self.parse_xml(response)
18
+ if [Net::HTTPClientError, Net::HTTPServerError].any? {|error| response.is_a? error }
19
+ return ResponseError.from_xml(response.body)
20
+ else
21
+ return self.from_xml(response.body)
22
+ end
23
+ end
24
+
25
+ def accessors
26
+ roxml_references.map {|r| r.accessor}
27
+ end
28
+
29
+ # render a ROXML object as a normal hash, eliminating the @ and some unneeded admin fields
30
+ def as_hash
31
+ obj_hash = {}
32
+ self.instance_variables.each do |v|
33
+ m = v.to_s.sub('@','')
34
+ if m != 'roxml_references' && m!= 'promotion_ids'
35
+ obj_hash[m.to_sym] = self.instance_variable_get(v)
36
+ end
37
+ end
38
+ obj_hash
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'models/feed_submission'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class CancelFeedSubmissionsResponse < Response
7
+ xml_name "CancelFeedSubmissionsResponse"
8
+ result = "CancelFeedSubmissionsResult"
9
+
10
+ xml_reader :count, :in => result, :as => Integer
11
+ xml_reader :feed_submissions, :as => [FeedSubmission], :in => result
12
+ xml_reader :request_id, :in => "ResponseMetadata"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class GetFeedSubmissionCountResponse < Response
5
+ xml_name "GetFeedSubmissionCountResponse"
6
+ result = "GetFeedSubmissionCountResult"
7
+
8
+ xml_reader :count, :in => result, :as => Integer
9
+ xml_reader :request_id, :in => "ResponseMetadata"
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ require_relative 'models/feed_submission'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class GetFeedSubmissionListByNextTokenResponse < Response
7
+ xml_name "GetFeedSubmissionListByNextTokenResponse"
8
+ result = "GetFeedSubmissionListByNextTokenResult"
9
+
10
+ xml_reader :has_next?, :in => result
11
+ xml_reader :next_token, :in => result
12
+ xml_reader :feed_submissions, :as => [FeedSubmission], :in => result
13
+ xml_reader :request_id, :in => "ResponseMetadata"
14
+ end
15
+
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ require_relative 'models/feed_submission'
2
+ module Amazon
3
+ module MWS
4
+
5
+ class GetFeedSubmissionListResponse < Response
6
+ xml_name "GetFeedSubmissionListResponse"
7
+ result = "GetFeedSubmissionListResult"
8
+
9
+ xml_reader :has_next?, :in => result
10
+ xml_reader :next_token, :in => result
11
+ xml_reader :feed_submissions, :as => [FeedSubmission], :in => result
12
+ xml_reader :request_id, :in => "ResponseMetadata"
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,54 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class GetFeedSubmissionResultResponse < Response
5
+ class Header < Response
6
+ xml_reader :document_version, :as => Float
7
+ xml_reader :merchant_id, :from => "MerchantIdentifier"
8
+ end
9
+
10
+ class ProcessingSummary < Response
11
+ xml_name "ProcessingSummary"
12
+
13
+ xml_reader :messages_processed, :as => Integer
14
+ xml_reader :messages_successful, :as => Integer
15
+ xml_reader :messages_with_error, :as => Integer
16
+ xml_reader :messages_with_warning, :as => Integer
17
+ end
18
+
19
+ class Result < Response
20
+ xml_name "Result"
21
+
22
+ xml_reader :message_id, :from => "MessageID", :as => Integer
23
+ xml_reader :result_code
24
+ xml_reader :message_code, :from => "ResultMessageCode"
25
+ xml_reader :description, :from => "ResultDescription"
26
+ xml_reader :sku, :from => "SKU", :in => "AdditionalInfo"
27
+ end
28
+
29
+ class Message < Response
30
+ xml_name "Message"
31
+
32
+ xml_reader :id, :from => "MessageID", :as => Integer
33
+ xml_reader :document_transaction_id, :from => "DocumentTransactionID", :in => "ProcessingReport"
34
+ xml_reader :status_code, :in => "ProcessingReport"
35
+ xml_reader :processing_summary, :as => ProcessingSummary, :in => "ProcessingReport"
36
+ xml_reader :results, :as => [Result], :in => "ProcessingReport"
37
+ end
38
+ end
39
+
40
+ class GetFeedSubmissionResultResponse
41
+ xml_name "AmazonEnvelope"
42
+
43
+ xml_reader :header, :as => Header
44
+ # flattened header
45
+ xml_reader :document_version, :as => Float, :in => "Header"
46
+ xml_reader :merchant_id, :from => "MerchantIdentifier", :in => "Header"
47
+
48
+ xml_reader :message_type
49
+ xml_reader :message, :as => Message
50
+ end
51
+
52
+ end
53
+ end
54
+
@@ -0,0 +1,16 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class FeedSubmission < Response
5
+ xml_name "FeedSubmissionInfo"
6
+
7
+ xml_reader :id, :from => "FeedSubmissionId"
8
+ xml_reader :feed_type
9
+ xml_reader :submitted_date, :as => Time
10
+ xml_reader :started_processing_date, :as => Time
11
+ xml_reader :completed_processing_date, :as => Time
12
+ xml_reader :feed_processing_status
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'models/feed_submission'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class SubmitFeedResponse < Response
7
+ xml_name "SubmitFeedResponse"
8
+ result = "SubmitFeedResult"
9
+
10
+ xml_reader :feed_submission, :as => FeedSubmission, :in => result
11
+ xml_reader :request_id, :in => "ResponseMetadata"
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class CancelFulfillmentOrderResponse < Response
5
+ xml_name 'CancelFulfillmentOrderResponse'
6
+ namespace = 'xmlns:'
7
+
8
+ xml_reader :request_id, :in => "ResponseMetadata"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class CreateFulfillmentOrderResponse < Response
5
+ xml_name 'CreateFulfillmentOrderResponse'
6
+ namespace = 'xmlns:'
7
+
8
+ xml_reader :request_id, :in => "ResponseMetadata"
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,19 @@
1
+ require_relative 'models/fulfillment_order'
2
+ require_relative 'models/fulfillment_order_item'
3
+ require_relative 'models/fulfillment_shipment'
4
+
5
+ module Amazon
6
+ module MWS
7
+
8
+ class GetFulfillmentOrderResponse < Response
9
+ xml_name 'GetFulfillmentOrderResponse'
10
+ result = 'GetFulfillmentOrderResult'
11
+ namespace = 'xmlns:'
12
+
13
+ xml_reader :request_id, :in => "ResponseMetadata"
14
+ xml_reader :fulfillment_order, :as => FulfillmentOrder, :in => result
15
+ xml_reader :fulfillment_order_items, :as => [FulFillmentOrderItem], :in => namespace + result + "/" + namespace + "FulfillmentOrderItem", :from => "member"
16
+ xml_reader :fulfillment_shipments, :as => [FulfillmentShipment], :in => namespace + result + "/" + namespace + "FulfillmentShipment", :from => "member"
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ require_relative 'models/fulfillment_order'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class ListAllFulfillmentOrdersByNextTokenResponse < Response
7
+ xml_name 'ListAllFulfillmentOrdersByNextTokenResponse'
8
+ result = 'ListAllFulfillmentOrdersByNextTokenResult'
9
+ namespace = 'xmlns:'
10
+
11
+ xml_reader :next_token
12
+ xml_reader :request_id, :in => "ResponseMetadata"
13
+ xml_reader :fulfillment_orders, :as => [ FulfillmentOrder ], :in => 'xmlns:ListAllFulfillmentOrdersByNextTokenResult/xmlns:FulfillmentOrders', :from => "member"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'models/fulfillment_order'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class ListAllFulfillmentOrdersResponse < Response
7
+ xml_name 'ListAllFulfillmentOrdersResponse'
8
+ result = 'ListAllFulfillmentOrdersResult'
9
+ namespace = 'xmlns:'
10
+
11
+ xml_reader :request_id, :in => "ResponseMetadata"
12
+ xml_reader :fulfillment_orders, :as => [ FulfillmentOrder ], :in => 'xmlns:ListAllFulfillmentOrdersResult/xmlns:FulfillmentOrders', :from => "member"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class FulfillmentAddress < Response
5
+ xml_reader :name
6
+ xml_reader :line1
7
+ xml_reader :line2
8
+ xml_reader :line3
9
+ xml_reader :district_or_county
10
+ xml_reader :city
11
+ xml_reader :state_or_province_code
12
+ xml_reader :country_code
13
+ xml_reader :postal_code
14
+ xml_reader :phone_number
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ require_relative 'fulfillment_address'
2
+
3
+ module Amazon
4
+ module MWS
5
+
6
+ class FulfillmentOrder < Response
7
+ xml_name "FulfillmentOrder"
8
+
9
+ xml_reader :seller_fulfillment_order_id
10
+ xml_reader :displayable_order_id
11
+ xml_reader :displayable_order_date_time, :as => DateTime
12
+ xml_reader :displayable_order_comment
13
+ xml_reader :shipping_speed_category
14
+ xml_reader :destination_address, :as => FulfillmentAddress
15
+ xml_reader :fulfillment_policy
16
+ xml_reader :fulfillment_method
17
+ xml_reader :received_date_time, :as => DateTime
18
+ xml_reader :fulfillment_order_status
19
+ xml_reader :statusupdated_date_time, :as => DateTime
20
+ xml_reader :notification_email_list, :from => "member", :as => [], :in => "xmlns:NotificationEmailList"
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class FulFillmentOrderItem < Response
5
+ xml_name 'member'
6
+
7
+ xml_reader :seller_sku, :from => "SellerSKU"
8
+ xml_reader :gift_message
9
+ xml_reader :seller_fulfillment_order_item_id
10
+ xml_reader :estimated_ship_date_time, :as => DateTime
11
+ xml_reader :displayable_comment
12
+ xml_reader :order_item_disposition
13
+ xml_reader :unfulfillable_quantity, :as => Integer
14
+ xml_reader :cancelled_quantity
15
+ xml_reader :quantity,:as => Integer
16
+ xml_reader :estimated_arrival_date_time, :as => DateTime
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ require_relative 'fulfillment_shipment_item'
2
+ module Amazon
3
+ module MWS
4
+
5
+ class FulfillmentShipment < Response
6
+ xml_name 'member'
7
+
8
+ xml_reader :amazon_shipment_id
9
+ xml_reader :fulfillment_center_id
10
+ xml_reader :fulfillment_shipment_status
11
+ xml_reader :shipping_date_time, :as => DateTime
12
+ xml_reader :estimated_arrival_date_time, :as => DateTime
13
+ xml_reader :fulfillment_shipment_items, :as => [FulfillmentShipmentItem], :in => "xmlns:FulfillmentShipmentItem", :from => "member"
14
+ xml_reader :fulfillment_shipment_package
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class FulfillmentShipmentItem < Response
5
+ xml_name 'member'
6
+
7
+ xml_reader :seller_sku, :from => 'SellerSKU'
8
+ xml_reader :seller_fulfillment_order_item_id
9
+ xml_reader :quantity
10
+ xml_reader :package_number
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,43 @@
1
+ module Amazon
2
+ module MWS
3
+
4
+ class Order < Response
5
+
6
+ xml_name "Order"
7
+
8
+ xml_reader :amazon_order_id
9
+ xml_reader :seller_order_id
10
+ xml_reader :purchase_date, :as => DateTime
11
+ xml_reader :last_update_date, :as => DateTime
12
+ xml_reader :order_status
13
+ xml_reader :fulfillment_channel
14
+ xml_reader :sales_channel
15
+ xml_reader :order_channel
16
+ xml_reader :ship_service_level
17
+
18
+ xml_reader :amount, :in => "xmlns:OrderTotal", :as => Float
19
+ xml_reader :currency_code, :in => "xmlns:OrderTotal"
20
+
21
+ xml_reader :name, :in => "xmlns:ShippingAddress"
22
+ xml_reader :address_line_1, :in => "xmlns:ShippingAddress"
23
+ xml_reader :address_line_2, :in => "xmlns:ShippingAddress"
24
+ xml_reader :address_line_3, :in => "xmlns:ShippingAddress"
25
+ xml_reader :city, :in => "xmlns:ShippingAddress"
26
+ xml_reader :county, :in => "xmlns:ShippingAddress"
27
+ xml_reader :district, :in => "xmlns:ShippingAddress"
28
+ xml_reader :state_or_region, :in => "xmlns:ShippingAddress"
29
+ xml_reader :postal_code, :in => "xmlns:ShippingAddress"
30
+ xml_reader :country_code, :in => "xmlns:ShippingAddress"
31
+ xml_reader :phone, :in => "xmlns:ShippingAddress"
32
+
33
+ xml_reader :number_of_items_shipped, :as => Integer
34
+ xml_reader :number_of_items_unshipped, :as => Integer
35
+ xml_reader :marketplace_id
36
+ xml_reader :buyer_name
37
+ xml_reader :buyer_email
38
+ xml_reader :shipment_service_level_category
39
+
40
+ end
41
+ end
42
+ end
43
+
@@ -0,0 +1,48 @@
1
+ require_relative 'promotion_id'
2
+ module Amazon
3
+ module MWS
4
+
5
+ class OrderItem < Response
6
+
7
+ xml_name "OrderItem"
8
+
9
+ xml_reader :asin, :from => "ASIN"
10
+ xml_reader :amazon_order_item_id, :from => "OrderItemId"
11
+ xml_reader :seller_sku, :from => "SellerSKU"
12
+ xml_reader :title
13
+ xml_reader :quantity_ordered, :as => Integer
14
+ xml_reader :quantity_shipped, :as => Integer
15
+
16
+ xml_reader :item_price, :from => :amount, :in => "xmlns:ItemPrice", :as => Float
17
+ xml_reader :item_price_currency, :from => :currency_code, :in => "xmlns:ItemPrice"
18
+
19
+ xml_reader :shipping_price, :from => :amount, :in => "xmlns:ShippingPrice", :as => Float
20
+ xml_reader :shipping_price_currency, :from => :currency_code, :in => "xmlns:ShippingPrice"
21
+
22
+ xml_reader :gift_price, :from => :amount, :in => "xmlns:GiftWrapPrice", :as => Float
23
+ xml_reader :gift_price_currency, :from => :currency_code, :in => "xmlns:GiftWrapPrice"
24
+
25
+ xml_reader :item_tax, :from => :amount, :in => "xmlns:ItemTax", :as => Float
26
+ xml_reader :item_tax_currency, :from => :currency_code, :in => "xmlns:ItemTax"
27
+
28
+ xml_reader :shipping_tax, :from => :amount, :in => "xmlns:ShippingTax", :as => Float
29
+ xml_reader :shipping_tax_currency, :from => :currency_code, :in => "xmlns:ShippingTax"
30
+
31
+ xml_reader :gift_tax, :from => :amount, :in => "xmlns:GiftWrapTax", :as => Float
32
+ xml_reader :gift_tax_currency, :from => :currency_code, :in => "xmlns:GiftWrapTax"
33
+
34
+ xml_reader :shipping_discount, :from => :amount, :in => "xmlns:ShippingDiscount", :as => Float
35
+ xml_reader :shipping_discount_currency, :from => :currency_code, :in => "xmlns:ShippingDiscount"
36
+
37
+ xml_reader :promotion_discount, :from => :amount, :in => "xmlns:PromotionDiscount", :as => Float
38
+ xml_reader :promotion_discount_currency, :from => :currency_code, :in => "xmlns:PromotionDiscount"
39
+
40
+ xml_reader :gift_wrap_level
41
+ xml_reader :gift_message_text
42
+
43
+ xml_reader :promotion_ids, :as => [PromotionId], :in => "xmlns:PromotionIds"
44
+
45
+ end
46
+ end
47
+ end
48
+