class PayPal::SDK::REST::DataTypes::Order

Public Class Methods

find(resource_id) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 924
def find(resource_id)
  raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
  path = "v1/payments/orders/#{resource_id}"
  self.new(api.get(path))
end
load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 903
def self.load_members
  object_of :id, String
  object_of :purchase_unit_reference_id, String # Deprecated - use :reference_id instead
  object_of :reference_id, String
  object_of :amount, Amount
  object_of :payment_mode, String
  object_of :state, String
  object_of :reason_code, String
  object_of :pending_reason, String
  object_of :protection_eligibility, String
  object_of :protection_eligibility_type, String
  object_of :parent_payment, String
  object_of :fmf_details, FmfDetails
  object_of :create_time, String
  object_of :update_time, String
  array_of  :links, Links
end

Public Instance Methods

authorize() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 945
def authorize()
  path = "v1/payments/orders/#{self.id}/authorize"
  response = api.post(path, self.to_hash, http_header)
  Authorization.new(response)
end
capture(capture) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 931
def capture(capture)
  capture = Capture.new(capture) unless capture.is_a? Capture
  path = "v1/payments/orders/#{self.id}/capture"
  response = api.post(path, capture.to_hash, http_header)
  Capture.new(response)
end
void() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 938
def void()
  path = "v1/payments/orders/#{self.id}/do-void"
  response = api.post(path, {}, http_header)
  self.merge!(response)
  success?
end