Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-11730] Remove feature flag: AC-2476-deprecate-stripe-sources-api #13032

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7ef5cfe
Remove FF from trial-billing-step.component
amorask-bitwarden Jan 23, 2025
b3fc5d5
Remove FF from user-subscription.component
amorask-bitwarden Jan 23, 2025
a62d83a
Remove FF from individual-billing-routing.module
amorask-bitwarden Jan 23, 2025
14fb8ba
Remove FF from organization-billing.service
amorask-bitwarden Jan 23, 2025
f1333b3
Remove FF from organization-subscription-cloud.component
amorask-bitwarden Jan 23, 2025
708f2e7
Remove FF from organization-billing-routing.mdoule
amorask-bitwarden Jan 23, 2025
c495f98
Remove FF from organization-plans.component
amorask-bitwarden Jan 23, 2025
069b124
Remove FF from change-plan-dialog.component
amorask-bitwarden Jan 23, 2025
4eb0a36
Remove FF
amorask-bitwarden Jan 23, 2025
ebd5531
Remove legacy payment.component
amorask-bitwarden Jan 23, 2025
076e204
Rename V2: adjust-payment-dialog.component
amorask-bitwarden Jan 23, 2025
03961ea
Rename V2: adjust-storage-dialog.component
amorask-bitwarden Jan 23, 2025
29455ad
Rename V2: payment-label.component
amorask-bitwarden Jan 23, 2025
acf1d23
Rename V2: payment.component
amorask-bitwarden Jan 23, 2025
0638232
Rename V2: premium.component
amorask-bitwarden Jan 23, 2025
b41b51a
Merge branch 'main' into billing/PM-11730/remove-ff-deprecate-stripe-โ€ฆ
amorask-bitwarden Jan 23, 2025
4ea27e1
Merge branch 'main' into billing/PM-11730/remove-ff-deprecate-stripe-โ€ฆ
amorask-bitwarden Jan 24, 2025
626117c
Merge branch 'main' into billing/PM-11730/remove-ff-deprecate-stripe-โ€ฆ
amorask-bitwarden Jan 24, 2025
aa743dd
Patrick's feedback
amorask-bitwarden Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { SecretsManagerTrialFreeStepperComponent } from "../../auth/trial-initiation/secrets-manager/secrets-manager-trial-free-stepper.component";
import { SecretsManagerTrialPaidStepperComponent } from "../../auth/trial-initiation/secrets-manager/secrets-manager-trial-paid-stepper.component";
import { SecretsManagerTrialComponent } from "../../auth/trial-initiation/secrets-manager/secrets-manager-trial.component";
import { PaymentComponent, TaxInfoComponent } from "../../billing";
import { TaxInfoComponent } from "../../billing";

Check warning on line 13 in apps/web/src/app/auth/trial-initiation/trial-initiation.module.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/auth/trial-initiation/trial-initiation.module.ts#L13

Added line #L13 was not covered by tests
import { TrialBillingStepComponent } from "../../billing/accounts/trial-initiation/trial-billing-step.component";
import { EnvironmentSelectorModule } from "../../components/environment-selector/environment-selector.module";
import { SharedModule } from "../../shared";
Expand Down Expand Up @@ -51,7 +51,6 @@
RegisterFormModule,
OrganizationCreateModule,
EnvironmentSelectorModule,
PaymentComponent,
TaxInfoComponent,
TrialBillingStepComponent,
InputPasswordComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,7 @@ <h2 class="tw-mb-3 tw-text-base tw-font-semibold">{{ "billingPlanLabel" | i18n }
</div>
<div class="tw-mb-4">
<h2 class="tw-mb-3 tw-text-base tw-font-semibold">{{ "paymentType" | i18n }}</h2>
<app-payment
*ngIf="!deprecateStripeSourcesAPI"
[hideCredit]="true"
[trialFlow]="true"
></app-payment>
<app-payment-v2
*ngIf="deprecateStripeSourcesAPI"
[showAccountCredit]="false"
></app-payment-v2>
<app-payment [showAccountCredit]="false"></app-payment>
<app-tax-info [trialFlow]="true" (countryChanged)="changedCountry()"></app-tax-info>
</div>
<div class="tw-flex tw-space-x-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
} from "@bitwarden/common/billing/abstractions/organization-billing.service";
import { PaymentMethodType, PlanType, ProductTierType } from "@bitwarden/common/billing/enums";
import { PlanResponse } from "@bitwarden/common/billing/models/response/plan.response";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
import { ToastService } from "@bitwarden/components";

import { BillingSharedModule, PaymentComponent, TaxInfoComponent } from "../../shared";
import { PaymentV2Component } from "../../shared/payment/payment-v2.component";
import { BillingSharedModule, TaxInfoComponent } from "../../shared";
import { PaymentComponent } from "../../shared/payment/payment.component";

export type TrialOrganizationType = Exclude<ProductTierType, ProductTierType.Free>;

