mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
post bitpay invoice api
This commit is contained in:
parent
2b931963cd
commit
3362334d2c
@ -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<BreachAccountResponse[]>;
|
||||
|
||||
postBitPayInvoice: (request: BitPayInvoiceRequest) => Promise<string>;
|
||||
|
||||
getActiveBearerToken: () => Promise<string>;
|
||||
fetch: (request: Request) => Promise<Response>;
|
||||
}
|
||||
|
9
src/models/request/bitPayInvoiceRequest.ts
Normal file
9
src/models/request/bitPayInvoiceRequest.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export class BitPayInvoiceRequest {
|
||||
userId: string;
|
||||
organizationId: string;
|
||||
credit: boolean;
|
||||
amount: number;
|
||||
returnUrl: string;
|
||||
name: string;
|
||||
email: string;
|
||||
}
|
@ -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<string> {
|
||||
const r = await this.send('POST', '/bitpay-invoice', request, true, true);
|
||||
return r as string;
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
||||
async getActiveBearerToken(): Promise<string> {
|
||||
|
Loading…
Reference in New Issue
Block a user