Skip to content

Commit

Permalink
Merge pull request #259 from internxt/feat/upgrade-existing-business-…
Browse files Browse the repository at this point in the history
…subscription-members

[PB-3313]: feat/update workspace members
  • Loading branch information
xabg2 authored Nov 19, 2024
2 parents 34642b4 + e78aab6 commit 0569b60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@internxt/sdk",
"author": "Internxt <[email protected]>",
"version": "1.6.1",
"version": "1.6.2",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
25 changes: 11 additions & 14 deletions src/drive/payments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,17 @@ export class Payments {
return this.client.put('/subscriptions', { price_id: priceId, couponCode: couponCode, userType }, this.headers());
}

public updateWorkspaceMembers(subscriptionId: string, updatedSeats: number) {
return this.client.patch(
'/business/subscription',
{
subscriptionId,
workspaceUpdatedSeats: updatedSeats,
},
this.headers(),
);
}

public cancelSubscription(userType?: UserType): Promise<void> {
const query = new URLSearchParams();
if (userType) query.set('userType', userType);
Expand All @@ -201,20 +212,6 @@ export class Payments {
return this.client.patch('/billing', { ...payload }, this.headers());
}

public getPaypalSetupIntent({
priceId,
coupon,
}: {
priceId: string;
coupon?: string;
}): Promise<{ client_secret: string }> {
const query = new URLSearchParams();
if (priceId !== undefined) query.set('priceId', priceId);
if (coupon !== undefined) query.set('coupon', coupon);

return this.client.get(`/paypal-setup-intent?${query.toString()}`, this.headers());
}

/**
* Returns the needed headers for the module requests
* @private
Expand Down
4 changes: 4 additions & 0 deletions src/drive/payments/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export type StoragePlan = {
amountOfSeats: number;
isAppSumo?: boolean;
details?: AppSumoDetails;
seats?: {
minimumSeats: number;
maximumSeats: number;
};
};

export interface CreatePaymentSessionPayload {
Expand Down

0 comments on commit 0569b60

Please sign in to comment.