diff --git a/config/language-translations.php b/config/language-translations.php index 924f8d57..910ad2b7 100644 --- a/config/language-translations.php +++ b/config/language-translations.php @@ -108,7 +108,7 @@ return [ 'want_to_delete_card_description' => 'We will no longer settle your payments automatically and you will have to fund your account for the next payments.', 'credit_card_deleted' => 'Your credit card was deleted.', 'billed_annually' => 'Billed Annually', - 'restricted_account_warning' => 'Your functionality is restricted. Please review your billing settings.', + 'restricted_account_warning' => 'Your functionality is restricted.', 'subscription_type' => 'Subscription Type', 'subscription_type_note' => 'Please do not change in production environment.', 'select_subscription_type' => 'Select your subscription type', diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 97173f23..09df8a91 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -63,7 +63,7 @@ "/chunks/settings-password.js": "/chunks/settings-password.js?id=1cf499fe8326b3c4", "/chunks/settings-storage.js": "/chunks/settings-storage.js?id=ecfee7f7e98204f8", "/chunks/billing.js": "/chunks/billing.js?id=f016e8454a346fc6", - "/chunks/platform.js": "/chunks/platform.js?id=0716f5215cdb26a8", + "/chunks/platform.js": "/chunks/platform.js?id=ac9e1881456b1cb8", "/chunks/files.js": "/chunks/files.js?id=77289ebbd049d5ac", "/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=248310cdd67d62fb", "/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=15fba3b663103c88", diff --git a/resources/js/components/Subscription/RestrictionWarningBar.vue b/resources/js/components/Subscription/RestrictionWarningBar.vue index 73993b6b..6e937dd6 100644 --- a/resources/js/components/Subscription/RestrictionWarningBar.vue +++ b/resources/js/components/Subscription/RestrictionWarningBar.vue @@ -1,7 +1,7 @@ diff --git a/resources/js/store/modules/userAuth.js b/resources/js/store/modules/userAuth.js index 85f351bf..0fff1d20 100644 --- a/resources/js/store/modules/userAuth.js +++ b/resources/js/store/modules/userAuth.js @@ -201,10 +201,7 @@ const mutations = { } const getters = { - isLimitedUser: (state) => - state.user && - state.user.data.relationships.failedPayments && - state.user.data.relationships.failedPayments.data.length === 3, + userLimitationReason: (state) => state.user && state.user.data.meta.restrictions.reason, permission: (state) => state.permission, user: (state) => state.user, } diff --git a/resources/js/views/Platform.vue b/resources/js/views/Platform.vue index 1f14b239..7454fde2 100644 --- a/resources/js/views/Platform.vue +++ b/resources/js/views/Platform.vue @@ -110,7 +110,7 @@ export default { DragUI, }, computed: { - ...mapGetters(['isVisibleSidebar', 'isLimitedUser', 'config', 'currentFolder']), + ...mapGetters(['isVisibleSidebar', 'config', 'currentFolder']), }, data() { return { diff --git a/src/App/Users/Models/User.php b/src/App/Users/Models/User.php index da35dc19..57901b62 100644 --- a/src/App/Users/Models/User.php +++ b/src/App/Users/Models/User.php @@ -3,6 +3,7 @@ namespace App\Users\Models; use ByteUnits\Metric; use Illuminate\Support\Str; +use BadMethodCallException; use Domain\Files\Models\File; use Domain\Folders\Models\Folder; use Laravel\Sanctum\HasApiTokens; @@ -196,10 +197,14 @@ class User extends Authenticatable implements MustVerifyEmail public function __call($method, $parameters) { - if (str_starts_with($method, 'can') || str_starts_with($method, 'get')) { - return resolve(RestrictionsManager::class) - ->driver() - ->$method($this, ...$parameters); + try { + if (str_starts_with($method, 'can') || str_starts_with($method, 'get')) { + return resolve(RestrictionsManager::class) + ->driver() + ->$method($this, ...$parameters); + } + } catch (BadMethodCallException $e) { + return parent::__call($method, $parameters); } return parent::__call($method, $parameters); diff --git a/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php b/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php index c174162b..c92cfd79 100644 --- a/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php +++ b/src/App/Users/Restrictions/Engines/MeteredBillingRestrictionsEngine.php @@ -70,13 +70,13 @@ class MeteredBillingRestrictionsEngine implements RestrictionsEngine { if ($this->getDunningSequenceCount($user) === 3) { return match ($user->dunning->type) { - 'limit_usage_in_new_accounts' => 'Please make your first payment.', - 'usage_bigger_than_balance' => 'Please increase your account balance.', + 'limit_usage_in_new_accounts' => 'Please make your first payment to cover your usage.', + 'usage_bigger_than_balance' => 'Please increase your account balance higher than your monthly usage.', }; } if (! $this->checkFailedPayments($user)) { - return 'Please update your credit card.'; + return 'Please update your credit card to pay your usage.'; } return null;