1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 13:53:34 +00:00

[PM-25463] Work towards complete usage of Payments domain (#16532)

* Use payment domain

* Fixing lint and test issue

* Fix organization plans tax issue

* PM-26297: Use existing billing address for tax calculation if it exists

* PM-26344: Check existing payment method on submit
This commit is contained in:
Alex Morask
2025-10-01 10:26:47 -05:00
committed by GitHub
parent 147b511d64
commit d9d8050998
117 changed files with 1505 additions and 5212 deletions

View File

@@ -90,14 +90,10 @@ import {
} from "../auth/models/response/two-factor-web-authn.response";
import { TwoFactorYubiKeyResponse } from "../auth/models/response/two-factor-yubi-key.response";
import { BitPayInvoiceRequest } from "../billing/models/request/bit-pay-invoice.request";
import { PaymentRequest } from "../billing/models/request/payment.request";
import { TaxInfoUpdateRequest } from "../billing/models/request/tax-info-update.request";
import { BillingHistoryResponse } from "../billing/models/response/billing-history.response";
import { BillingPaymentResponse } from "../billing/models/response/billing-payment.response";
import { PaymentResponse } from "../billing/models/response/payment.response";
import { PlanResponse } from "../billing/models/response/plan.response";
import { SubscriptionResponse } from "../billing/models/response/subscription.response";
import { TaxInfoResponse } from "../billing/models/response/tax-info.response";
import { ClientType, DeviceType } from "../enums";
import { KeyConnectorUserKeyRequest } from "../key-management/key-connector/models/key-connector-user-key.request";
import { SetKeyConnectorKeyRequest } from "../key-management/key-connector/models/set-key-connector-key.request";
@@ -294,11 +290,6 @@ export class ApiService implements ApiServiceAbstraction {
return new SubscriptionResponse(r);
}
async getTaxInfo(): Promise<TaxInfoResponse> {
const r = await this.send("GET", "/accounts/tax", null, true, true);
return new TaxInfoResponse(r);
}
async putProfile(request: UpdateProfileRequest): Promise<ProfileResponse> {
const r = await this.send("PUT", "/accounts/profile", request, true, true);
return new ProfileResponse(r);
@@ -309,10 +300,6 @@ export class ApiService implements ApiServiceAbstraction {
return new ProfileResponse(r);
}
putTaxInfo(request: TaxInfoUpdateRequest): Promise<any> {
return this.send("PUT", "/accounts/tax", request, true, false);
}
async postPrelogin(request: PreloginRequest): Promise<PreloginResponse> {
const env = await firstValueFrom(this.environmentService.environment$);
const r = await this.send(
@@ -365,10 +352,6 @@ export class ApiService implements ApiServiceAbstraction {
return new PaymentResponse(r);
}
postAccountPayment(request: PaymentRequest): Promise<void> {
return this.send("POST", "/accounts/payment", request, true, false);
}
postAccountLicense(data: FormData): Promise<any> {
return this.send("POST", "/accounts/license", data, true, false);
}
@@ -429,11 +412,6 @@ export class ApiService implements ApiServiceAbstraction {
return new BillingHistoryResponse(r);
}
async getUserBillingPayment(): Promise<BillingPaymentResponse> {
const r = await this.send("GET", "/accounts/billing/payment-method", null, true, true);
return new BillingPaymentResponse(r);
}
// Cipher APIs
async getCipher(id: string): Promise<CipherResponse> {