fix: stripe invoice paid webhook

fix: prepare customer initiated tier change
fix: separate view for subscriptions
This commit is contained in:
Andras Bacsai
2024-02-23 11:21:14 +01:00
parent ce09ef8848
commit b59e47dcf9
11 changed files with 108 additions and 59 deletions

View File

@@ -7,6 +7,13 @@ use Livewire\Component;
class Actions extends Component
{
public $server_limits = 0;
public function mount()
{
$limits = currentTeam()->limits;
$this->server_limits = data_get($limits, 'serverLimit', 0);
}
public function cancel()
{
try {
@@ -69,7 +76,8 @@ class Actions extends Component
return handleError($e, $this);
}
}
public function stripeCustomerPortal() {
public function stripeCustomerPortal()
{
$session = getStripeCustomerPortalSession(currentTeam());
redirect($session->url);
}

View File

@@ -0,0 +1,19 @@
<?php
namespace App\Livewire\Subscription;
use Livewire\Component;
class Show extends Component
{
public function mount()
{
if (!isCloud()) {
return redirect()->route('dashboard');
}
}
public function render()
{
return view('livewire.subscription.show');
}
}