Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 <hello@internxt.com>",
"version": "1.15.2",
"version": "1.15.3",
"description": "An sdk for interacting with Internxt's services",
"repository": {
"type": "git",
Expand Down
9 changes: 8 additions & 1 deletion src/drive/referrals/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { headersWithToken } from '../../shared/headers';
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
import { UserReferral } from './types';
import { ReferralTokenResponse, UserReferral } from './types';
import { HttpClient } from '../../shared/http/client';

export * as ReferralTypes from './types';
Expand All @@ -27,6 +27,13 @@ export class Referrals {
return this.client.get('/users-referrals', this.headers());
}

/**
* Generates a referral token for the authenticated user
*/
public createReferralToken(): Promise<ReferralTokenResponse> {
return this.client.post('/referral/token', {}, this.headers());
}

/**
* Returns the needed headers for the module requests
* @private
Expand Down
4 changes: 4 additions & 0 deletions src/drive/referrals/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ export interface UserReferral {
credit: number;
type: ReferralType;
}

export interface ReferralTokenResponse {
token: string;
}
3 changes: 3 additions & 0 deletions src/payments/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export class Checkout {
* @param postalCode - The postal code of the customer
* @param captchaToken - The captcha token to verify the call
* @param companyVatId - The VAT ID of the company (optional)
* @param metadata - Additional metadata to attach to the customer (optional)
* @returns The customer ID and the user token used to create a subscription or payment intent
*/
public createCustomer({
Expand All @@ -49,6 +50,7 @@ export class Checkout {
country,
captchaToken,
companyVatId,
metadata,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to add the jsdoc 👀

}: CreateCustomerPayload): Promise<{
customerId: string;
token: string;
Expand All @@ -64,6 +66,7 @@ export class Checkout {
postalCode,
captchaToken,
companyVatId,
metadata,
},
this.authHeaders(),
);
Expand Down
1 change: 1 addition & 0 deletions src/payments/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface CreateCustomerPayload {
postalCode: string;
captchaToken: string;
companyVatId?: string;
metadata?: Record<string, string>;
}

export interface CreateSubscriptionPayload {
Expand Down
Loading