class PayPal::SDK::Subscriptions::Plan
v1/billing/plans
Public Class Methods
all(options = {})
click to toggle source
options include 'page', 'page_size', and 'total_required'
# File lib/paypal-sdk/subscriptions/plan.rb, line 85 def all(options = {}) Page.new(api.get(path, options)) end
path(resource_id = nil)
click to toggle source
# File lib/paypal-sdk/subscriptions/plan.rb, line 80 def path(resource_id = nil) "v1/billing/plans/#{resource_id}" end
Public Instance Methods
activate()
click to toggle source
# File lib/paypal-sdk/subscriptions/plan.rb, line 51 def activate commit("#{path(id)}/activate") end
deactivate()
click to toggle source
# File lib/paypal-sdk/subscriptions/plan.rb, line 56 def deactivate commit("#{path(id)}/deactivate") end
reload()
click to toggle source
# File lib/paypal-sdk/subscriptions/plan.rb, line 90 def reload merge! api.get(self.class.path id) success? end
update(patch)
click to toggle source
developer.paypal.com/docs/api/subscriptions/v1/#plans_patch patch [Hash] { op: 'replace', path: , value: } path = [description|payment_preferences.auto_bill_outstanding|taxes.percentage|payment_preferences.payment_failure_threshold]
Calls superclass method
# File lib/paypal-sdk/subscriptions/plan.rb, line 41 def update(patch) super end
update_pricing(*schemes)
click to toggle source
# File lib/paypal-sdk/subscriptions/plan.rb, line 45 def update_pricing(*schemes) payload = { pricing_schemes: schemes.map(&:to_hash) } commit("#{path(id)}/update-pricing-schemes", payload) end