cloud: disable trial

This commit is contained in:
Andras Bacsai 2023-11-29 16:34:31 +01:00
parent ef25f7d800
commit 243d1c06fc
3 changed files with 13 additions and 5 deletions

View File

@ -11,6 +11,9 @@ class PricingPlans extends Component
public bool $isTrial = false; public bool $isTrial = false;
public function mount() { public function mount() {
$this->isTrial = !data_get(currentTeam(),'subscription.stripe_trial_already_ended'); $this->isTrial = !data_get(currentTeam(),'subscription.stripe_trial_already_ended');
if (config('constants.limits.trial_period') == 0) {
$this->isTrial = false;
}
} }
public function subscribeStripe($type) public function subscribeStripe($type)
{ {
@ -63,6 +66,7 @@ class PricingPlans extends Component
]; ];
if (!data_get($team,'subscription.stripe_trial_already_ended')) { if (!data_get($team,'subscription.stripe_trial_already_ended')) {
if (config('constants.limits.trial_period') > 0) {
$payload['subscription_data'] = [ $payload['subscription_data'] = [
'trial_period_days' => config('constants.limits.trial_period'), 'trial_period_days' => config('constants.limits.trial_period'),
'trial_settings' => [ 'trial_settings' => [
@ -71,6 +75,7 @@ class PricingPlans extends Component
] ]
], ],
]; ];
}
$payload['payment_method_collection'] = 'if_required'; $payload['payment_method_collection'] = 'if_required';
} }
$customer = currentTeam()->subscription?->stripe_customer_id ?? null; $customer = currentTeam()->subscription?->stripe_customer_id ?? null;

View File

@ -22,7 +22,7 @@ return [
'official' => 'https://cdn.coollabs.io/coolify/service-templates.json', 'official' => 'https://cdn.coollabs.io/coolify/service-templates.json',
], ],
'limits' => [ 'limits' => [
'trial_period' => 7, 'trial_period' => 0,
'server' => [ 'server' => [
'zero' => 0, 'zero' => 0,
'self-hosted' => 999999999999, 'self-hosted' => 999999999999,

View File

@ -21,8 +21,11 @@
</label> </label>
</fieldset> </fieldset>
</div> </div>
<div class="py-2 text-center"><span class="font-bold text-warning">{{ config('constants.limits.trial_period') }} @if (config('constants.limits.trial_period') > 0)
days trial</span> included on all plans, without credit card details.</div> <div class="py-2 text-center"><span
class="font-bold text-warning">{{ config('constants.limits.trial_period') }}
days trial</span> included on all plans, without credit card details.</div>
@endif
<div x-show="selected === 'monthly'" class="flex justify-center h-10 mt-3 text-sm leading-6 "> <div x-show="selected === 'monthly'" class="flex justify-center h-10 mt-3 text-sm leading-6 ">
<div>Save <span class="font-bold text-warning">10%</span> annually with the yearly plans. <div>Save <span class="font-bold text-warning">10%</span> annually with the yearly plans.
</div> </div>
@ -255,8 +258,8 @@
<div class="flex items-start gap-4 text-xl tracking-tight">Need official support for <div class="flex items-start gap-4 text-xl tracking-tight">Need official support for
your self-hosted instance? your self-hosted instance?
<x-forms.button> <x-forms.button>
<a class="font-bold text-white hover:no-underline" <a class="font-bold text-white hover:no-underline" href="{{ config('coolify.docs') }}">Contact
href="{{ config('coolify.docs') }}">Contact Us</a> Us</a>
</x-forms.button> </x-forms.button>
</div> </div>
</div> </div>