Class: SolidusPaypalCommercePlatform::PayPalCheckoutSdk::Payments::CapturesRefundRequest
- Inherits:
-
Object
- Object
- SolidusPaypalCommercePlatform::PayPalCheckoutSdk::Payments::CapturesRefundRequest
- Defined in:
- lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb
Overview
Refunds a captured payment, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an amount
object in the JSON request body.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#path ⇒ Object
Returns the value of attribute path.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(capture_id) ⇒ CapturesRefundRequest
constructor
A new instance of CapturesRefundRequest.
- #pay_pal_request_id(pay_pal_request_id) ⇒ Object
- #prefer(prefer) ⇒ Object
- #request_body(refund_request) ⇒ Object
Constructor Details
#initialize(capture_id) ⇒ CapturesRefundRequest
Returns a new instance of CapturesRefundRequest.
19 20 21 22 23 24 25 26 27 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 19 def initialize(capture_id) @headers = {} @body = nil @verb = "POST" @path = "/v2/payments/captures/{capture_id}/refund?" @path = @path.gsub("{capture_id}", CGI.escape(capture_id.to_s)) @headers["Content-Type"] = "application/json" end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
17 18 19 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 17 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
17 18 19 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 17 def headers @headers end |
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 17 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
17 18 19 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 17 def verb @verb end |
Instance Method Details
#pay_pal_request_id(pay_pal_request_id) ⇒ Object
29 30 31 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 29 def pay_pal_request_id(pay_pal_request_id) @headers["PayPal-Request-Id"] = pay_pal_request_id end |
#prefer(prefer) ⇒ Object
33 34 35 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 33 def prefer(prefer) @headers["Prefer"] = prefer end |
#request_body(refund_request) ⇒ Object
37 38 39 |
# File 'lib/solidus_paypal_commerce_platform/paypal_checkout_sdk/payments/captures_refund_request.rb', line 37 def request_body(refund_request) @body = refund_request end |