Class: PayPalCheckoutSdk::Orders::OrdersCreateRequest

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

Overview

Creates an order. Supports only orders with one purchase unit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrdersCreateRequest

Returns a new instance of OrdersCreateRequest.


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

def initialize()
  @headers = {}
  @body = nil
  @verb = "POST"
  @path = "/v2/checkout/orders?"
  @headers["Content-Type"] = "application/json"
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body


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

def body
  @body
end

#headersObject

Returns the value of attribute headers


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

def headers
  @headers
end

#pathObject

Returns the value of attribute path


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

def path
  @path
end

#verbObject

Returns the value of attribute verb


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

def verb
  @verb
end

Instance Method Details

#pay_pal_partner_attribution_id(pay_pal_partner_attribution_id) ⇒ Object


26
27
28
# File 'lib/orders/orders_create_request.rb', line 26

def pay_pal_partner_attribution_id(pay_pal_partner_attribution_id)
  @headers["PayPal-Partner-Attribution-Id"] = pay_pal_partner_attribution_id
end

#prefer(prefer) ⇒ Object


30
31
32
# File 'lib/orders/orders_create_request.rb', line 30

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

#request_body(order) ⇒ Object


34
35
36
# File 'lib/orders/orders_create_request.rb', line 34

def request_body(order)
  @body = order
end