Expand Down Expand Up @@ -53,7 +51,6 @@
})
export class TrialBillingStepComponent implements OnInit {
@ViewChild(PaymentComponent) paymentComponent: PaymentComponent;
@ViewChild(PaymentV2Component) paymentV2Component: PaymentV2Component;
@ViewChild(TaxInfoComponent) taxInfoComponent: TaxInfoComponent;
@Input() organizationInfo: OrganizationInfo;
@Input() subscriptionProduct: SubscriptionProduct = SubscriptionProduct.PasswordManager;
Expand All @@ -74,11 +71,8 @@
annualPlan?: PlanResponse;
monthlyPlan?: PlanResponse;

deprecateStripeSourcesAPI: boolean;

constructor(
private apiService: ApiService,
private configService: ConfigService,
private i18nService: I18nService,
private formBuilder: FormBuilder,
private messagingService: MessagingService,
Expand All @@ -87,9 +81,6 @@
) {}

async ngOnInit(): Promise<void> {
this.deprecateStripeSourcesAPI = await this.configService.getFeatureFlag(
FeatureFlag.AC2476_DeprecateStripeSourcesAPI,
);
const plans = await this.apiService.getPlans();
this.applicablePlans = plans.data.filter(this.isApplicable);
this.annualPlan = this.findPlanFor(SubscriptionCadence.Annual);
Expand Down Expand Up @@ -124,23 +115,12 @@
}

protected changedCountry() {
if (this.deprecateStripeSourcesAPI) {
this.paymentV2Component.showBankAccount = this.taxInfoComponent.country === "US";
if (
!this.paymentV2Component.showBankAccount &&
this.paymentV2Component.selected === PaymentMethodType.BankAccount
) {
this.paymentV2Component.select(PaymentMethodType.Card);
}
} else {
this.paymentComponent.hideBank = this.taxInfoComponent.taxFormGroup.value.country !== "US";
if (
this.paymentComponent.hideBank &&
this.paymentComponent.method === PaymentMethodType.BankAccount
) {
this.paymentComponent.method = PaymentMethodType.Card;
this.paymentComponent.changeMethod();
}
this.paymentComponent.showBankAccount = this.taxInfoComponent.country === "US";

Check warning on line 118 in apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts#L118

Added line #L118 was not covered by tests
if (
!this.paymentComponent.showBankAccount &&
this.paymentComponent.selected === PaymentMethodType.BankAccount
) {
this.paymentComponent.select(PaymentMethodType.Card);

Check warning on line 123 in apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts#L123

Added line #L123 was not covered by tests
}
}

Expand All @@ -162,14 +142,8 @@
private async createOrganization(): Promise<string> {
const planResponse = this.findPlanFor(this.formGroup.value.cadence);

let paymentMethod: [string, PaymentMethodType];

if (this.deprecateStripeSourcesAPI) {
const { type, token } = await this.paymentV2Component.tokenize();
paymentMethod = [token, type];
} else {
paymentMethod = await this.paymentComponent.createPaymentToken();
}
const { type, token } = await this.paymentComponent.tokenize();
const paymentMethod: [string, PaymentMethodType] = [token, type];

Check warning on line 146 in apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts

View check run for this annotation

Codecov / codecov/patch

apps/web/src/app/billing/accounts/trial-initiation/trial-billing-step.component.ts#L145-L146

Added lines #L145 - L146 were not covered by tests

const organization: OrganizationInformation = {
name: this.organizationInfo.name,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/billing/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { OrganizationPlansComponent } from "./organizations";
export { PaymentComponent, TaxInfoComponent } from "./shared";
export { TaxInfoComponent } from "./shared";
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { NgModule } from "@angular/core";
import { RouterModule, Routes } from "@angular/router";

import { featureFlaggedRoute } from "@bitwarden/angular/platform/utils/feature-flagged-route";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";

import { PaymentMethodComponent } from "../shared";

import { BillingHistoryViewComponent } from "./billing-history-view.component";
import { PremiumV2Component } from "./premium/premium-v2.component";
import { PremiumComponent } from "./premium/premium.component";
import { SubscriptionComponent } from "./subscription.component";
import { UserSubscriptionComponent } from "./user-subscription.component";
Expand All @@ -24,15 +20,11 @@ const routes: Routes = [
component: UserSubscriptionComponent,
data: { titleId: "premiumMembership" },
},
...featureFlaggedRoute({
defaultComponent: PremiumComponent,
flaggedComponent: PremiumV2Component,
featureFlag: FeatureFlag.AC2476_DeprecateStripeSourcesAPI,
routeOptions: {
path: "premium",
data: { titleId: "goPremium" },
},
}),
{
path: "premium",
component: PremiumComponent,
data: { titleId: "goPremium" },
},
{
path: "payment-method",
component: PaymentMethodComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { BillingSharedModule } from "../shared";

import { BillingHistoryViewComponent } from "./billing-history-view.component";
import { IndividualBillingRoutingModule } from "./individual-billing-routing.module";
import { PremiumV2Component } from "./premium/premium-v2.component";
import { PremiumComponent } from "./premium/premium.component";
import { SubscriptionComponent } from "./subscription.component";
import { UserSubscriptionComponent } from "./user-subscription.component";
Expand All @@ -17,7 +16,6 @@ import { UserSubscriptionComponent } from "./user-subscription.component";
BillingHistoryViewComponent,
UserSubscriptionComponent,
PremiumComponent,
PremiumV2Component,
],
})
export class IndividualBillingModule {}

This file was deleted.

Loading
Loading