mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 20:17:05 +00:00
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:
1 parent
1833ba7ce6
commit
61d2d17f52
17 files changed
+203
-46
No files matched your search
@@ -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]);
|
||||
|
||||
Reference in new issue
Block a user