Class: PayPalCheckoutSdk::Orders::OrdersCaptureRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/orders/orders_capture_request.rb

Overview

Captures a payment for an order.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order_id) ⇒ OrdersCaptureRequest

Returns a new instance of OrdersCaptureRequest.


18
19
20
21
22
23
24
25
26
# File 'lib/orders/orders_capture_request.rb', line 18

def initialize(order_id)
  @headers = {}
  @body = nil
  @verb = "POST"
  @path = "/v2/checkout/orders/{order_id}/capture?"

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body


16
17
18
# File 'lib/orders/orders_capture_request.rb', line 16

def body
  @body
end

#headersObject

Returns the value of attribute headers


16
17
18
# File 'lib/orders/orders_capture_request.rb', line 16

def headers
  @headers
end

#pathObject

Returns the value of attribute path


16
17
18
# File 'lib/orders/orders_capture_request.rb', line 16

def path
  @path
end

#verbObject

Returns the value of attribute verb


16
17
18
# File 'lib/orders/orders_capture_request.rb', line 16

def verb
  @verb
end

Instance Method Details

#pay_pal_client_metadata_id(pay_pal_client_metadata_id) ⇒ Object


28
29
30
# File 'lib/orders/orders_capture_request.rb', line 28

def ()
  @headers["PayPal-Client-Metadata-Id"] = 
end

#pay_pal_request_id(pay_pal_request_id) ⇒ Object


32
33
34
# File 'lib/orders/orders_capture_request.rb', line 32

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

#prefer(prefer) ⇒ Object


36
37
38
# File 'lib/orders/orders_capture_request.rb', line 36

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

#request_body(orderActionRequest) ⇒ Object


40
41
42
# File 'lib/orders/orders_capture_request.rb', line 40

def request_body(orderActionRequest)
  @body = orderActionRequest
end