Class: PayPalCheckoutSdk::Orders::OrdersCreateRequest
- Inherits:
-
Object
- Object
- PayPalCheckoutSdk::Orders::OrdersCreateRequest
- Defined in:
- lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb
Overview
Creates an order. Supports only orders with one purchase unit.
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 ⇒ OrdersCreateRequest
constructor
A new instance of OrdersCreateRequest.
- #pay_pal_partner_attribution_id(pay_pal_partner_attribution_id) ⇒ Object
- #prefer(prefer) ⇒ Object
- #request_body(order) ⇒ Object
Constructor Details
#initialize ⇒ OrdersCreateRequest
Returns a new instance of OrdersCreateRequest.
13 14 15 16 17 18 19 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 13 def initialize @headers = {} @body = nil @verb = "POST" @path = "/v2/checkout/orders?" @headers["Content-Type"] = "application/json" end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
11 12 13 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 11 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
11 12 13 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 11 def headers @headers end |
#path ⇒ Object
Returns the value of attribute path.
11 12 13 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 11 def path @path end |
#verb ⇒ Object
Returns the value of attribute verb.
11 12 13 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 11 def verb @verb end |
Instance Method Details
#pay_pal_partner_attribution_id(pay_pal_partner_attribution_id) ⇒ Object
21 22 23 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 21 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
25 26 27 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 25 def prefer(prefer) @headers["Prefer"] = prefer end |
#request_body(order) ⇒ Object
29 30 31 |
# File 'lib/paypal/paypal_checkout_sdk/orders/orders_create_request.rb', line 29 def request_body(order) @body = order end |