class PayPal::SDK::REST::DataTypes::Plan

Public Class Methods

all(options = {}) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2117
def all(options = {})
  path = "v1/payments/billing-plans/"
  PlanList.new(api.get(path, options))
end
find(resource_id) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2111
def find(resource_id)
  raise ArgumentError.new("id required") if resource_id.to_s.strip.empty?
  path = "v1/payments/billing-plans/#{resource_id}"
  self.new(api.get(path))
end
load_members() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2076
def self.load_members
  object_of :id, String
  object_of :name, String
  object_of :description, String
  object_of :type, String
  object_of :state, String
  object_of :create_time, String
  object_of :update_time, String
  array_of  :payment_definitions, PaymentDefinition
  array_of  :terms, Terms
  object_of :merchant_preferences, MerchantPreferences
  array_of  :links, Links
end

Public Instance Methods

create() click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2092
def create()
  path = "v1/payments/billing-plans/"
  response = api.post(path, self.to_hash, http_header)
  self.merge!(response)
  success?
end
update(patch) click to toggle source
# File lib/paypal-sdk/rest/data_types.rb, line 2099
def update(patch)
  patch = Patch.new(patch) unless patch.is_a? Patch
  patch_request = Array.new(1, patch.to_hash)
  path = "v1/payments/billing-plans/#{self.id}"
  response = api.patch(path, patch_request, http_header)
  self.merge!(response)
  success?
end