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.
- #fullfillment_should_stop_at ⇒ Object
- #provides_credits? ⇒ Boolean
Instance Method Details
#credit_subscription_plan ⇒ Object
Identify the usage_credits plan object
44 45 46 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 44 def credit_subscription_plan @credit_subscription_plan ||= UsageCredits.configuration.find_subscription_plan_by_processor_id(processor_plan) end |
#fullfillment_should_stop_at ⇒ Object
52 53 54 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 52 def fullfillment_should_stop_at (ends_at || current_period_end) end |
#provides_credits? ⇒ Boolean
48 49 50 |
# File 'lib/usage_credits/models/concerns/pay_subscription_extension.rb', line 48 def provides_credits? credit_subscription_plan.present? end |