From f5287e29a2a135c131d00c4a56a90b18bc4afaab Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 30 Jun 2018 13:22:21 -0400 Subject: [PATCH] payment update api --- src/abstractions/api.service.ts | 2 ++ src/models/request/paymentRequest.ts | 3 +++ src/services/api.service.ts | 5 +++++ 3 files changed, 10 insertions(+) create mode 100644 src/models/request/paymentRequest.ts diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 83c7a1fd88..6ff853fde4 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -15,6 +15,7 @@ import { ImportOrganizationCiphersRequest } from '../models/request/importOrgani import { PasswordHintRequest } from '../models/request/passwordHintRequest'; import { PasswordRequest } from '../models/request/passwordRequest'; import { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest'; +import { PaymentRequest } from '../models/request/paymentRequest'; import { RegisterRequest } from '../models/request/registerRequest'; import { StorageRequest } from '../models/request/storageRequest'; import { TokenRequest } from '../models/request/tokenRequest'; @@ -69,6 +70,7 @@ export abstract class ApiService { postReinstatePremium: () => Promise; postCancelPremium: () => Promise; postAccountStorage: (request: StorageRequest) => Promise; + postAccountPayment: (request: PaymentRequest) => Promise; postFolder: (request: FolderRequest) => Promise; putFolder: (id: string, request: FolderRequest) => Promise; deleteFolder: (id: string) => Promise; diff --git a/src/models/request/paymentRequest.ts b/src/models/request/paymentRequest.ts new file mode 100644 index 0000000000..710fd18ffc --- /dev/null +++ b/src/models/request/paymentRequest.ts @@ -0,0 +1,3 @@ +export class PaymentRequest { + paymentToken: string; +} diff --git a/src/services/api.service.ts b/src/services/api.service.ts index cf0d7b6bc4..67b603afba 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -21,6 +21,7 @@ import { ImportOrganizationCiphersRequest } from '../models/request/importOrgani import { PasswordHintRequest } from '../models/request/passwordHintRequest'; import { PasswordRequest } from '../models/request/passwordRequest'; import { PasswordVerificationRequest } from '../models/request/passwordVerificationRequest'; +import { PaymentRequest } from '../models/request/paymentRequest'; import { RegisterRequest } from '../models/request/registerRequest'; import { StorageRequest } from '../models/request/storageRequest'; import { TokenRequest } from '../models/request/tokenRequest'; @@ -207,6 +208,10 @@ export class ApiService implements ApiServiceAbstraction { return this.send('POST', '/accounts/storage', request, true, false); } + postAccountPayment(request: PaymentRequest): Promise { + return this.send('POST', '/accounts/payment', request, true, false); + } + // Folder APIs async postFolder(request: FolderRequest): Promise {