Class: MWS::OffAmazonPayments::Client
- Inherits:
-
Peddler::Client
- Object
- Peddler::Client
- MWS::OffAmazonPayments::Client
- Defined in:
- lib/mws/off_amazon_payments/client.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.
Instance Attribute Summary
Attributes inherited from Peddler::Client
#auth_token, #body, #marketplace, #merchant_id, #path
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.
-
#authorize_on_billing_agreement(amazon_billing_agreement_id, authorization_reference_id, authorization_amount, opts = {}) ⇒ Peddler::XMLParser
Reserves a specified amount against the payment method(s) stored in the billing agreement.
-
#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_billing_agreement(amazon_billing_agreement_id, opts = {}) ⇒ Peddler::XMLParser
Confirms that you want to terminate the billing agreement with the buyer and that you do not expect to create any new order references or authorizations on this billing agreement.
-
#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_billing_agreement(amazon_billing_agreement_id) ⇒ Peddler::XMLParser
Confirms that the billing agreement is free of constraints and all required information has been set on the billing agreement.
-
#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.
-
#create_order_reference_for_id(id, id_type, opts = {}) ⇒ Peddler::XMLParser
Creates an order reference for the given object.
-
#get_authorization_details(amazon_authorization_id) ⇒ Peddler::XMLParser
Returns the status of a particular authorization and the total amount captured on the authorization.
-
#get_billing_agreement_details(amazon_billing_agreement_id, opts = {}) ⇒ Peddler::XMLParser
Returns details about the Billing Agreement object and its current state.
-
#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.
-
#sandbox ⇒ self
Switches the client to the sandbox environment.
-
#set_billing_agreement_details(amazon_billing_agreement_id, billing_agreement_attributes) ⇒ Peddler::XMLParser
Sets billing agreement details such as a description of the agreement and other information about the seller.
-
#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.
-
#validate_billing_agreement(amazon_billing_agreement_id) ⇒ Peddler::XMLParser
Validates the status of the BillingAgreement object and the payment method associated with it.
Methods inherited from Peddler::Client
#aws_endpoint, #defaults, #headers, #initialize, #operation, #run
Constructor Details
This class inherits a constructor from Peddler::Client
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
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/mws/off_amazon_payments/client.rb', line 44 def (amazon_order_reference_id, , , opts = {}) operation('Authorize') .add(opts) .add('AmazonOrderReferenceId' => amazon_order_reference_id, 'AuthorizationReferenceId' => , 'AuthorizationAmount' => ) run end |
#authorize_on_billing_agreement(amazon_billing_agreement_id, authorization_reference_id, authorization_amount, opts = {}) ⇒ Peddler::XMLParser
Reserves a specified amount against the payment method(s) stored in the billing agreement
275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/mws/off_amazon_payments/client.rb', line 275 def (amazon_billing_agreement_id, , , opts = {}) operation('AuthorizeOnBillingAgreement') .add(opts) .add('AmazonBillingAgreementId' => amazon_billing_agreement_id, 'AuthorizationReferenceId' => , 'AuthorizationAmount' => ) run end |
#cancel_order_reference(amazon_order_reference_id, opts = {}) ⇒ Peddler::XMLParser
Cancels a previously confirmed order reference
62 63 64 65 66 67 68 |
# File 'lib/mws/off_amazon_payments/client.rb', line 62 def cancel_order_reference(amazon_order_reference_id, opts = {}) operation('CancelOrderReference') .add(opts) .add('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
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mws/off_amazon_payments/client.rb', line 80 def capture(, capture_reference_id, capture_amount, opts = {}) operation('Capture') .add(opts) .add('AmazonAuthorizationId' => , 'CaptureReferenceId' => capture_reference_id, 'CaptureAmount' => capture_amount) run end |
#close_authorization(amazon_authorization_id, opts = {}) ⇒ Peddler::XMLParser
Closes an authorization
98 99 100 101 102 103 104 |
# File 'lib/mws/off_amazon_payments/client.rb', line 98 def (, opts = {}) operation('CloseAuthorization') .add(opts) .add('AmazonAuthorizationId' => ) run end |
#close_billing_agreement(amazon_billing_agreement_id, opts = {}) ⇒ Peddler::XMLParser
Confirms that you want to terminate the billing agreement with the buyer and that you do not expect to create any new order references or authorizations on this billing agreement
296 297 298 299 300 301 302 |
# File 'lib/mws/off_amazon_payments/client.rb', line 296 def close_billing_agreement(amazon_billing_agreement_id, opts = {}) operation('CloseBillingAgreement') .add(opts) .add('AmazonBillingAgreementId' => amazon_billing_agreement_id) 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
115 116 117 118 119 120 121 |
# File 'lib/mws/off_amazon_payments/client.rb', line 115 def close_order_reference(amazon_order_reference_id, opts = {}) operation('CloseOrderReference') .add(opts) .add('AmazonOrderReferenceId' => amazon_order_reference_id) run end |
#confirm_billing_agreement(amazon_billing_agreement_id) ⇒ Peddler::XMLParser
Confirms that the billing agreement is free of constraints and all required information has been set on the billing agreement
310 311 312 313 314 315 |
# File 'lib/mws/off_amazon_payments/client.rb', line 310 def confirm_billing_agreement(amazon_billing_agreement_id) operation('ConfirmBillingAgreement') .add('AmazonBillingAgreementId' => amazon_billing_agreement_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
129 130 131 132 133 134 |
# File 'lib/mws/off_amazon_payments/client.rb', line 129 def confirm_order_reference(amazon_order_reference_id) operation('ConfirmOrderReference') .add('AmazonOrderReferenceId' => amazon_order_reference_id) run end |
#create_order_reference_for_id(id, id_type, opts = {}) ⇒ Peddler::XMLParser
Creates an order reference for the given object
146 147 148 149 150 151 152 |
# File 'lib/mws/off_amazon_payments/client.rb', line 146 def create_order_reference_for_id(id, id_type, opts = {}) operation('CreateOrderReferenceForId') .add(opts) .add('Id' => id, 'IdType' => id_type) 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
160 161 162 163 164 165 |
# File 'lib/mws/off_amazon_payments/client.rb', line 160 def () operation('GetAuthorizationDetails') .add('AmazonAuthorizationId' => ) run end |
#get_billing_agreement_details(amazon_billing_agreement_id, opts = {}) ⇒ Peddler::XMLParser
Returns details about the Billing Agreement object and its current state
324 325 326 327 328 329 330 |
# File 'lib/mws/off_amazon_payments/client.rb', line 324 def get_billing_agreement_details(amazon_billing_agreement_id, opts = {}) operation('GetBillingAgreementDetails') .add(opts) .add('AmazonBillingAgreementId' => amazon_billing_agreement_id) 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
173 174 175 176 177 178 |
# File 'lib/mws/off_amazon_payments/client.rb', line 173 def get_capture_details(amazon_capture_id) operation('GetCaptureDetails') .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
187 188 189 190 191 192 193 |
# File 'lib/mws/off_amazon_payments/client.rb', line 187 def get_order_reference_details(amazon_order_reference_id, opts = {}) operation('GetOrderReferenceDetails') .add(opts) .add('AmazonOrderReferenceId' => amazon_order_reference_id) run end |
#get_refund_details(amazon_refund_id) ⇒ Peddler::XMLParser
Returns the status of a particular refund
200 201 202 203 204 205 |
# File 'lib/mws/off_amazon_payments/client.rb', line 200 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
211 212 213 214 |
# File 'lib/mws/off_amazon_payments/client.rb', line 211 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
226 227 228 229 230 231 232 233 234 235 |
# File 'lib/mws/off_amazon_payments/client.rb', line 226 def refund(amazon_capture_id, refund_reference_id, refund_amount, opts = {}) operation('Refund') .add(opts) .add('AmazonCaptureId' => amazon_capture_id, 'RefundReferenceId' => refund_reference_id, 'RefundAmount' => refund_amount) run end |
#sandbox ⇒ self
Switches the client to the sandbox environment
26 27 28 29 |
# File 'lib/mws/off_amazon_payments/client.rb', line 26 def sandbox self.path = "/OffAmazonPayments_Sandbox/#{version}/" self end |
#set_billing_agreement_details(amazon_billing_agreement_id, billing_agreement_attributes) ⇒ Peddler::XMLParser
Sets billing agreement details such as a description of the agreement and other information about the seller
339 340 341 342 343 344 345 346 |
# File 'lib/mws/off_amazon_payments/client.rb', line 339 def set_billing_agreement_details(amazon_billing_agreement_id, billing_agreement_attributes) operation('SetBillingAgreementDetails') .add('AmazonBillingAgreementId' => amazon_billing_agreement_id, 'BillingAgreementAttributes' => billing_agreement_attributes) 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
248 249 250 251 252 253 254 255 256 |
# File 'lib/mws/off_amazon_payments/client.rb', line 248 def set_order_reference_details(amazon_order_reference_id, order_total, opts = {}) order_reference_attributes = opts.update('OrderTotal' => order_total) operation('SetOrderReferenceDetails') .add('AmazonOrderReferenceId' => amazon_order_reference_id, 'OrderReferenceAttributes' => order_reference_attributes) run end |
#validate_billing_agreement(amazon_billing_agreement_id) ⇒ Peddler::XMLParser
Validates the status of the BillingAgreement object and the payment method associated with it
354 355 356 357 358 359 |
# File 'lib/mws/off_amazon_payments/client.rb', line 354 def validate_billing_agreement(amazon_billing_agreement_id) operation('ValidateBillingAgreement') .add('AmazonBillingAgreementId' => amazon_billing_agreement_id) run end |