support taxid and budget while creating

This commit is contained in:
Damodar Lohani committed 2024-08-29 08:30:49 +05:45
1 parent 708517a0d0
commit eec5c6f1f3
2 files changed
+15 -9

No files matched your search

+6 -2
View File
@@ -309,7 +309,9 @@ export class Billing {
paymentMethodId: string,
billingAddressId: string = undefined,
couponId: string = undefined,
invites: Array<string> = []
invites: Array<string> = [],
budget: number = undefined,
taxId: string = undefined
): Promise<Organization | CreateOrgAuth> {
const path = `/organizations`;
const params = {
@@ -319,7 +321,9 @@ export class Billing {
paymentMethodId,
billingAddressId,
couponId,
invites
invites,
budget,
taxId
};
const uri = new URL(this.client.config.endpoint + path);
return await this.client.call(
@@ -119,7 +119,9 @@
paymentMethodId,
null,
couponData?.code,
collaborators
collaborators,
billingBudget,
taxId
);
if (!isOrganization(org) && org.status == 402) {
@@ -129,9 +131,9 @@
}
//Add budget
if (billingBudget && isOrganization(org)) {
await sdk.forConsole.billing.updateBudget(org.$id, billingBudget, [75]);
}
// if (billingBudget && isOrganization(org)) {
// await sdk.forConsole.billing.updateBudget(org.$id, billingBudget, [75]);
// }
// //Add coupon
// if (couponData?.code) {
@@ -154,9 +156,9 @@
// }
// Add tax ID
if (taxId) {
await sdk.forConsole.billing.updateTaxId(org.$id, taxId);
}
// if (taxId) {
// await sdk.forConsole.billing.updateTaxId(org.$id, taxId);
// }
}
trackEvent(Submit.OrganizationCreate, {