Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.9.16",
"version": "1.9.17",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * as Shared from './shared';
export * as Workspaces from './workspaces';
export * from './meet';
export * as Payments from './payments';
export * from './misc';
1 change: 1 addition & 0 deletions src/misc/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './location';
13 changes: 13 additions & 0 deletions src/misc/location/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { HttpClient } from '../../shared/http/client';

export interface UserLocation {
ip: string;
location: string;
}

export const getUserLocation = async (apiUrl: string): Promise<UserLocation> => {
const client = HttpClient.create(apiUrl);
return client.get<UserLocation>(`${apiUrl}`, {
method: 'GET',
});
};
10 changes: 5 additions & 5 deletions src/payments/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ export class Checkout {
* @returns The customer ID and the user token used to create a subscription or payment intent
*/
public getCustomerId({
country,
name,
postalCode,
country,
companyVatId,
companyName,
}: {
country: string;
name: string;
postalCode: string;
country: string;
companyVatId?: string;
companyName?: string;
}): Promise<{
customerId: string;
token: string;
}> {
const query = new URLSearchParams();
query.set('name', name);
query.set('country', country);
query.set('postalCode', postalCode);
if (companyVatId !== undefined) query.set('companyVatId', companyVatId);
if (companyName !== undefined) query.set('companyName', companyName);
return this.client.get(`/checkout/customer?${query.toString()}`, this.authHeaders());
}

Expand Down