@@ -7,10 +7,8 @@ import { lastValueFrom } from "rxjs";
7
7
import { OrganizationApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/organization/organization-api.service.abstraction" ;
8
8
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization" ;
9
9
import { BillingApiServiceAbstraction } from "@bitwarden/common/billing/abstractions/billing-api.service.abstraction" ;
10
- import { BillingSourceResponse } from "@bitwarden/common/billing/models/response/billing.response" ;
11
10
import { OrganizationBillingMetadataResponse } from "@bitwarden/common/billing/models/response/organization-billing-metadata.response" ;
12
11
import { OrganizationSubscriptionResponse } from "@bitwarden/common/billing/models/response/organization-subscription.response" ;
13
- import { PaymentSourceResponse } from "@bitwarden/common/billing/models/response/payment-source.response" ;
14
12
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service" ;
15
13
import { DialogService } from "@bitwarden/components" ;
16
14
@@ -32,33 +30,11 @@ export class TrialFlowService {
32
30
checkForOrgsWithUpcomingPaymentIssues (
33
31
organization : Organization ,
34
32
organizationSubscription : OrganizationSubscriptionResponse ,
35
- paymentSource : BillingSourceResponse | PaymentSourceResponse ,
33
+ isPaymentConfigured : boolean ,
36
34
) : FreeTrial {
37
35
const trialEndDate = organizationSubscription ?. subscription ?. trialEndDate ;
38
36
const displayBanner =
39
- ! paymentSource &&
40
- organization ?. isOwner &&
41
- organizationSubscription ?. subscription ?. status === "trialing" ;
42
- const trialRemainingDays = trialEndDate ? this . calculateTrialRemainingDays ( trialEndDate ) : 0 ;
43
- const freeTrialMessage = this . getFreeTrialMessage ( trialRemainingDays ) ;
44
-
45
- return {
46
- remainingDays : trialRemainingDays ,
47
- message : freeTrialMessage ,
48
- shownBanner : displayBanner ,
49
- organizationId : organization . id ,
50
- organizationName : organization . name ,
51
- } ;
52
- }
53
-
54
- organizationHasUpcomingPaymentIssues (
55
- organization : Organization ,
56
- organizationSubscription : OrganizationSubscriptionResponse ,
57
- metadata : OrganizationBillingMetadataResponse ,
58
- ) : FreeTrial {
59
- const trialEndDate = organizationSubscription ?. subscription ?. trialEndDate ;
60
- const displayBanner =
61
- metadata . isPaymentMethodConfigured === false &&
37
+ isPaymentConfigured === false &&
62
38
organization ?. isOwner &&
63
39
organizationSubscription ?. subscription ?. status === "trialing" ;
64
40
const trialRemainingDays = trialEndDate ? this . calculateTrialRemainingDays ( trialEndDate ) : 0 ;
0 commit comments