diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index ed77c77506..3de4ffce01 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -1,5 +1,6 @@ import { EnvironmentUrls } from '../models/domain/environmentUrls'; +import { BitPayInvoiceRequest } from '../models/request/bitPayInvoiceRequest'; import { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest'; import { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest'; import { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest'; @@ -253,6 +254,8 @@ export abstract class ApiService { getHibpBreach: (username: string) => Promise; + postBitPayInvoice: (request: BitPayInvoiceRequest) => Promise; + getActiveBearerToken: () => Promise; fetch: (request: Request) => Promise; } diff --git a/src/models/request/bitPayInvoiceRequest.ts b/src/models/request/bitPayInvoiceRequest.ts new file mode 100644 index 0000000000..2d1369ea6c --- /dev/null +++ b/src/models/request/bitPayInvoiceRequest.ts @@ -0,0 +1,9 @@ +export class BitPayInvoiceRequest { + userId: string; + organizationId: string; + credit: boolean; + amount: number; + returnUrl: string; + name: string; + email: string; +} diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 692ac69dc5..f7ecedba82 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -6,6 +6,7 @@ import { TokenService } from '../abstractions/token.service'; import { EnvironmentUrls } from '../models/domain/environmentUrls'; +import { BitPayInvoiceRequest } from '../models/request/bitPayInvoiceRequest'; import { CipherBulkDeleteRequest } from '../models/request/cipherBulkDeleteRequest'; import { CipherBulkMoveRequest } from '../models/request/cipherBulkMoveRequest'; import { CipherBulkShareRequest } from '../models/request/cipherBulkShareRequest'; @@ -837,6 +838,13 @@ export class ApiService implements ApiServiceAbstraction { return r.map((a: any) => new BreachAccountResponse(a)); } + // Misc + + async postBitPayInvoice(request: BitPayInvoiceRequest): Promise { + const r = await this.send('POST', '/bitpay-invoice', request, true, true); + return r as string; + } + // Helpers async getActiveBearerToken(): Promise {