Class: Nombaone::Resources::PlanPrices
- Inherits:
-
BaseResource
- Object
- BaseResource
- Nombaone::Resources::PlanPrices
- Defined in:
- lib/nombaone/resources/plans.rb,
sig/nombaone/resources.rbs
Overview
Prices nested under a plan (create/list); reach nombaone.prices for
reads and deactivation.
Instance Method Summary collapse
-
#create(plan_id, unit_amount_in_kobo:, interval:, interval_count: OMIT, usage_type: OMIT, billing_scheme: OMIT, trial_period_days: OMIT, metadata: OMIT, request_options: {}) ⇒ NombaObject
Create a price under a plan.
-
#list(plan_id, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List a plan's prices, newest first.
Methods inherited from BaseResource
#encode, #initialize, #request, #request_page
Constructor Details
This class inherits a constructor from Nombaone::Resources::BaseResource
Instance Method Details
#create(plan_id, unit_amount_in_kobo:, interval:, interval_count: OMIT, usage_type: OMIT, billing_scheme: OMIT, trial_period_days: OMIT, metadata: OMIT, request_options: {}) ⇒ NombaObject
Create a price under a plan. Prices are immutable once created.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/nombaone/resources/plans.rb', line 24 def create(plan_id, unit_amount_in_kobo:, interval:, interval_count: OMIT, usage_type: OMIT, billing_scheme: OMIT, trial_period_days: OMIT, metadata: OMIT, request_options: {}) request(:post, "/plans/#{encode(plan_id)}/prices", body: { unit_amount_in_kobo: unit_amount_in_kobo, interval: interval, interval_count: interval_count, usage_type: usage_type, billing_scheme: billing_scheme, trial_period_days: trial_period_days, metadata: , }, options: ) end |
#list(plan_id, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>
List a plan's prices, newest first.
46 47 48 49 |
# File 'lib/nombaone/resources/plans.rb', line 46 def list(plan_id, limit: OMIT, cursor: OMIT, request_options: {}) request_page("/plans/#{encode(plan_id)}/prices", query: { limit: limit, cursor: cursor }, options: ) end |