diff --git a/src/Squidex.Domain.Apps.Read/Apps/Services/IAppPlanBillingManager.cs b/src/Squidex.Domain.Apps.Read/Apps/Services/IAppPlanBillingManager.cs index 722784540..ebb189b2e 100644 --- a/src/Squidex.Domain.Apps.Read/Apps/Services/IAppPlanBillingManager.cs +++ b/src/Squidex.Domain.Apps.Read/Apps/Services/IAppPlanBillingManager.cs @@ -17,8 +17,6 @@ namespace Squidex.Domain.Apps.Read.Apps.Services Task ChangePlanAsync(string userId, Guid appId, string appName, string planId); - Task HasPaymentOptionsAsync(string userId); - Task GetPortalLinkAsync(string userId); } } diff --git a/src/Squidex.Domain.Apps.Read/Apps/Services/Implementations/NoopAppPlanBillingManager.cs b/src/Squidex.Domain.Apps.Read/Apps/Services/Implementations/NoopAppPlanBillingManager.cs index 959889a93..5f6bdec01 100644 --- a/src/Squidex.Domain.Apps.Read/Apps/Services/Implementations/NoopAppPlanBillingManager.cs +++ b/src/Squidex.Domain.Apps.Read/Apps/Services/Implementations/NoopAppPlanBillingManager.cs @@ -8,7 +8,6 @@ using System; using System.Threading.Tasks; -using Squidex.Infrastructure.Tasks; namespace Squidex.Domain.Apps.Read.Apps.Services.Implementations { @@ -24,11 +23,6 @@ namespace Squidex.Domain.Apps.Read.Apps.Services.Implementations return Task.FromResult(PlanChangedResult.Instance); } - public Task HasPaymentOptionsAsync(string userId) - { - return TaskHelper.True; - } - public Task GetPortalLinkAsync(string userId) { return Task.FromResult(string.Empty); diff --git a/src/Squidex/Controllers/Api/Plans/AppPlansController.cs b/src/Squidex/Controllers/Api/Plans/AppPlansController.cs index b520b679d..7bb98cf02 100644 --- a/src/Squidex/Controllers/Api/Plans/AppPlansController.cs +++ b/src/Squidex/Controllers/Api/Plans/AppPlansController.cs @@ -16,7 +16,6 @@ using Squidex.Domain.Apps.Read.Apps.Services; using Squidex.Domain.Apps.Write.Apps.Commands; using Squidex.Infrastructure.CQRS.Commands; using Squidex.Infrastructure.Reflection; -using Squidex.Infrastructure.Security; using Squidex.Pipeline; // ReSharper disable RedundantIfElseBlock @@ -54,22 +53,16 @@ namespace Squidex.Controllers.Api.Plans [Route("apps/{app}/plans/")] [ProducesResponseType(typeof(AppPlansDto), 200)] [ApiCosts(0.5)] - public async Task GetPlans(string app) + public IActionResult GetPlans(string app) { - var userId = User.FindFirst(OpenIdClaims.Subject).Value; - var planId = appPlansProvider.GetPlanForApp(App).Id; - - var hasPortal = appPlansBillingManager.HasPortal; - var hasConfigured = await appPlansBillingManager.HasPaymentOptionsAsync(userId); - + var response = new AppPlansDto { + CurrentPlanId = planId, Plans = appPlansProvider.GetAvailablePlans().Select(x => SimpleMapper.Map(x, new PlanDto())).ToList(), PlanOwner = App.PlanOwner, - HasPortal = hasPortal, - HasConfigured = hasConfigured, - CurrentPlanId = planId + HasPortal = appPlansBillingManager.HasPortal }; Response.Headers["ETag"] = new StringValues(App.Version.ToString()); diff --git a/src/Squidex/Controllers/Api/Plans/Models/AppPlansDto.cs b/src/Squidex/Controllers/Api/Plans/Models/AppPlansDto.cs index 1cca36404..92031bd9b 100644 --- a/src/Squidex/Controllers/Api/Plans/Models/AppPlansDto.cs +++ b/src/Squidex/Controllers/Api/Plans/Models/AppPlansDto.cs @@ -31,10 +31,5 @@ namespace Squidex.Controllers.Api.Plans.Models /// Indicates if there is a billing portal. /// public bool HasPortal { get; set; } - - /// - /// Indicates if the user has payment options entered so that the plan can be changed. - /// - public bool HasConfigured { get; set; } } } diff --git a/src/Squidex/app-config/webpack.run.dev.js b/src/Squidex/app-config/webpack.run.dev.js index 629e7d820..224f8d515 100644 --- a/src/Squidex/app-config/webpack.run.dev.js +++ b/src/Squidex/app-config/webpack.run.dev.js @@ -15,8 +15,6 @@ module.exports = webpackMerge(runConfig, { */ devtool: 'cheap-module-source-map', - //debug: true, - output: { filename: '[name].js', // Set the public path, because we are running the website from another port (5000) diff --git a/src/Squidex/app/features/settings/pages/plans/plans-page.component.html b/src/Squidex/app/features/settings/pages/plans/plans-page.component.html index 649fe8e99..8eefaeca8 100644 --- a/src/Squidex/app/features/settings/pages/plans/plans-page.component.html +++ b/src/Squidex/app/features/settings/pages/plans/plans-page.component.html @@ -22,13 +22,8 @@
-
-
- You have not configured your account yet. Go to Billing Portal to add payment options. -
-
- You have not created the subscription. Therefore you cannot change the plan. -
+
+ You have not created the subscription. Therefore you cannot change the plan.
@@ -59,7 +54,7 @@ ✓ Selected -
diff --git a/src/Squidex/app/features/settings/pages/plans/plans-page.component.ts b/src/Squidex/app/features/settings/pages/plans/plans-page.component.ts index 14a37c16f..605c46b16 100644 --- a/src/Squidex/app/features/settings/pages/plans/plans-page.component.ts +++ b/src/Squidex/app/features/settings/pages/plans/plans-page.component.ts @@ -74,7 +74,6 @@ export class PlansPageComponent extends AppComponentBase implements OnInit { new AppPlansDto(planId, this.plans.planOwner, this.plans.hasPortal, - this.plans.hasConfigured, this.plans.plans); this.isDisabled = false; } diff --git a/src/Squidex/app/shared/services/plans.service.spec.ts b/src/Squidex/app/shared/services/plans.service.spec.ts index 8fca71826..d70f497a4 100644 --- a/src/Squidex/app/shared/services/plans.service.spec.ts +++ b/src/Squidex/app/shared/services/plans.service.spec.ts @@ -53,7 +53,6 @@ describe('PlansService', () => { req.flush({ currentPlanId: '123', - hasConfigured: true, hasPortal: true, planOwner: '456', plans: [ @@ -81,7 +80,6 @@ describe('PlansService', () => { '123', '456', true, - true, [ new PlanDto('free', 'Free', '14 €', 1000, 1500, 2500), new PlanDto('prof', 'Prof', '18 €', 4000, 5500, 6500) diff --git a/src/Squidex/app/shared/services/plans.service.ts b/src/Squidex/app/shared/services/plans.service.ts index 6ba084f49..0a76a0ac0 100644 --- a/src/Squidex/app/shared/services/plans.service.ts +++ b/src/Squidex/app/shared/services/plans.service.ts @@ -22,7 +22,6 @@ export class AppPlansDto { public readonly currentPlanId: string, public readonly planOwner: string, public readonly hasPortal: boolean, - public readonly hasConfigured: boolean, public readonly plans: PlanDto[] ) { } @@ -73,7 +72,6 @@ export class PlansService { response.currentPlanId, response.planOwner, response.hasPortal, - response.hasConfigured, items.map(item => { return new PlanDto( item.id, diff --git a/tests/Squidex.Domain.Apps.Read.Tests/Apps/NoopAppPlanBillingManagerTests.cs b/tests/Squidex.Domain.Apps.Read.Tests/Apps/NoopAppPlanBillingManagerTests.cs index e8fe4bc91..17dd3d413 100644 --- a/tests/Squidex.Domain.Apps.Read.Tests/Apps/NoopAppPlanBillingManagerTests.cs +++ b/tests/Squidex.Domain.Apps.Read.Tests/Apps/NoopAppPlanBillingManagerTests.cs @@ -29,12 +29,6 @@ namespace Squidex.Domain.Apps.Read.Apps await sut.ChangePlanAsync(null, Guid.Empty, null, null); } - [Fact] - public async Task Should_return_true_for_payment_option_check() - { - Assert.True(await sut.HasPaymentOptionsAsync(null)); - } - [Fact] public async Task Should_not_return_portal_link() {