Implemented tax collection for subscriptions (#215)
This commit is contained in:
parent
93a3053f54
commit
0565d6f667
|
@ -99,6 +99,7 @@ import { SendResponse } from '../models/response/sendResponse';
|
|||
import { SubscriptionResponse } from '../models/response/subscriptionResponse';
|
||||
import { SyncResponse } from '../models/response/syncResponse';
|
||||
import { TaxInfoResponse } from '../models/response/taxInfoResponse';
|
||||
import { TaxRateResponse } from '../models/response/taxRateResponse';
|
||||
import { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';
|
||||
import { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';
|
||||
import { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';
|
||||
|
@ -299,6 +300,7 @@ export abstract class ApiService {
|
|||
postOrganizationReinstate: (id: string) => Promise<any>;
|
||||
deleteOrganization: (id: string, request: PasswordVerificationRequest) => Promise<any>;
|
||||
getPlans: () => Promise<ListResponse<PlanResponse>>;
|
||||
getTaxRates: () => Promise<ListResponse<TaxRateResponse>>;
|
||||
|
||||
getEvents: (start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;
|
||||
getEventsCipher: (id: string, start: string, end: string, token: string) => Promise<ListResponse<EventResponse>>;
|
||||
|
|
|
@ -6,4 +6,6 @@ export class OrganizationUpgradeRequest {
|
|||
additionalSeats: number;
|
||||
additionalStorageGb: number;
|
||||
premiumAccessAddon: boolean;
|
||||
billingAddressCountry: string;
|
||||
billingAddressPostalCode: string;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { BaseResponse } from './baseResponse';
|
||||
|
||||
export class TaxRateResponse extends BaseResponse {
|
||||
id: string;
|
||||
country: string;
|
||||
state: string;
|
||||
postalCode: string;
|
||||
rate: number;
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
this.id = this.getResponseProperty('Id');
|
||||
this.country = this.getResponseProperty('Country');
|
||||
this.state = this.getResponseProperty('State');
|
||||
this.postalCode = this.getResponseProperty('PostalCode');
|
||||
this.rate = this.getResponseProperty('Rate');
|
||||
}
|
||||
}
|
|
@ -104,6 +104,7 @@ import { SendResponse } from '../models/response/sendResponse';
|
|||
import { SubscriptionResponse } from '../models/response/subscriptionResponse';
|
||||
import { SyncResponse } from '../models/response/syncResponse';
|
||||
import { TaxInfoResponse } from '../models/response/taxInfoResponse';
|
||||
import { TaxRateResponse } from '../models/response/taxRateResponse';
|
||||
import { TwoFactorAuthenticatorResponse } from '../models/response/twoFactorAuthenticatorResponse';
|
||||
import { TwoFactorDuoResponse } from '../models/response/twoFactorDuoResponse';
|
||||
import { TwoFactorEmailResponse } from '../models/response/twoFactorEmailResponse';
|
||||
|
@ -760,6 +761,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||
return this.send('POST', '/organizations/' + organizationId + '/import', request, true, false);
|
||||
}
|
||||
|
||||
async getTaxRates(): Promise<ListResponse<TaxRateResponse>> {
|
||||
const r = await this.send('GET', '/plans/sales-tax-rates/', null, true, true);
|
||||
return new ListResponse(r, TaxRateResponse);
|
||||
}
|
||||
|
||||
// Settings APIs
|
||||
|
||||
async getSettingsDomains(): Promise<DomainsResponse> {
|
||||
|
|
Loading…
Reference in New Issue