mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PM-5548] Eliminate in-app purchase logic (#7433)
* Eliminate in-app purchase logic * Remove more in-app logic found, for payment and subscription management --------- Co-authored-by: Lotus Scott <148992878+lscottbw@users.noreply.github.com>
This commit is contained in:
@@ -69,18 +69,6 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.usingInAppPurchase) {
|
||||
this.dialogService.openSimpleDialog({
|
||||
title: { key: "cancelSubscription" },
|
||||
content: { key: "manageSubscriptionFromStore" },
|
||||
acceptButtonText: { key: "ok" },
|
||||
cancelButtonText: null,
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.dialogService.openSimpleDialog({
|
||||
title: { key: "reinstateSubscription" },
|
||||
content: { key: "reinstateConfirmation" },
|
||||
@@ -106,18 +94,6 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.usingInAppPurchase) {
|
||||
this.dialogService.openSimpleDialog({
|
||||
title: { key: "cancelSubscription" },
|
||||
content: { key: "manageSubscriptionFromStore" },
|
||||
acceptButtonText: { key: "ok" },
|
||||
cancelButtonText: null,
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const confirmed = await this.dialogService.openSimpleDialog({
|
||||
title: { key: "cancelSubscription" },
|
||||
content: { key: "cancelConfirmation" },
|
||||
@@ -169,17 +145,6 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
}
|
||||
|
||||
adjustStorage(add: boolean) {
|
||||
if (this.usingInAppPurchase) {
|
||||
this.dialogService.openSimpleDialog({
|
||||
title: { key: add ? "addStorage" : "removeStorage" },
|
||||
content: { key: "cannotPerformInAppPurchase" },
|
||||
acceptButtonText: { key: "ok" },
|
||||
cancelButtonText: null,
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
this.adjustStorageAdd = add;
|
||||
this.showAdjustStorage = true;
|
||||
}
|
||||
@@ -215,10 +180,6 @@ export class UserSubscriptionComponent implements OnInit {
|
||||
return this.storagePercentage < 5 ? 5 : 0;
|
||||
}
|
||||
|
||||
get usingInAppPurchase() {
|
||||
return this.sub != null ? this.sub.usingInAppPurchase : false;
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
return this.i18nService.t(this.selfHosted ? "subscription" : "premiumMembership");
|
||||
}
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
</app-callout>
|
||||
<p>
|
||||
<i class="bwi bwi-fw" [ngClass]="paymentSourceClasses"></i>
|
||||
<span *ngIf="paymentSourceInApp">{{ "inAppPurchase" | i18n }}</span>
|
||||
{{ paymentSource.description }}
|
||||
</p>
|
||||
</ng-container>
|
||||
|
||||
@@ -106,17 +106,6 @@ export class PaymentMethodComponent implements OnInit {
|
||||
}
|
||||
|
||||
addCredit() {
|
||||
if (this.paymentSourceInApp) {
|
||||
this.dialogService.openSimpleDialog({
|
||||
title: { key: "addCredit" },
|
||||
content: { key: "cannotPerformInAppPurchase" },
|
||||
acceptButtonText: { key: "ok" },
|
||||
cancelButtonText: null,
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
this.showAddCredit = true;
|
||||
}
|
||||
|
||||
@@ -128,18 +117,6 @@ export class PaymentMethodComponent implements OnInit {
|
||||
}
|
||||
|
||||
changePayment() {
|
||||
if (this.paymentSourceInApp) {
|
||||
this.dialogService.openSimpleDialog({
|
||||
title: { key: "changePaymentMethod" },
|
||||
content: { key: "cannotPerformInAppPurchase" },
|
||||
acceptButtonText: { key: "ok" },
|
||||
cancelButtonText: null,
|
||||
type: "warning",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.showAdjustPayment = true;
|
||||
}
|
||||
|
||||
@@ -209,10 +186,6 @@ export class PaymentMethodComponent implements OnInit {
|
||||
return ["bwi-bank"];
|
||||
case PaymentMethodType.Check:
|
||||
return ["bwi-money"];
|
||||
case PaymentMethodType.AppleInApp:
|
||||
return ["bwi-apple text-muted"];
|
||||
case PaymentMethodType.GoogleInApp:
|
||||
return ["bwi-google text-muted"];
|
||||
case PaymentMethodType.PayPal:
|
||||
return ["bwi-paypal text-primary"];
|
||||
default:
|
||||
@@ -220,14 +193,6 @@ export class PaymentMethodComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
get paymentSourceInApp() {
|
||||
return (
|
||||
this.paymentSource != null &&
|
||||
(this.paymentSource.type === PaymentMethodType.AppleInApp ||
|
||||
this.paymentSource.type === PaymentMethodType.GoogleInApp)
|
||||
);
|
||||
}
|
||||
|
||||
get subscription() {
|
||||
return this.sub?.subscription ?? this.org?.subscription ?? null;
|
||||
}
|
||||
|
||||
@@ -3828,15 +3828,6 @@
|
||||
"couldNotChargeCardPayInvoice": {
|
||||
"message": "We were not able to charge your card. Please view and pay the unpaid invoice listed below."
|
||||
},
|
||||
"inAppPurchase": {
|
||||
"message": "In-app purchase"
|
||||
},
|
||||
"cannotPerformInAppPurchase": {
|
||||
"message": "You cannot perform this action while using an in-app purchase payment method."
|
||||
},
|
||||
"manageSubscriptionFromStore": {
|
||||
"message": "You must manage your subscription from the store where your in-app purchase was made."
|
||||
},
|
||||
"minLength": {
|
||||
"message": "Minimum length"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user