diff --git a/app/Livewire/Subscription/Actions.php b/app/Livewire/Subscription/Actions.php
index db1f565a6..1388d3244 100644
--- a/app/Livewire/Subscription/Actions.php
+++ b/app/Livewire/Subscription/Actions.php
@@ -3,7 +3,6 @@
namespace App\Livewire\Subscription;
use App\Models\Team;
-use Illuminate\Support\Facades\Http;
use Livewire\Component;
class Actions extends Component
@@ -15,70 +14,6 @@ public function mount()
$this->server_limits = Team::serverLimit();
}
- public function cancel()
- {
- try {
- $subscription_id = currentTeam()->subscription->lemon_subscription_id;
- if (! $subscription_id) {
- throw new \Exception('No subscription found');
- }
- $response = Http::withHeaders([
- 'Accept' => 'application/vnd.api+json',
- 'Content-Type' => 'application/vnd.api+json',
- 'Authorization' => 'Bearer '.config('subscription.lemon_squeezy_api_key'),
- ])->delete('https://api.lemonsqueezy.com/v1/subscriptions/'.$subscription_id);
- $json = $response->json();
- if ($response->failed()) {
- $error = data_get($json, 'errors.0.status');
- if ($error === '404') {
- throw new \Exception('Subscription not found.');
- }
- throw new \Exception(data_get($json, 'errors.0.title', 'Something went wrong. Please try again later.'));
- } else {
- $this->dispatch('success', 'Subscription cancelled successfully. Reloading in 5s.');
- $this->dispatch('reloadWindow', 5000);
- }
- } catch (\Throwable $e) {
- return handleError($e, $this);
- }
- }
-
- public function resume()
- {
- try {
- $subscription_id = currentTeam()->subscription->lemon_subscription_id;
- if (! $subscription_id) {
- throw new \Exception('No subscription found');
- }
- $response = Http::withHeaders([
- 'Accept' => 'application/vnd.api+json',
- 'Content-Type' => 'application/vnd.api+json',
- 'Authorization' => 'Bearer '.config('subscription.lemon_squeezy_api_key'),
- ])->patch('https://api.lemonsqueezy.com/v1/subscriptions/'.$subscription_id, [
- 'data' => [
- 'type' => 'subscriptions',
- 'id' => $subscription_id,
- 'attributes' => [
- 'cancelled' => false,
- ],
- ],
- ]);
- $json = $response->json();
- if ($response->failed()) {
- $error = data_get($json, 'errors.0.status');
- if ($error === '404') {
- throw new \Exception('Subscription not found.');
- }
- throw new \Exception(data_get($json, 'errors.0.title', 'Something went wrong. Please try again later.'));
- } else {
- $this->dispatch('success', 'Subscription resumed successfully. Reloading in 5s.');
- $this->dispatch('reloadWindow', 5000);
- }
- } catch (\Throwable $e) {
- return handleError($e, $this);
- }
- }
-
public function stripeCustomerPortal()
{
$session = getStripeCustomerPortalSession(currentTeam());
diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php
index 35dc43c0c..1bd84a664 100644
--- a/app/Models/Subscription.php
+++ b/app/Models/Subscription.php
@@ -15,22 +15,7 @@ public function team()
public function type()
{
- if (isLemon()) {
- $basic = explode(',', config('subscription.lemon_squeezy_basic_plan_ids'));
- $pro = explode(',', config('subscription.lemon_squeezy_pro_plan_ids'));
- $ultimate = explode(',', config('subscription.lemon_squeezy_ultimate_plan_ids'));
-
- $subscription = $this->lemon_variant_id;
- if (in_array($subscription, $basic)) {
- return 'basic';
- }
- if (in_array($subscription, $pro)) {
- return 'pro';
- }
- if (in_array($subscription, $ultimate)) {
- return 'ultimate';
- }
- } elseif (isStripe()) {
+ if (isStripe()) {
if (! $this->stripe_plan_id) {
return 'zero';
}
diff --git a/bootstrap/helpers/subscriptions.php b/bootstrap/helpers/subscriptions.php
index 224a65f0a..aadd2dd34 100644
--- a/bootstrap/helpers/subscriptions.php
+++ b/bootstrap/helpers/subscriptions.php
@@ -1,51 +1,8 @@
user()->id;
- $team_id = currentTeam()->id ?? null;
- $email = auth()->user()->email ?? null;
- $name = auth()->user()->name ?? null;
- $url = "https://store.coollabs.io/checkout/buy/$checkout_id?";
- if ($user_id) {
- $url .= "&checkout[custom][user_id]={$user_id}";
- }
- if (isset($team_id)) {
- $url .= "&checkout[custom][team_id]={$team_id}";
- }
- if ($email) {
- $url .= "&checkout[email]={$email}";
- }
- if ($name) {
- $url .= "&checkout[name]={$name}";
- }
-
- return $url;
-}
-
-function getPaymentLink()
-{
- return currentTeam()->subscription->lemon_update_payment_menthod_url;
-}
-
-function getRenewDate()
-{
- return Carbon::parse(currentTeam()->subscription->lemon_renews_at)->format('Y-M-d H:i:s');
-}
-
-function getEndDate()
-{
- return Carbon::parse(currentTeam()->subscription->lemon_renews_at)->format('Y-M-d H:i:s');
-}
-
function isSubscriptionActive()
{
if (! isCloud()) {
@@ -60,12 +17,6 @@ function isSubscriptionActive()
if (is_null($subscription)) {
return false;
}
- if (isLemon()) {
- return $subscription->lemon_status === 'active';
- }
- // if (isPaddle()) {
- // return $subscription->paddle_status === 'active';
- // }
if (isStripe()) {
return $subscription->stripe_invoice_paid === true;
}
@@ -82,12 +33,6 @@ function isSubscriptionOnGracePeriod()
if (! $subscription) {
return false;
}
- if (isLemon()) {
- $is_still_grace_period = $subscription->lemon_ends_at &&
- Carbon::parse($subscription->lemon_ends_at) > Carbon::now();
-
- return $is_still_grace_period;
- }
if (isStripe()) {
return $subscription->stripe_cancel_at_period_end;
}
@@ -98,18 +43,10 @@ function subscriptionProvider()
{
return config('subscription.provider');
}
-function isLemon()
-{
- return config('subscription.provider') === 'lemon';
-}
function isStripe()
{
return config('subscription.provider') === 'stripe';
}
-function isPaddle()
-{
- return config('subscription.provider') === 'paddle';
-}
function getStripeCustomerPortalSession(Team $team)
{
Stripe::setApiKey(config('subscription.stripe_api_key'));
diff --git a/config/subscription.php b/config/subscription.php
index 07665075f..3e0182de9 100644
--- a/config/subscription.php
+++ b/config/subscription.php
@@ -1,7 +1,8 @@
env('SUBSCRIPTION_PROVIDER', null), // stripe, paddle, lemon
+ 'provider' => env('SUBSCRIPTION_PROVIDER', null), // stripe
+
// Stripe
'stripe_api_key' => env('STRIPE_API_KEY', null),
'stripe_webhook_secret' => env('STRIPE_WEBHOOK_SECRET', null),
@@ -22,29 +23,4 @@
'stripe_price_id_dynamic_monthly' => env('STRIPE_PRICE_ID_DYNAMIC_MONTHLY', null),
'stripe_price_id_dynamic_yearly' => env('STRIPE_PRICE_ID_DYNAMIC_YEARLY', null),
-
- // Paddle
- 'paddle_vendor_id' => env('PADDLE_VENDOR_ID', null),
- 'paddle_vendor_auth_code' => env('PADDLE_VENDOR_AUTH_CODE', null),
- 'paddle_webhook_secret' => env('PADDLE_WEBHOOK_SECRET', null),
- 'paddle_public_key' => env('PADDLE_PUBLIC_KEY', null),
- 'paddle_price_id_basic_monthly' => env('PADDLE_PRICE_ID_BASIC_MONTHLY', null),
- 'paddle_price_id_basic_yearly' => env('PADDLE_PRICE_ID_BASIC_YEARLY', null),
- 'paddle_price_id_pro_monthly' => env('PADDLE_PRICE_ID_PRO_MONTHLY', null),
- 'paddle_price_id_pro_yearly' => env('PADDLE_PRICE_ID_PRO_YEARLY', null),
- 'paddle_price_id_ultimate_monthly' => env('PADDLE_PRICE_ID_ULTIMATE_MONTHLY', null),
- 'paddle_price_id_ultimate_yearly' => env('PADDLE_PRICE_ID_ULTIMATE_YEARLY', null),
-
- // Lemon
- 'lemon_squeezy_api_key' => env('LEMON_SQUEEZY_API_KEY', null),
- 'lemon_squeezy_webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET', null),
- 'lemon_squeezy_checkout_id_basic_monthly' => env('LEMON_SQUEEZY_CHECKOUT_ID_BASIC_MONTHLY', null),
- 'lemon_squeezy_checkout_id_basic_yearly' => env('LEMON_SQUEEZY_CHECKOUT_ID_BASIC_YEARLY', null),
- 'lemon_squeezy_checkout_id_pro_monthly' => env('LEMON_SQUEEZY_CHECKOUT_ID_PRO_MONTHLY', null),
- 'lemon_squeezy_checkout_id_pro_yearly' => env('LEMON_SQUEEZY_CHECKOUT_ID_PRO_YEARLY', null),
- 'lemon_squeezy_checkout_id_ultimate_monthly' => env('LEMON_SQUEEZY_CHECKOUT_ID_ULTIMATE_MONTHLY', null),
- 'lemon_squeezy_checkout_id_ultimate_yearly' => env('LEMON_SQUEEZY_CHECKOUT_ID_ULTIMATE_YEARLY', null),
- 'lemon_squeezy_basic_plan_ids' => env('LEMON_SQUEEZY_BASIC_PLAN_IDS', ''),
- 'lemon_squeezy_pro_plan_ids' => env('LEMON_SQUEEZY_PRO_PLAN_IDS', ''),
- 'lemon_squeezy_ultimate_plan_ids' => env('LEMON_SQUEEZY_ULTIMATE_PLAN_IDS', ''),
];
diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml
index 357138ca1..b8156cab5 100644
--- a/docker-compose.prod.yml
+++ b/docker-compose.prod.yml
@@ -69,27 +69,6 @@ services:
- STRIPE_PRICE_ID_ULTIMATE_MONTHLY_OLD
- STRIPE_PRICE_ID_ULTIMATE_YEARLY_OLD
- STRIPE_EXCLUDED_PLANS
- - PADDLE_VENDOR_ID
- - PADDLE_WEBHOOK_SECRET
- - PADDLE_VENDOR_AUTH_CODE
- - PADDLE_PUBLIC_KEY
- - PADDLE_PRICE_ID_BASIC_MONTHLY
- - PADDLE_PRICE_ID_BASIC_YEARLY
- - PADDLE_PRICE_ID_PRO_MONTHLY
- - PADDLE_PRICE_ID_PRO_YEARLY
- - PADDLE_PRICE_ID_ULTIMATE_MONTHLY
- - PADDLE_PRICE_ID_ULTIMATE_YEARLY
- - LEMON_SQUEEZY_API_KEY
- - LEMON_SQUEEZY_WEBHOOK_SECRET
- - LEMON_SQUEEZY_CHECKOUT_ID_BASIC_MONTHLY
- - LEMON_SQUEEZY_CHECKOUT_ID_BASIC_YEARLY
- - LEMON_SQUEEZY_CHECKOUT_ID_PRO_MONTHLY
- - LEMON_SQUEEZY_CHECKOUT_ID_PRO_YEARLY
- - LEMON_SQUEEZY_CHECKOUT_ID_ULTIMATE_MONTHLY
- - LEMON_SQUEEZY_CHECKOUT_ID_ULTIMATE_YEARLY
- - LEMON_SQUEEZY_BASIC_PLAN_IDS
- - LEMON_SQUEEZY_PRO_PLAN_IDS
- - LEMON_SQUEEZY_ULTIMATE_PLAN_IDS
ports:
- "${APP_PORT:-8000}:80"
expose:
diff --git a/resources/views/components/paddle.blade.php b/resources/views/components/paddle.blade.php
deleted file mode 100644
index 5aa10b200..000000000
--- a/resources/views/components/paddle.blade.php
+++ /dev/null
@@ -1,80 +0,0 @@
-
Start self-hosting without limits with +
Start self-hosting without limits + with our OSS version. Same features as the paid version, but you have to manage by yourself.
-+
Custom {{-- pay-as-you-go --}} @@ -198,7 +200,7 @@ class="grid max-w-sm grid-cols-1 -mt-16 divide-y divide-neutral-200 dark:divide- {{-- /month + VAT --}}
- + pay-as-you-go @@ -213,8 +215,8 @@ class="grid max-w-sm grid-cols-1 -mt-16 divide-y divide-neutral-200 dark:divide- single location.