remove trial buffer
This commit is contained in:
parent
0fe8ac3330
commit
57c3217768
|
|
@ -2863,15 +2863,20 @@ module JamRuby
|
|||
end
|
||||
|
||||
def has_support?
|
||||
return false if (!subscription_trial_ended? || subscription_sync_code == 'in_trial') && recurly_subscription_id.nil?
|
||||
# early exit if in trial (excepting credit card and no Admin Override)
|
||||
return false if (!subscription_trial_ended? || subscription_sync_code == 'in_trial') &&
|
||||
recurly_subscription_id.nil? &&
|
||||
admin_override_plan_code.nil?
|
||||
|
||||
# let admins test feature without subscription
|
||||
return true if admin
|
||||
|
||||
# if still in trial, use their desired plan rather than actual plan, because actual will always say gold while in trial
|
||||
if !subscription_trial_ended? || subscription_sync_code == 'in_trial'
|
||||
SubscriptionDefinitions.rules(self.desired_plan_code)[:has_support]
|
||||
else
|
||||
SubscriptionDefinitions.rules(self.subscription_plan_code)[:has_support]
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
def subscription_rules(dynamic_definitions = true)
|
||||
|
|
|
|||
|
|
@ -511,16 +511,6 @@ module JamRuby
|
|||
return
|
||||
end
|
||||
|
||||
# if the trial has ended, but it was within 2 days of ending the trial date, give the user some leeway
|
||||
if user.subscription_trial_ended? && (!user.subscription_trial_ends_at.nil? && (Time.now < ( user.subscription_trial_ends_at + 2.days )))
|
||||
puts "user recently ended trial; ignore them #{user.email}"
|
||||
user.subscription_last_checked_at = DateTime.now
|
||||
user.subscription_sync_code = 'trial_recently_ended'
|
||||
user.subscription_sync_msg = "trial ended in past 2 days - plan_code not altered"
|
||||
user.save(validate: false)
|
||||
return
|
||||
end
|
||||
|
||||
# if there is no recurly action here, then they must be coming off of a trial and we have to mark them down
|
||||
if user.recurly_code.nil? && !user.subscription_plan_code.nil?
|
||||
puts "new user #{user.email} has no payment info and is ending their trial"
|
||||
|
|
|
|||
Loading…
Reference in New Issue