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

Instance Method Details

#activate(plan_id, query: nil, body: nil, headers: nil) ⇒ Response

Activate plan

Parameters:

  • plan_id (String)

    Plan ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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.

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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

Parameters:

  • plan_id (String)

    Plan ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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

Parameters:

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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

Parameters:

  • plan_id (String)

    Plan ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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

Parameters:

  • plan_id (String)

    Plan ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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

Parameters:

  • plan_id (String)

    Plan ID

  • query (Hash, nil) (defaults to: nil)

    Request query parameters

  • body (Hash, nil) (defaults to: nil)

    Request body parameters

  • headers (Hash, nil) (defaults to: nil)

    Request headers

Returns:

See Also:



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