Module: UsageCredits::PaySubscriptionExtension
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/usage_credits/models/concerns/pay_subscription_extension.rb
Overview
If the subscription is trialing or active, do immediate awarding and create a Fulfillment for future recurring awarding.
Instance Method Summary collapse
-
#credit_subscription_plan ⇒ Object
Identify the usage_credits plan object NOTE: Not memoized because processor_plan can change, and we need the current value.
- #fulfillment_should_stop_at ⇒ Object
- #provides_credits? ⇒ Boolean
Instance Method Details
#credit_subscription_plan ⇒ Object
Identify the usage_credits plan object NOTE: Not memoized because processor_plan can change, and we need the current value
45 46 47 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 45 def credit_subscription_plan UsageCredits.configuration.find_subscription_plan_by_processor_id(processor_plan) end |
#fulfillment_should_stop_at ⇒ Object
53 54 55 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 53 def fulfillment_should_stop_at (ends_at || current_period_end) end |
#provides_credits? ⇒ Boolean
49 50 51 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 49 def provides_credits? credit_subscription_plan.present? end |