peddler 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +50 -28
- data/lib/mws.rb +2 -0
- data/lib/mws/cart_information/client.rb +7 -6
- data/lib/mws/customer_information/client.rb +6 -6
- data/lib/mws/feeds/client.rb +8 -8
- data/lib/mws/finances/client.rb +6 -6
- data/lib/mws/fulfillment_inbound_shipment/client.rb +41 -40
- data/lib/mws/fulfillment_inventory/client.rb +3 -3
- data/lib/mws/fulfillment_outbound_shipment/client.rb +18 -18
- data/lib/mws/merchant_fulfillment.rb +1 -0
- data/lib/mws/merchant_fulfillment/client.rb +88 -0
- data/lib/mws/off_amazon_payments/client.rb +203 -202
- data/lib/mws/orders/client.rb +6 -6
- data/lib/mws/products/client.rb +38 -38
- data/lib/mws/recommendations/client.rb +4 -4
- data/lib/mws/reports/client.rb +19 -17
- data/lib/mws/sellers/client.rb +2 -2
- data/lib/mws/subscriptions/client.rb +22 -22
- data/lib/mws/webstore/client.rb +8 -8
- data/lib/peddler/client.rb +7 -7
- data/lib/peddler/flat_file_parser.rb +1 -1
- data/lib/peddler/marketplace.rb +2 -2
- data/lib/peddler/operation.rb +7 -12
- data/lib/peddler/vcr_matcher.rb +5 -3
- data/lib/peddler/version.rb +2 -1
- data/test/helper.rb +11 -2
- data/test/integration/test_fulfillment_inbound_shipment.rb +1 -1
- data/test/integration/test_merchant_fulfillment.rb +11 -0
- data/test/integration/test_orders.rb +20 -0
- data/test/unit/mws/test_merchant_fulfillment_client.rb +83 -0
- data/test/unit/peddler/test_client.rb +12 -10
- data/test/unit/peddler/test_vcr_matcher.rb +3 -3
- data/test/vcr_cassettes/MerchantFulfillment.yml +195 -0
- data/test/vcr_cassettes/Orders.yml +1902 -5
- metadata +10 -2
@@ -9,13 +9,13 @@ module MWS
|
|
9
9
|
# selling your inventory on Amazon's retail web site or through other retail
|
10
10
|
# channels.
|
11
11
|
class Client < ::Peddler::Client
|
12
|
-
version
|
12
|
+
version '2010-10-01'
|
13
13
|
path "/FulfillmentInventory/#{version}"
|
14
14
|
|
15
15
|
# Returns information about the availability of a seller's inventory
|
16
16
|
#
|
17
17
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_ListInventorySupply.html
|
18
|
-
# @param
|
18
|
+
# @param [Hash] opts
|
19
19
|
# @option opts [Array<String>, String] :seller_skus
|
20
20
|
# @option opts [String, #iso8601] :query_start_date_time
|
21
21
|
# @option opts [String] :response_group
|
@@ -32,7 +32,7 @@ module MWS
|
|
32
32
|
# seller's inventory
|
33
33
|
#
|
34
34
|
# @see http://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_ListInventorySupplyByNextToken.html
|
35
|
-
# @param
|
35
|
+
# @param [String] next_token
|
36
36
|
# @return [Peddler::XMLParser]
|
37
37
|
def list_inventory_supply_by_next_token(next_token)
|
38
38
|
operation('ListInventorySupplyByNextToken')
|
@@ -13,15 +13,15 @@ module MWS
|
|
13
13
|
# on when they were fulfilled and by the fulfillment method associated with
|
14
14
|
# them.
|
15
15
|
class Client < ::Peddler::Client
|
16
|
-
version
|
16
|
+
version '2010-10-01'
|
17
17
|
path "/FulfillmentOutboundShipment/#{version}"
|
18
18
|
|
19
19
|
# Lists fulfillment order previews
|
20
20
|
#
|
21
21
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_GetFulfillmentPreview.html
|
22
|
-
# @param
|
23
|
-
# @param
|
24
|
-
# @param
|
22
|
+
# @param [Struct, Hash] address
|
23
|
+
# @param [Array<Struct, Hash>] items
|
24
|
+
# @param [Hash] opts
|
25
25
|
# @option opts Array[String] :shipping_speed_categories
|
26
26
|
# @option opts [Boolean] :include_cod_fulfillment_preview
|
27
27
|
# @return [Peddler::XMLParser]
|
@@ -42,14 +42,14 @@ module MWS
|
|
42
42
|
# Network inventory to a destination address
|
43
43
|
#
|
44
44
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_CreateFulfillmentOrder.html
|
45
|
-
# @param
|
46
|
-
# @param
|
47
|
-
# @param
|
48
|
-
# @param
|
49
|
-
# @param
|
50
|
-
# @param
|
51
|
-
# @param
|
52
|
-
# @param
|
45
|
+
# @param [String] seller_fulfillment_order_id
|
46
|
+
# @param [String] displayable_order_id
|
47
|
+
# @param [String, #iso8601] displayable_order_date_time
|
48
|
+
# @param [String] displayable_order_comment
|
49
|
+
# @param [String] shipping_speed_category
|
50
|
+
# @param [Struct, Hash] destination_address
|
51
|
+
# @param [Array<Struct, Hash>] items
|
52
|
+
# @param [Hash] opts
|
53
53
|
# @option opts [String] :fulfillment_action
|
54
54
|
# @option opts [String] :fulfillment_policy
|
55
55
|
# @option opts [Array<String>] :notification_email_list
|
@@ -82,8 +82,8 @@ module MWS
|
|
82
82
|
# hold on it
|
83
83
|
#
|
84
84
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_UpdateFulfillmentOrder.html
|
85
|
-
# @param
|
86
|
-
# @param
|
85
|
+
# @param [String] seller_fulfillment_order_id
|
86
|
+
# @param [Hash] opts
|
87
87
|
# @option opts [String] :fulfillment_action
|
88
88
|
# @option opts [String] :displayable_order_id
|
89
89
|
# @option opts [String, #iso8601] :displayable_order_date_time
|
@@ -106,7 +106,7 @@ module MWS
|
|
106
106
|
# Gets a fulfillment order
|
107
107
|
#
|
108
108
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_GetFulfillmentOrder.html
|
109
|
-
# @param
|
109
|
+
# @param [String] seller_fulfillment_order_id
|
110
110
|
# @return [Peddler::XMLParser]
|
111
111
|
def get_fulfillment_order(seller_fulfillment_order_id)
|
112
112
|
operation('GetFulfillmentOrder')
|
@@ -118,7 +118,7 @@ module MWS
|
|
118
118
|
# Returns a list of fulfillment orders fulfilled on or after a date
|
119
119
|
#
|
120
120
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_ListAllFulfillmentOrders.html
|
121
|
-
# @param
|
121
|
+
# @param [String, #iso8601] query_start_date_time
|
122
122
|
# @return [Peddler::XMLParser]
|
123
123
|
def list_all_fulfillment_orders(query_start_date_time = nil)
|
124
124
|
opts = query_start_date_time ? { 'QueryStartDateTime' => query_start_date_time } : {}
|
@@ -130,7 +130,7 @@ module MWS
|
|
130
130
|
# Returns the next page of fulfillment orders
|
131
131
|
#
|
132
132
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_ListAllFulfillmentOrdersByNextToken.html
|
133
|
-
# @param
|
133
|
+
# @param [String] next_token
|
134
134
|
# @return [Peddler::XMLParser]
|
135
135
|
def list_all_fulfillment_orders_by_next_token(next_token)
|
136
136
|
operation('ListAllFulfillmentOrdersByNextToken')
|
@@ -149,7 +149,7 @@ module MWS
|
|
149
149
|
# order
|
150
150
|
#
|
151
151
|
# @see http://docs.developer.amazonservices.com/en_US/fba_outbound/FBAOutbound_CancelFulfillmentOrder.html
|
152
|
-
# @param
|
152
|
+
# @param [String] seller_fulfillment_order_id
|
153
153
|
# @return [Peddler::XMLParser]
|
154
154
|
def cancel_fulfillment_order(seller_fulfillment_order_id)
|
155
155
|
operation('CancelFulfillmentOrder')
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'mws/merchant_fulfillment/client'
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'peddler/client'
|
2
|
+
|
3
|
+
module MWS
|
4
|
+
module MerchantFulfillment
|
5
|
+
# The Merchant Fulfillment API provides programmatic access to Amazon's
|
6
|
+
# Shipping Services for sellers, including competitive rates from
|
7
|
+
# Amazon-partnered carriers. Sellers can find out what shipping service
|
8
|
+
# offers are available by submitting information about a proposed shipment,
|
9
|
+
# such as package size and weight, shipment origin, and delivery date
|
10
|
+
# requirements. Sellers can choose from the shipping service offers returned
|
11
|
+
# by Amazon, and then purchase shipping labels for fulfilling their orders.
|
12
|
+
class Client < ::Peddler::Client
|
13
|
+
version '2015-06-01'
|
14
|
+
path "/MerchantFulfillment/#{version}"
|
15
|
+
|
16
|
+
# Returns a list of shipping service offers that satisfy the shipment
|
17
|
+
# request details that you specify
|
18
|
+
#
|
19
|
+
# @see http://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_GetEligibleShippingServices.html
|
20
|
+
# @param [Struct, Hash] shipment_request_details
|
21
|
+
# @return [Peddler::XMLParser]
|
22
|
+
def get_eligible_shipping_services(shipment_request_details)
|
23
|
+
operation('GetEligibleShippingServices')
|
24
|
+
.add('ShipmentRequestDetails' => shipment_request_details)
|
25
|
+
|
26
|
+
run
|
27
|
+
end
|
28
|
+
|
29
|
+
# Purchases shipping and returns PNG or PDF document data for a shipping
|
30
|
+
# label
|
31
|
+
#
|
32
|
+
# @see http://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_CreateShipment.html
|
33
|
+
# @param [Struct, Hash] shipment_request_details
|
34
|
+
# @param [String] shipping_service_id
|
35
|
+
# @param [Hash] opts
|
36
|
+
# @option opts [String] :shipping_service_offer_id
|
37
|
+
# @return [Peddler::XMLParser]
|
38
|
+
def create_shipment(shipment_request_details, shipping_service_id, opts = {})
|
39
|
+
operation('CreateShipment')
|
40
|
+
.add(
|
41
|
+
'ShipmentRequestDetails' => shipment_request_details,
|
42
|
+
'ShippingServiceId' => shipping_service_id
|
43
|
+
)
|
44
|
+
.add(opts)
|
45
|
+
|
46
|
+
run
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns an existing shipment for the ShipmentId value that you specify
|
50
|
+
#
|
51
|
+
# @see http://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_GetShipment.html
|
52
|
+
# @params [String] shipment_id
|
53
|
+
# @return [Peddler::XMLParser]
|
54
|
+
def get_shipment(shipment_id)
|
55
|
+
operation('GetShipment')
|
56
|
+
.add(
|
57
|
+
'ShipmentId' => shipment_id
|
58
|
+
)
|
59
|
+
|
60
|
+
run
|
61
|
+
end
|
62
|
+
|
63
|
+
# Cancels an existing shipment and requests a refund for the ShipmentId
|
64
|
+
# value that you specify
|
65
|
+
#
|
66
|
+
# @see http://docs.developer.amazonservices.com/en_US/merch_fulfill/MerchFulfill_CancelShipment.html
|
67
|
+
# @params [String] shipment_id
|
68
|
+
# @return [Peddler::XMLParser]
|
69
|
+
def cancel_shipment(shipment_id)
|
70
|
+
operation('CancelShipment')
|
71
|
+
.add(
|
72
|
+
'ShipmentId' => shipment_id
|
73
|
+
)
|
74
|
+
|
75
|
+
run
|
76
|
+
end
|
77
|
+
|
78
|
+
# Gets the operational status of the API
|
79
|
+
#
|
80
|
+
# @see http://docs.developer.amazonservices.com/en_US/merch_fulfill/MWS_GetServiceStatus.html
|
81
|
+
# @return [Peddler::XMLParser]
|
82
|
+
def get_service_status
|
83
|
+
operation('GetServiceStatus')
|
84
|
+
run
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -14,7 +14,7 @@ module MWS
|
|
14
14
|
# Payments. You cannot use this API section to process payments for Amazon
|
15
15
|
# Marketplace, Amazon Webstore, or Checkout by Amazon.
|
16
16
|
class Client < ::Peddler::Client
|
17
|
-
version
|
17
|
+
version '2013-01-01'
|
18
18
|
path "/OffAmazonPayments/#{version}/"
|
19
19
|
|
20
20
|
# Switches the client to the sandbox environment
|
@@ -26,160 +26,159 @@ module MWS
|
|
26
26
|
self
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
29
|
+
# Reserves a specified amount against the payment method(s) stored in the
|
30
|
+
# order reference
|
30
31
|
#
|
31
|
-
# @see
|
32
|
-
# @param
|
33
|
-
# @param
|
34
|
-
# @param
|
35
|
-
# @
|
36
|
-
# @option opts [
|
32
|
+
# @see https://payments.amazon.com/documentation/apireference/201752010
|
33
|
+
# @param [String] amazon_order_reference_id
|
34
|
+
# @param [String] authorization_reference_id
|
35
|
+
# @param [Struct, Hash] authorization_amount
|
36
|
+
# @param [Hash] opts
|
37
|
+
# @option opts [String] :seller_authorization_note
|
38
|
+
# @option opts [Integer] :transaction_timeout
|
39
|
+
# @option opts [Boolean] :capture_now
|
40
|
+
# @option opts [String] :soft_descriptor
|
37
41
|
# @return [Peddler::XMLParser]
|
38
|
-
def
|
39
|
-
operation('
|
42
|
+
def authorize(amazon_order_reference_id, authorization_reference_id, authorization_amount, opts = {})
|
43
|
+
operation('Authorize')
|
40
44
|
.add(opts.update(
|
41
|
-
'
|
42
|
-
'
|
45
|
+
'AmazonOrderReferenceId' => amazon_order_reference_id,
|
46
|
+
'AuthorizationReferenceId' => authorization_reference_id,
|
47
|
+
'AuthorizationAmount' => authorization_amount
|
43
48
|
))
|
44
49
|
|
45
50
|
run
|
46
51
|
end
|
47
52
|
|
48
|
-
#
|
53
|
+
# Cancels a previously confirmed order reference
|
49
54
|
#
|
50
|
-
# @see
|
51
|
-
# @param
|
52
|
-
# @param
|
53
|
-
# @option opts [String]
|
55
|
+
# @see https://payments.amazon.com/documentation/apireference/201751990
|
56
|
+
# @param [String] amazon_order_reference_id
|
57
|
+
# @param [Hash] opts
|
58
|
+
# @option opts [String] cancelation_reason
|
54
59
|
# @return [Peddler::XMLParser]
|
55
|
-
def
|
56
|
-
operation('
|
60
|
+
def cancel_order_reference(amazon_order_reference_id, opts = {})
|
61
|
+
operation('CancelOrderReference')
|
62
|
+
.add(opts.update('AmazonOrderReferenceId' => amazon_order_reference_id))
|
63
|
+
|
64
|
+
run
|
65
|
+
end
|
66
|
+
|
67
|
+
# Captures funds from an authorized payment instrument
|
68
|
+
#
|
69
|
+
# @see https://payments.amazon.com/documentation/apireference/201752040
|
70
|
+
# @param [String] amazon_authorization_id
|
71
|
+
# @param [String] capture_reference_id
|
72
|
+
# @param [Struct, Hash] capture_amount
|
73
|
+
# @param [Hash] opts
|
74
|
+
# @option opts [String] :seller_capture_note
|
75
|
+
# @option opts [String] :soft_descriptor
|
76
|
+
# @return [Peddler::XMLParser]
|
77
|
+
def capture(amazon_authorization_id, capture_reference_id, capture_amount, opts = {})
|
78
|
+
operation('Capture')
|
57
79
|
.add(opts.update(
|
58
|
-
'
|
80
|
+
'AmazonAuthorizationId' => amazon_authorization_id,
|
81
|
+
'CaptureReferenceId' => capture_reference_id,
|
82
|
+
'CaptureAmount' => capture_amount
|
59
83
|
))
|
60
84
|
|
61
85
|
run
|
62
86
|
end
|
63
87
|
|
64
|
-
#
|
65
|
-
# and other information about the seller
|
88
|
+
# Closes an authorization
|
66
89
|
#
|
67
|
-
# @see
|
68
|
-
# @param
|
69
|
-
# @param
|
90
|
+
# @see https://payments.amazon.com/documentation/apireference/201752070
|
91
|
+
# @param [String] amazon_authorization_id
|
92
|
+
# @param [Hash] opts
|
93
|
+
# @option opts [String] closure_reason
|
70
94
|
# @return [Peddler::XMLParser]
|
71
|
-
def
|
72
|
-
operation('
|
73
|
-
.add(
|
74
|
-
'AmazonBillingAgreementId' => amazon_billing_agreement_id,
|
75
|
-
'BillingAgreementAttributes' => billing_agreement_attributes
|
76
|
-
)
|
95
|
+
def close_authorization(amazon_authorization_id, opts = {})
|
96
|
+
operation('CloseAuthorization')
|
97
|
+
.add(opts.update('AmazonAuthorizationId' => amazon_authorization_id))
|
77
98
|
|
78
99
|
run
|
79
100
|
end
|
80
101
|
|
81
|
-
# Confirms that
|
82
|
-
#
|
102
|
+
# Confirms that an order reference has been fulfilled (fully or partially)
|
103
|
+
# and that you do not expect to create any new authorizations on this
|
104
|
+
# order reference
|
83
105
|
#
|
84
|
-
# @see
|
85
|
-
# @param
|
106
|
+
# @see https://payments.amazon.com/documentation/apireference/201752000
|
107
|
+
# @param [String] amazon_order_reference_id
|
108
|
+
# @param [Hash] opts
|
109
|
+
# @option opts [String] closure_reason
|
86
110
|
# @return [Peddler::XMLParser]
|
87
|
-
def
|
88
|
-
operation('
|
89
|
-
.add(
|
90
|
-
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
91
|
-
)
|
111
|
+
def close_order_reference(amazon_order_reference_id, opts = {})
|
112
|
+
operation('CloseOrderReference')
|
113
|
+
.add(opts.update('AmazonOrderReferenceId' => amazon_order_reference_id))
|
92
114
|
|
93
115
|
run
|
94
116
|
end
|
95
117
|
|
96
|
-
#
|
97
|
-
#
|
118
|
+
# Confirms that the order reference is free of constraints and all required
|
119
|
+
# information has been set on the order reference
|
98
120
|
#
|
99
|
-
# @see
|
100
|
-
# @param
|
121
|
+
# @see https://payments.amazon.com/documentation/apireference/201751980
|
122
|
+
# @param [String] amazon_order_reference_id
|
101
123
|
# @return [Peddler::XMLParser]
|
102
|
-
def
|
103
|
-
operation('
|
104
|
-
.add(
|
105
|
-
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
106
|
-
)
|
124
|
+
def confirm_order_reference(amazon_order_reference_id)
|
125
|
+
operation('ConfirmOrderReference')
|
126
|
+
.add('AmazonOrderReferenceId' => amazon_order_reference_id)
|
107
127
|
|
108
128
|
run
|
109
129
|
end
|
110
130
|
|
111
|
-
#
|
112
|
-
# billing agreement
|
131
|
+
# Creates an order reference for the given object
|
113
132
|
#
|
114
|
-
# @see
|
115
|
-
# @param
|
116
|
-
# @param
|
117
|
-
# @param
|
118
|
-
# @param opts [Hash]
|
119
|
-
# @option opts [String] :seller_authorization_note
|
120
|
-
# @option opts [Integer] :transaction_timeout
|
121
|
-
# @option opts [Boolean] :capture_now
|
122
|
-
# @option opts [String] :soft_descriptor
|
123
|
-
# @option opts [String] :seller_note
|
124
|
-
# @option opts [String] :platform_id
|
125
|
-
# @option opts [Hash, Struct] :seller_order_attributes
|
133
|
+
# @see https://payments.amazon.com/documentation/apireference/201751670
|
134
|
+
# @param [String] id
|
135
|
+
# @param [String] id_type
|
136
|
+
# @param [Hash] opts
|
126
137
|
# @option opts [Boolean] :inherit_shipping_address
|
138
|
+
# @option opts [Boolean] :confirm_now
|
139
|
+
# @option opts [Struct, Hash] :order_reference_attributes
|
127
140
|
# @return [Peddler::XMLParser]
|
128
|
-
def
|
129
|
-
operation('
|
141
|
+
def create_order_reference_for_id(id, id_type, opts = {})
|
142
|
+
operation('CreateOrderReferenceForId')
|
130
143
|
.add(opts.update(
|
131
|
-
'
|
132
|
-
'
|
133
|
-
'AuthorizationAmount' => authorization_amount
|
144
|
+
'Id' => id,
|
145
|
+
'IdType' => id_type
|
134
146
|
))
|
135
147
|
|
136
148
|
run
|
137
149
|
end
|
138
150
|
|
139
|
-
#
|
140
|
-
#
|
141
|
-
# authorizations on this billing agreement
|
151
|
+
# Returns the status of a particular authorization and the total amount
|
152
|
+
# captured on the authorization
|
142
153
|
#
|
143
|
-
# @see
|
144
|
-
# @param
|
145
|
-
# @param opts [Hash]
|
146
|
-
# @option opts [String] :closure_reason
|
154
|
+
# @see https://payments.amazon.com/documentation/apireference/201752030
|
155
|
+
# @param [String] amazon_authorization_id
|
147
156
|
# @return [Peddler::XMLParser]
|
148
|
-
def
|
149
|
-
operation('
|
150
|
-
.add(
|
151
|
-
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
152
|
-
))
|
157
|
+
def get_authorization_details(amazon_authorization_id)
|
158
|
+
operation('GetAuthorizationDetails')
|
159
|
+
.add('AmazonAuthorizationId' => amazon_authorization_id)
|
153
160
|
|
154
161
|
run
|
155
162
|
end
|
156
163
|
|
157
|
-
#
|
158
|
-
#
|
164
|
+
# Returns the status of a particular capture and the total amount refunded
|
165
|
+
# on the capture
|
159
166
|
#
|
160
|
-
# @see
|
161
|
-
# @param
|
162
|
-
# @param order_total [Struct, Hash]
|
163
|
-
# @param opts [Hash]
|
164
|
-
# @option opts [String] :platform_id
|
165
|
-
# @option opts [String] :seller_note
|
166
|
-
# @option opts [Struct, Hash] :seller_order_attributes
|
167
|
+
# @see https://payments.amazon.com/documentation/apireference/201752060
|
168
|
+
# @param [String] amazon_capture_id
|
167
169
|
# @return [Peddler::XMLParser]
|
168
|
-
def
|
169
|
-
operation('
|
170
|
-
.add(
|
171
|
-
'AmazonOrderReferenceId' => amazon_order_reference_id,
|
172
|
-
'OrderReferenceAttributes' => opts.update('OrderTotal' => order_total)
|
173
|
-
)
|
170
|
+
def get_capture_details(amazon_capture_id)
|
171
|
+
operation('GetCaptureDetails')
|
172
|
+
.add('AmazonCaptureId' => amazon_capture_id)
|
174
173
|
|
175
174
|
run
|
176
175
|
end
|
177
176
|
|
178
177
|
# Returns details about the Order Reference object and its current state
|
179
178
|
#
|
180
|
-
# @see
|
181
|
-
# @param
|
182
|
-
# @param
|
179
|
+
# @see https://payments.amazon.com/documentation/apireference/201751970
|
180
|
+
# @param [String] amazon_order_reference_id
|
181
|
+
# @param [Hash] opts
|
183
182
|
# @option opts [String] address_consent_token
|
184
183
|
# @return [Peddler::XMLParser]
|
185
184
|
def get_order_reference_details(amazon_order_reference_id, opts = {})
|
@@ -189,173 +188,175 @@ module MWS
|
|
189
188
|
run
|
190
189
|
end
|
191
190
|
|
192
|
-
#
|
193
|
-
# information has been set on the order reference
|
194
|
-
#
|
195
|
-
# @see http://docs.developer.amazonservices.com/en_US/off_amazon_payments/OffAmazonPayments_ConfirmOrderReference.html
|
196
|
-
# @param amazon_order_reference_id [String]
|
197
|
-
# @return [Peddler::XMLParser]
|
198
|
-
def confirm_order_reference(amazon_order_reference_id)
|
199
|
-
operation('ConfirmOrderReference')
|
200
|
-
.add('AmazonOrderReferenceId' => amazon_order_reference_id)
|
201
|
-
|
202
|
-
run
|
203
|
-
end
|
204
|
-
|
205
|
-
# Cancels a previously confirmed order reference
|
191
|
+
# Returns the status of a particular refund
|
206
192
|
#
|
207
|
-
# @see
|
208
|
-
# @param
|
209
|
-
# @param opts [Hash]
|
210
|
-
# @option opts [String] cancelation_reason
|
193
|
+
# @see https://payments.amazon.com/documentation/apireference/201752100
|
194
|
+
# @param [String] amazon_refund_id
|
211
195
|
# @return [Peddler::XMLParser]
|
212
|
-
def
|
213
|
-
operation('
|
214
|
-
.add(
|
196
|
+
def get_refund_details(amazon_refund_id)
|
197
|
+
operation('GetRefundDetails')
|
198
|
+
.add('AmazonRefundId' => amazon_refund_id)
|
215
199
|
|
216
200
|
run
|
217
201
|
end
|
218
202
|
|
219
|
-
#
|
220
|
-
# and that you do not expect to create any new authorizations on this
|
221
|
-
# order reference
|
203
|
+
# Gets the operational status of the API
|
222
204
|
#
|
223
|
-
# @see
|
224
|
-
# @param amazon_order_reference_id [String]
|
225
|
-
# @param opts [Hash]
|
226
|
-
# @option opts [String] closure_reason
|
205
|
+
# @see https://payments.amazon.com/documentation/apireference/201752110
|
227
206
|
# @return [Peddler::XMLParser]
|
228
|
-
def
|
229
|
-
operation('
|
230
|
-
.add(opts.update('AmazonOrderReferenceId' => amazon_order_reference_id))
|
231
|
-
|
207
|
+
def get_service_status
|
208
|
+
operation('GetServiceStatus')
|
232
209
|
run
|
233
210
|
end
|
234
211
|
|
235
|
-
#
|
236
|
-
# order reference
|
212
|
+
# Refunds a previously captured amount
|
237
213
|
#
|
238
|
-
# @see
|
239
|
-
# @param
|
240
|
-
# @param
|
241
|
-
# @param
|
242
|
-
# @param
|
243
|
-
# @option opts [String] :
|
244
|
-
# @option opts [Integer] :transaction_timeout
|
245
|
-
# @option opts [Boolean] :capture_now
|
214
|
+
# @see https://payments.amazon.com/documentation/apireference/201752080
|
215
|
+
# @param [String] amazon_capture_id
|
216
|
+
# @param [String] refund_reference_id
|
217
|
+
# @param [Struct, Hash] refund_amount
|
218
|
+
# @param [Hash] opts
|
219
|
+
# @option opts [String] :seller_refund_note
|
246
220
|
# @option opts [String] :soft_descriptor
|
247
221
|
# @return [Peddler::XMLParser]
|
248
|
-
def
|
249
|
-
operation('
|
222
|
+
def refund(amazon_capture_id, refund_reference_id, refund_amount, opts = {})
|
223
|
+
operation('Refund')
|
250
224
|
.add(opts.update(
|
251
|
-
'
|
252
|
-
'
|
253
|
-
'
|
225
|
+
'AmazonCaptureId' => amazon_capture_id,
|
226
|
+
'RefundReferenceId' => refund_reference_id,
|
227
|
+
'RefundAmount' => refund_amount
|
254
228
|
))
|
255
229
|
|
256
230
|
run
|
257
231
|
end
|
258
232
|
|
259
|
-
#
|
260
|
-
#
|
233
|
+
# Sets order reference details such as the order total and a description
|
234
|
+
# for the order
|
261
235
|
#
|
262
|
-
# @see
|
263
|
-
# @param
|
236
|
+
# @see https://payments.amazon.com/documentation/apireference/201751960
|
237
|
+
# @param [String] amazon_order_reference_id
|
238
|
+
# @param [Struct, Hash] order_total
|
239
|
+
# @param [Hash] opts
|
240
|
+
# @option opts [String] :platform_id
|
241
|
+
# @option opts [String] :seller_note
|
242
|
+
# @option opts [Struct, Hash] :seller_order_attributes
|
264
243
|
# @return [Peddler::XMLParser]
|
265
|
-
def
|
266
|
-
operation('
|
267
|
-
.add(
|
244
|
+
def set_order_reference_details(amazon_order_reference_id, order_total, opts = {})
|
245
|
+
operation('SetOrderReferenceDetails')
|
246
|
+
.add(
|
247
|
+
'AmazonOrderReferenceId' => amazon_order_reference_id,
|
248
|
+
'OrderReferenceAttributes' => opts.update('OrderTotal' => order_total)
|
249
|
+
)
|
268
250
|
|
269
251
|
run
|
270
252
|
end
|
271
253
|
|
272
|
-
#
|
254
|
+
# Reserves a specified amount against the payment method(s) stored in the
|
255
|
+
# billing agreement
|
273
256
|
#
|
274
|
-
# @see
|
275
|
-
# @param
|
276
|
-
# @param
|
277
|
-
# @param
|
278
|
-
# @param
|
279
|
-
# @option opts [String] :
|
257
|
+
# @see https://payments.amazon.com/documentation/apireference/201751940
|
258
|
+
# @param [String] amazon_billing_agreement_id
|
259
|
+
# @param [String] authorization_reference_id
|
260
|
+
# @param [Hash, Struct] authorization_amount
|
261
|
+
# @param [Hash] opts
|
262
|
+
# @option opts [String] :seller_authorization_note
|
263
|
+
# @option opts [Integer] :transaction_timeout
|
264
|
+
# @option opts [Boolean] :capture_now
|
280
265
|
# @option opts [String] :soft_descriptor
|
266
|
+
# @option opts [String] :seller_note
|
267
|
+
# @option opts [String] :platform_id
|
268
|
+
# @option opts [Hash, Struct] :seller_order_attributes
|
269
|
+
# @option opts [Boolean] :inherit_shipping_address
|
281
270
|
# @return [Peddler::XMLParser]
|
282
|
-
def
|
283
|
-
operation('
|
271
|
+
def authorize_on_billing_agreement(amazon_billing_agreement_id, authorization_reference_id, authorization_amount, opts = {})
|
272
|
+
operation('AuthorizeOnBillingAgreement')
|
284
273
|
.add(opts.update(
|
285
|
-
'
|
286
|
-
'
|
287
|
-
'
|
274
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id,
|
275
|
+
'AuthorizationReferenceId' => authorization_reference_id,
|
276
|
+
'AuthorizationAmount' => authorization_amount
|
288
277
|
))
|
289
278
|
|
290
279
|
run
|
291
280
|
end
|
292
281
|
|
293
|
-
#
|
294
|
-
#
|
282
|
+
# Confirms that you want to terminate the billing agreement with the buyer
|
283
|
+
# and that you do not expect to create any new order references or
|
284
|
+
# authorizations on this billing agreement
|
295
285
|
#
|
296
|
-
# @see
|
297
|
-
# @param
|
286
|
+
# @see https://payments.amazon.com/documentation/apireference/201751950
|
287
|
+
# @param [String] amazon_billing_agreement_id
|
288
|
+
# @param [Hash] opts
|
289
|
+
# @option opts [String] :closure_reason
|
298
290
|
# @return [Peddler::XMLParser]
|
299
|
-
def
|
300
|
-
operation('
|
301
|
-
.add(
|
291
|
+
def close_billing_agreement(amazon_billing_agreement_id, opts = {})
|
292
|
+
operation('CloseBillingAgreement')
|
293
|
+
.add(opts.update(
|
294
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
295
|
+
))
|
302
296
|
|
303
297
|
run
|
304
298
|
end
|
305
299
|
|
306
|
-
#
|
300
|
+
# Confirms that the billing agreement is free of constraints and all
|
301
|
+
# required information has been set on the billing agreement
|
307
302
|
#
|
308
|
-
# @see
|
309
|
-
# @param
|
310
|
-
# @param opts [Hash]
|
311
|
-
# @option opts [String] closure_reason
|
303
|
+
# @see https://payments.amazon.com/documentation/apireference/201751710
|
304
|
+
# @param [String] amazon_billing_agreement_id
|
312
305
|
# @return [Peddler::XMLParser]
|
313
|
-
def
|
314
|
-
operation('
|
315
|
-
.add(
|
306
|
+
def confirm_billing_agreement(amazon_billing_agreement_id)
|
307
|
+
operation('ConfirmBillingAgreement')
|
308
|
+
.add(
|
309
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
310
|
+
)
|
316
311
|
|
317
312
|
run
|
318
313
|
end
|
319
314
|
|
320
|
-
#
|
315
|
+
# Returns details about the Billing Agreement object and its current state
|
321
316
|
#
|
322
|
-
# @see
|
323
|
-
# @param
|
324
|
-
# @param
|
325
|
-
# @
|
326
|
-
# @param opts [Hash]
|
327
|
-
# @option opts [String] :seller_refund_note
|
328
|
-
# @option opts [String] :soft_descriptor
|
317
|
+
# @see https://payments.amazon.com/documentation/apireference/201751690
|
318
|
+
# @param [String] amazon_billing_agreement_id
|
319
|
+
# @param [Hash] opts
|
320
|
+
# @option opts [String] :address_consent_token
|
329
321
|
# @return [Peddler::XMLParser]
|
330
|
-
def
|
331
|
-
operation('
|
322
|
+
def get_billing_agreement_details(amazon_billing_agreement_id, opts = {})
|
323
|
+
operation('GetBillingAgreementDetails')
|
332
324
|
.add(opts.update(
|
333
|
-
'
|
334
|
-
'RefundReferenceId' => refund_reference_id,
|
335
|
-
'RefundAmount' => refund_amount
|
325
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
336
326
|
))
|
337
327
|
|
338
328
|
run
|
339
329
|
end
|
340
330
|
|
341
|
-
#
|
331
|
+
# Sets billing agreement details such as a description of the agreement
|
332
|
+
# and other information about the seller
|
342
333
|
#
|
343
|
-
# @see
|
344
|
-
# @param
|
334
|
+
# @see https://payments.amazon.com/documentation/apireference/201751700
|
335
|
+
# @param [String] amazon_billing_agreement_id
|
336
|
+
# @param [Struct, Hash] billing_agreement_attributes
|
345
337
|
# @return [Peddler::XMLParser]
|
346
|
-
def
|
347
|
-
operation('
|
348
|
-
.add(
|
338
|
+
def set_billing_agreement_details(amazon_billing_agreement_id, billing_agreement_attributes)
|
339
|
+
operation('SetBillingAgreementDetails')
|
340
|
+
.add(
|
341
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id,
|
342
|
+
'BillingAgreementAttributes' => billing_agreement_attributes
|
343
|
+
)
|
349
344
|
|
350
345
|
run
|
351
346
|
end
|
352
347
|
|
353
|
-
#
|
348
|
+
# Validates the status of the BillingAgreement object and the payment
|
349
|
+
# method associated with it
|
354
350
|
#
|
355
|
-
# @see
|
351
|
+
# @see https://payments.amazon.com/documentation/apireference/201751720
|
352
|
+
# @param [String] amazon_billing_agreement_id
|
356
353
|
# @return [Peddler::XMLParser]
|
357
|
-
def
|
358
|
-
operation('
|
354
|
+
def validate_billing_agreement(amazon_billing_agreement_id)
|
355
|
+
operation('ValidateBillingAgreement')
|
356
|
+
.add(
|
357
|
+
'AmazonBillingAgreementId' => amazon_billing_agreement_id
|
358
|
+
)
|
359
|
+
|
359
360
|
run
|
360
361
|
end
|
361
362
|
end
|