feat(subscription): add Stripe action controls

Add subscription action handling and tests for cancel, resume, and refund flows while resolving StripeClient through the container.
This commit is contained in:
Andras Bacsai committed 2026-06-12 15:54:21 +02:00
1 parent 1833ba7ce6
commit 61d2d17f52
17 files changed
+203 -46

No files matched your search

+2 -1
View File
@@ -5,6 +5,7 @@ namespace App\Livewire\Subscription;
use App\Models\InstanceSettings;
use App\Providers\RouteServiceProvider;
use Livewire\Component;
use Stripe\StripeClient;
class Index extends Component
{
@@ -52,7 +53,7 @@ class Index extends Component
{
try {
$subscription = currentTeam()->subscription;
$stripe = new \Stripe\StripeClient(config('subscription.stripe_api_key'));
$stripe = app(StripeClient::class);
$customer = $stripe->customers->retrieve(currentTeam()->subscription->stripe_customer_id);
if ($customer) {
$subscriptions = $stripe->subscriptions->all(['customer' => $customer->id]);