Class: MWS::OffAmazonPayments
- Inherits:
-
Peddler::Client
- Object
- Peddler::Client
- MWS::OffAmazonPayments
- Defined in:
- lib/mws/off_amazon_payments.rb
Overview
The Off-Amazon Payments API section is only applicable to payments made through the Login and Pay with Amazon service offered by Amazon Payments. You cannot use this API section to process payments for Amazon Marketplace, Amazon Webstore, or Checkout by Amazon.
The Off-Amazon Payments API helps you to process payments for purchases made by buyers on your website using the Login and Pay with Amazon service. This API enables you to programmatically retrieve shipping and payment information provided by the buyer from their Amazon account. It allows you to authorize, capture, and refund payments, enabling a variety of payments scenarios.
Constant Summary
Constants inherited from Peddler::Client
Peddler::Client::BadMarketplaceId, Peddler::Client::HOSTS
Instance Attribute Summary
Attributes inherited from Peddler::Client
#body, #marketplace_id, #merchant_id
Instance Method Summary collapse
-
#authorize(amazon_order_reference_id, authorization_reference_id, authorization_amount, opts = {}) ⇒ Peddler::XMLParser
Reserves a specified amount against the payment method(s) stored in the order reference.
-
#cancel_order_reference(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Cancels a previously confirmed order reference.
-
#capture(amazon_authorization_id, capture_reference_id, capture_amount, opts = {}) ⇒ Peddler::XMLParser
Captures funds from an authorized payment instrument.
-
#close_authorization(amazon_authorization_id, opts = {}) ⇒ Peddler::XMLParser
Closes an authorization.
-
#close_order_reference(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Confirms that an order reference has been fulfilled (fully or partially) and that you do not expect to create any new authorizations on this order reference.
-
#confirm_order_reference(amazon_order_reference_id) ⇒ Peddler::XMLParser
Confirms that the order reference is free of constraints and all required information has been set on the order reference.
-
#get_authorization_details(amazon_authorization_id) ⇒ Peddler::XMLParser
Returns the status of a particular authorization and the total amount captured on the authorization.
-
#get_capture_details(amazon_capture_id) ⇒ Peddler::XMLParser
Returns the status of a particular capture and the total amount refunded on the capture.
-
#get_order_reference_details(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Returns details about the Order Reference object and its current state.
-
#get_refund_details(amazon_refund_id) ⇒ Peddler::XMLParser
Returns the status of a particular refund.
-
#get_service_status ⇒ Peddler::XMLParser
Gets the operational status of the API.
-
#refund(amazon_capture_id, refund_reference_id, refund_amount, opts = {}) ⇒ Peddler::XMLParser
Refunds a previously captured amount.
-
#set_order_reference_details(amazon_order_reference_id, order_total, opts = {}) ⇒ Peddler::XMLParser
Sets order reference details such as the order total and a description for the order.
Methods inherited from Peddler::Client
#aws_endpoint, #headers, inherited, #operation, path, #run
Instance Method Details
#authorize(amazon_order_reference_id, authorization_reference_id, authorization_amount, opts = {}) ⇒ Peddler::XMLParser
Reserves a specified amount against the payment method(s) stored in the order reference
109 110 111 112 113 114 115 116 117 118 |
# File 'lib/mws/off_amazon_payments.rb', line 109 def (amazon_order_reference_id, , , opts = {}) operation('Authorize') .add(opts.merge( 'AmazonOrderReferenceId' => amazon_order_reference_id, 'AuthorizationReferenceId' => , 'AuthorizationAmount' => )) run end |
#cancel_order_reference(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Cancels a previously confirmed order reference
73 74 75 76 77 78 |
# File 'lib/mws/off_amazon_payments.rb', line 73 def cancel_order_reference(amazon_order_reference_id, opts = {}) operation('CancelOrderReference') .add(opts.merge('AmazonOrderReferenceId' => amazon_order_reference_id)) run end |
#capture(amazon_authorization_id, capture_reference_id, capture_amount, opts = {}) ⇒ Peddler::XMLParser
Captures funds from an authorized payment instrument
143 144 145 146 147 148 149 150 151 152 |
# File 'lib/mws/off_amazon_payments.rb', line 143 def capture(, capture_reference_id, capture_amount, opts = {}) operation('Capture') .add(opts.merge( 'AmazonAuthorizationId' => , 'CaptureReferenceId' => capture_reference_id, 'CaptureAmount' => capture_amount )) run end |
#close_authorization(amazon_authorization_id, opts = {}) ⇒ Peddler::XMLParser
Closes an authorization
174 175 176 177 178 179 |
# File 'lib/mws/off_amazon_payments.rb', line 174 def (, opts = {}) operation('CloseAuthorization') .add(opts.merge('AmazonAuthorizationId' => )) run end |
#close_order_reference(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Confirms that an order reference has been fulfilled (fully or partially) and that you do not expect to create any new authorizations on this order reference
89 90 91 92 93 94 |
# File 'lib/mws/off_amazon_payments.rb', line 89 def close_order_reference(amazon_order_reference_id, opts = {}) operation('CloseOrderReference') .add(opts.merge('AmazonOrderReferenceId' => amazon_order_reference_id)) run end |
#confirm_order_reference(amazon_order_reference_id) ⇒ Peddler::XMLParser
Confirms that the order reference is free of constraints and all required information has been set on the order reference
59 60 61 62 63 64 |
# File 'lib/mws/off_amazon_payments.rb', line 59 def confirm_order_reference(amazon_order_reference_id) operation('ConfirmOrderReference') .add('AmazonOrderReferenceId' => amazon_order_reference_id) run end |
#get_authorization_details(amazon_authorization_id) ⇒ Peddler::XMLParser
Returns the status of a particular authorization and the total amount captured on the authorization
126 127 128 129 130 131 |
# File 'lib/mws/off_amazon_payments.rb', line 126 def () operation('GetAuthorizationDetails') .add('AmazonAuthorizationId' => ) run end |
#get_capture_details(amazon_capture_id) ⇒ Peddler::XMLParser
Returns the status of a particular capture and the total amount refunded on the capture
160 161 162 163 164 165 |
# File 'lib/mws/off_amazon_payments.rb', line 160 def get_capture_details(amazon_capture_id) operation('GetAuthorizationDetails') .add('AmazonCaptureId' => amazon_capture_id) run end |
#get_order_reference_details(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Returns details about the Order Reference object and its current state
46 47 48 49 50 51 |
# File 'lib/mws/off_amazon_payments.rb', line 46 def get_order_reference_details(amazon_order_reference_id, opts = {}) operation('GetOrderReferenceDetails') .add(opts.merge('AmazonOrderReferenceId' => amazon_order_reference_id)) run end |
#get_refund_details(amazon_refund_id) ⇒ Peddler::XMLParser
Returns the status of a particular refund
207 208 209 210 211 212 |
# File 'lib/mws/off_amazon_payments.rb', line 207 def get_refund_details(amazon_refund_id) operation('GetRefundDetails') .add('AmazonRefundId' => 'amazon_refund_id') run end |
#get_service_status ⇒ Peddler::XMLParser
Gets the operational status of the API
218 219 220 221 |
# File 'lib/mws/off_amazon_payments.rb', line 218 def get_service_status operation('GetServiceStatus') run end |
#refund(amazon_capture_id, refund_reference_id, refund_amount, opts = {}) ⇒ Peddler::XMLParser
Refunds a previously captured amount
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/mws/off_amazon_payments.rb', line 191 def refund(amazon_capture_id, refund_reference_id, refund_amount, opts ={}) operation('Refund') .add(opts.merge( 'AmazonCaptureId' => amazon_capture_id, 'RefundReferenceId' => refund_reference_id, 'RefundAmount' => refund_amount )) run end |
#set_order_reference_details(amazon_order_reference_id, order_total, opts = {}) ⇒ Peddler::XMLParser
Sets order reference details such as the order total and a description for the order
29 30 31 32 33 34 35 36 37 |
# File 'lib/mws/off_amazon_payments.rb', line 29 def set_order_reference_details(amazon_order_reference_id, order_total, opts = {}) operation('SetOrderReferenceDetails') .add( 'AmazonOrderReferenceId' => amazon_order_reference_id, 'OrderReferenceAttributes' => opts.merge('OrderTotal' => order_total) ) run end |