Module: PaypalAPI::SubscriptionPlans::APIs
- Included in:
- PaypalAPI::SubscriptionPlans, PaypalAPI::SubscriptionPlans
- Defined in:
- lib/paypal-api/api_collections/subscription_plans.rb
Overview
Common methods for PaypalAPI::SubscriptionPlans class and client.subscription_plans instance
Instance Method Summary collapse
-
#activate(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Activate plan.
-
#create(query: nil, body: nil, headers: nil) ⇒ Response
Creates a plan that defines pricing and billing cycle details for subscriptions.
-
#deactivate(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Deactivate plan.
-
#list(query: nil, body: nil, headers: nil) ⇒ Response
List plans.
-
#show(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Show plan details.
-
#update(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Update plan.
-
#update_pricing(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Update pricing.
Instance Method Details
#activate(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Activate plan
74 75 76 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 74 def activate(plan_id, query: nil, body: nil, headers: nil) client.post("/v1/billing/plans/#{encode(plan_id)}/activate", query: query, body: body, headers: headers) end |
#create(query: nil, body: nil, headers: nil) ⇒ Response
Creates a plan that defines pricing and billing cycle details for subscriptions.
27 28 29 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 27 def create(query: nil, body: nil, headers: nil) client.post("/v1/billing/plans", query: query, body: body, headers: headers) end |
#deactivate(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Deactivate plan
86 87 88 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 86 def deactivate(plan_id, query: nil, body: nil, headers: nil) client.post("/v1/billing/plans/#{encode(plan_id)}/deactivate", query: query, body: body, headers: headers) end |
#list(query: nil, body: nil, headers: nil) ⇒ Response
List plans
38 39 40 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 38 def list(query: nil, body: nil, headers: nil) client.get("/v1/billing/plans", query: query, body: body, headers: headers) end |
#show(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Show plan details
50 51 52 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 50 def show(plan_id, query: nil, body: nil, headers: nil) client.get("/v1/billing/plans/#{encode(plan_id)}", query: query, body: body, headers: headers) end |
#update(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Update plan
62 63 64 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 62 def update(plan_id, query: nil, body: nil, headers: nil) client.patch("/v1/billing/plans/#{encode(plan_id)}", query: query, body: body, headers: headers) end |
#update_pricing(plan_id, query: nil, body: nil, headers: nil) ⇒ Response
Update pricing
98 99 100 |
# File 'lib/paypal-api/api_collections/subscription_plans.rb', line 98 def update_pricing(plan_id, query: nil, body: nil, headers: nil) client.post("/v1/billing/plans/#{encode(plan_id)}/update-pricing-schemes", query: query, body: body, headers: headers) end |