Class: PayPalCheckoutSdk::Payments::AuthorizationsCaptureRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb

Overview

Captures an authorized payment, by ID.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_id) ⇒ AuthorizationsCaptureRequest

Returns a new instance of AuthorizationsCaptureRequest.



13
14
15
16
17
18
19
20
21
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 13

def initialize(authorization_id)
  @headers = {}
  @body = nil
  @verb = "POST"
  @path = "/v2/payments/authorizations/{authorization_id}/capture?"

  @path = @path.gsub("{authorization_id}", CGI.escape(authorization_id.to_s))
  @headers["Content-Type"] = "application/json"
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



11
12
13
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 11

def body
  @body
end

#headersObject

Returns the value of attribute headers.



11
12
13
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 11

def headers
  @headers
end

#pathObject

Returns the value of attribute path.



11
12
13
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 11

def path
  @path
end

#verbObject

Returns the value of attribute verb.



11
12
13
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 11

def verb
  @verb
end

Instance Method Details

#pay_pal_request_id(pay_pal_request_id) ⇒ Object



23
24
25
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 23

def pay_pal_request_id(pay_pal_request_id)
  @headers["PayPal-Request-Id"] = pay_pal_request_id
end

#prefer(prefer) ⇒ Object



27
28
29
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 27

def prefer(prefer)
  @headers["Prefer"] = prefer
end

#request_body(capture) ⇒ Object



31
32
33
# File 'lib/paypal/paypal_checkout_sdk/payments/authorizations_capture_request.rb', line 31

def request_body(capture)
  @body = capture
end