Class: IronBank::Resources::RatePlanCharge
- Inherits:
-
IronBank::Resource
- Object
- IronBank::Resource
- IronBank::Resources::RatePlanCharge
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/iron_bank/resources/rate_plan_charge.rb
Overview
A rate plan charge belongs to a subscription rate plan.
Instance Attribute Summary
Attributes inherited from IronBank::Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#price ⇒ Object
NOTE: #price was only available when (1) the pricing model for the charge is either “Flat Fee” or “Per Unit” AND (2) the charge was queried through ZOQL, i.e, using ‘IronBank::Charge#where` method.
- #rollover_balance ⇒ Object
Methods inherited from IronBank::Resource
#==, #id, #initialize, #inspect, object_name, #reload, #remove_instance_vars, with_cache, with_local_records
Methods included from Associations::ClassMethods
Methods included from Metadata
#excluded_fields, #fields, #query_custom_fields, #query_fields, #reset, #schema, #single_resource_query_fields, #with_schema
Methods included from Queryable
#all, #find, #find_each, #first, #where
Methods included from Associations
Constructor Details
This class inherits a constructor from IronBank::Resource
Class Method Details
.excluded_fields ⇒ Object
10 11 12 |
# File 'lib/iron_bank/resources/rate_plan_charge.rb', line 10 def self.excluded_fields super + single_resource_query_fields end |
.single_resource_query_fields ⇒ Object
14 15 16 |
# File 'lib/iron_bank/resources/rate_plan_charge.rb', line 14 def self.single_resource_query_fields %w[RolloverBalance Price] end |
Instance Method Details
#price ⇒ Object
NOTE: #price was only available when (1) the pricing model for the
charge is either "Flat Fee" or "Per Unit" AND (2) the charge was
queried through ZOQL, i.e, using `IronBank::Charge#where` method.
Testing Zuora REST API (using the `IronBank::Charge#find` method)
shows that Zuora does not return a `price` attribute in their
response. This means we consider #price to be a remain from the
SOAP ZOQL query operation. We are deprecating this method without
replacement. Instead, users should be fetching the `#tiers` for
the current charge and get the price information from there.
41 42 43 |
# File 'lib/iron_bank/resources/rate_plan_charge.rb', line 41 def price nil end |
#rollover_balance ⇒ Object
27 28 29 |
# File 'lib/iron_bank/resources/rate_plan_charge.rb', line 27 def rollover_balance remote[:rollover_balance] || reload.remote[:rollover_balance] end |