Skip to content

Commit

Permalink
Merge pull request #183 from internxt/feat/add-currency-to-get-the-co…
Browse files Browse the repository at this point in the history
…rrect-prices

[MKT-217]: feat/add currency param to get the correct prices
  • Loading branch information
xabg2 authored Jan 2, 2024
2 parents 0c3ff28 + 72d493c commit 4ce2dc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internxt/sdk",
"version": "1.4.61",
"version": "1.4.62",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions src/drive/payments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ export class Payments {
});
}

public getPrices(): Promise<DisplayPrice[]> {
return this.client.get<DisplayPrice[]>('/prices', this.headers());
public async getPrices(currency?: string): Promise<DisplayPrice[]> {
const query = new URLSearchParams();
if (currency !== undefined) query.set('currency', currency);
return this.client.get<DisplayPrice[]>(`/prices?${query.toString()}`, this.headers());
}

public requestPreventCancellation(): Promise<FreeTrialAvailable> {
Expand Down
2 changes: 2 additions & 0 deletions src/drive/payments/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export interface DisplayPrice {
bytes: number;
interval: 'year' | 'month' | 'lifetime';
amount: number;
currency: string;
}

export interface CreateCheckoutSessionPayload {
Expand All @@ -116,6 +117,7 @@ export interface CreateCheckoutSessionPayload {
success_url: string;
cancel_url: string;
customer_email: string;
currency?: string;
}

export interface FreeTrialAvailable {
Expand Down

0 comments on commit 4ce2dc7

Please sign in to comment.