@paddle/paddle-node-sdk 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/entities/customer/auth-token.js +10 -0
- package/dist/cjs/entities/customer/index.js +1 -0
- package/dist/cjs/entities/index.js +1 -0
- package/dist/cjs/entities/payment-method/index.js +18 -0
- package/dist/cjs/entities/payment-method/payment-method-collection.js +11 -0
- package/dist/cjs/entities/payment-method/payment-method.js +18 -0
- package/dist/cjs/entities/shared/index.js +1 -0
- package/dist/cjs/entities/shared/paypal.js +10 -0
- package/dist/cjs/enums/index.js +1 -0
- package/dist/cjs/enums/payment-method/deletion-reason.js +2 -0
- package/dist/cjs/enums/payment-method/index.js +19 -0
- package/dist/cjs/enums/payment-method/origin.js +2 -0
- package/dist/cjs/enums/payment-method/type.js +2 -0
- package/dist/cjs/notifications/entities/index.js +1 -0
- package/dist/cjs/notifications/entities/payment-method/index.js +18 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-deleted-notification.js +16 -0
- package/dist/cjs/notifications/entities/payment-method/payment-method-notification.js +15 -0
- package/dist/cjs/notifications/entities/subscription/index.js +1 -0
- package/dist/cjs/notifications/entities/subscription/subscription-created-notification.js +38 -0
- package/dist/cjs/notifications/entities/subscription/subscription-notification.js +0 -1
- package/dist/cjs/notifications/events/index.js +1 -0
- package/dist/cjs/notifications/events/payment-method/index.js +18 -0
- package/dist/cjs/notifications/events/payment-method/payment-method-deleted-event.js +14 -0
- package/dist/cjs/notifications/events/payment-method/payment-method-saved-event.js +14 -0
- package/dist/cjs/notifications/events/subscription/subscription-created-event.js +1 -1
- package/dist/cjs/notifications/helpers/types.js +2 -0
- package/dist/cjs/notifications/helpers/webhooks.js +4 -0
- package/dist/cjs/notifications/types/index.js +1 -0
- package/dist/cjs/notifications/types/payment-method/index.js +18 -0
- package/dist/cjs/notifications/types/payment-method/payment-method-deleted-notification-response.js +2 -0
- package/dist/cjs/notifications/types/payment-method/payment-method-notification-response.js +2 -0
- package/dist/cjs/notifications/types/subscription/index.js +1 -0
- package/dist/cjs/notifications/types/subscription/subscription-created-notification-response.js +2 -0
- package/dist/cjs/paddle.js +1 -0
- package/dist/cjs/resources/customers/index.js +11 -0
- package/dist/cjs/resources/index.js +1 -0
- package/dist/cjs/resources/payment-methods/index.js +67 -0
- package/dist/cjs/resources/payment-methods/operations/index.js +17 -0
- package/dist/cjs/resources/payment-methods/operations/list-customer-payment-method-query-parameters.js +2 -0
- package/dist/cjs/types/customer/auth-token-response.js +2 -0
- package/dist/cjs/types/customer/index.js +1 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/payment-method/index.js +17 -0
- package/dist/cjs/types/payment-method/payment-method.js +2 -0
- package/dist/cjs/types/shared/index.js +1 -0
- package/dist/cjs/types/shared/paypal.js +2 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/entities/customer/auth-token.js +6 -0
- package/dist/esm/entities/customer/index.js +1 -0
- package/dist/esm/entities/index.js +1 -0
- package/dist/esm/entities/payment-method/index.js +2 -0
- package/dist/esm/entities/payment-method/payment-method-collection.js +7 -0
- package/dist/esm/entities/payment-method/payment-method.js +14 -0
- package/dist/esm/entities/shared/index.js +1 -0
- package/dist/esm/entities/shared/paypal.js +6 -0
- package/dist/esm/enums/index.js +1 -0
- package/dist/esm/enums/payment-method/deletion-reason.js +1 -0
- package/dist/esm/enums/payment-method/index.js +3 -0
- package/dist/esm/enums/payment-method/origin.js +1 -0
- package/dist/esm/enums/payment-method/type.js +1 -0
- package/dist/esm/notifications/entities/index.js +1 -0
- package/dist/esm/notifications/entities/payment-method/index.js +2 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-deleted-notification.js +12 -0
- package/dist/esm/notifications/entities/payment-method/payment-method-notification.js +11 -0
- package/dist/esm/notifications/entities/subscription/index.js +1 -0
- package/dist/esm/notifications/entities/subscription/subscription-created-notification.js +34 -0
- package/dist/esm/notifications/entities/subscription/subscription-notification.js +0 -1
- package/dist/esm/notifications/events/index.js +1 -0
- package/dist/esm/notifications/events/payment-method/index.js +2 -0
- package/dist/esm/notifications/events/payment-method/payment-method-deleted-event.js +10 -0
- package/dist/esm/notifications/events/payment-method/payment-method-saved-event.js +10 -0
- package/dist/esm/notifications/events/subscription/subscription-created-event.js +2 -2
- package/dist/esm/notifications/helpers/types.js +2 -0
- package/dist/esm/notifications/helpers/webhooks.js +5 -1
- package/dist/esm/notifications/types/index.js +1 -0
- package/dist/esm/notifications/types/payment-method/index.js +2 -0
- package/dist/esm/notifications/types/payment-method/payment-method-deleted-notification-response.js +1 -0
- package/dist/esm/notifications/types/payment-method/payment-method-notification-response.js +1 -0
- package/dist/esm/notifications/types/subscription/index.js +1 -0
- package/dist/esm/notifications/types/subscription/subscription-created-notification-response.js +1 -0
- package/dist/esm/paddle.js +2 -1
- package/dist/esm/resources/customers/index.js +12 -1
- package/dist/esm/resources/index.js +1 -0
- package/dist/esm/resources/payment-methods/index.js +49 -0
- package/dist/esm/resources/payment-methods/operations/index.js +1 -0
- package/dist/esm/resources/payment-methods/operations/list-customer-payment-method-query-parameters.js +1 -0
- package/dist/esm/types/customer/auth-token-response.js +1 -0
- package/dist/esm/types/customer/index.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/payment-method/index.js +1 -0
- package/dist/esm/types/payment-method/payment-method.js +1 -0
- package/dist/esm/types/shared/index.js +1 -0
- package/dist/esm/types/shared/paypal.js +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/entities/customer/auth-token.d.ts +6 -0
- package/dist/types/entities/customer/index.d.ts +1 -0
- package/dist/types/entities/index.d.ts +1 -0
- package/dist/types/entities/payment-method/index.d.ts +2 -0
- package/dist/types/entities/payment-method/payment-method-collection.d.ts +6 -0
- package/dist/types/entities/payment-method/payment-method.d.ts +15 -0
- package/dist/types/entities/shared/index.d.ts +1 -0
- package/dist/types/entities/shared/paypal.d.ts +6 -0
- package/dist/types/enums/index.d.ts +1 -0
- package/dist/types/enums/payment-method/deletion-reason.d.ts +1 -0
- package/dist/types/enums/payment-method/index.d.ts +3 -0
- package/dist/types/enums/payment-method/origin.d.ts +1 -0
- package/dist/types/enums/payment-method/type.d.ts +1 -0
- package/dist/types/notifications/entities/index.d.ts +1 -0
- package/dist/types/notifications/entities/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/entities/payment-method/payment-method-deleted-notification.d.ts +13 -0
- package/dist/types/notifications/entities/payment-method/payment-method-notification.d.ts +12 -0
- package/dist/types/notifications/entities/subscription/index.d.ts +1 -0
- package/dist/types/notifications/entities/subscription/subscription-created-notification.d.ts +30 -0
- package/dist/types/notifications/entities/subscription/subscription-notification.d.ts +0 -1
- package/dist/types/notifications/events/index.d.ts +1 -0
- package/dist/types/notifications/events/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/events/payment-method/payment-method-deleted-event.d.ts +10 -0
- package/dist/types/notifications/events/payment-method/payment-method-saved-event.d.ts +10 -0
- package/dist/types/notifications/events/subscription/subscription-activated-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-canceled-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-created-event.d.ts +4 -4
- package/dist/types/notifications/events/subscription/subscription-imported-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-past-due-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-paused-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-resumed-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-trialing-event.d.ts +1 -1
- package/dist/types/notifications/events/subscription/subscription-updated-event.d.ts +1 -1
- package/dist/types/notifications/helpers/types.d.ts +5 -3
- package/dist/types/notifications/types/index.d.ts +1 -0
- package/dist/types/notifications/types/payment-method/index.d.ts +2 -0
- package/dist/types/notifications/types/payment-method/payment-method-deleted-notification-response.d.ts +11 -0
- package/dist/types/notifications/types/payment-method/payment-method-notification-response.d.ts +10 -0
- package/dist/types/notifications/types/subscription/index.d.ts +1 -0
- package/dist/types/notifications/types/subscription/subscription-created-notification-response.d.ts +28 -0
- package/dist/types/notifications/types/subscription/subscription-notification-response.d.ts +0 -1
- package/dist/types/paddle.d.ts +2 -1
- package/dist/types/resources/customers/index.d.ts +2 -1
- package/dist/types/resources/index.d.ts +1 -0
- package/dist/types/resources/payment-methods/index.d.ts +9 -0
- package/dist/types/resources/payment-methods/operations/index.d.ts +1 -0
- package/dist/types/resources/payment-methods/operations/list-customer-payment-method-query-parameters.d.ts +7 -0
- package/dist/types/types/customer/auth-token-response.d.ts +4 -0
- package/dist/types/types/customer/index.d.ts +1 -0
- package/dist/types/types/events/events-response.d.ts +9 -3
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/payment-method/index.d.ts +1 -0
- package/dist/types/types/payment-method/payment-method.d.ts +13 -0
- package/dist/types/types/shared/index.d.ts +1 -0
- package/dist/types/types/shared/paypal.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BillingDetailsNotification, ImportMetaNotification, SubscriptionDiscountNotification, SubscriptionItemNotification, SubscriptionScheduledChangeNotification, SubscriptionTimePeriodNotification, TimePeriodNotification } from '../index';
|
|
2
|
+
import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../../enums';
|
|
3
|
+
import { type ISubscriptionCreatedNotificationResponse } from '../../types';
|
|
4
|
+
import { type CustomData } from '../../../entities';
|
|
5
|
+
export declare class SubscriptionCreatedNotification {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
readonly status: SubscriptionStatus;
|
|
8
|
+
readonly transactionId: string;
|
|
9
|
+
readonly customerId: string;
|
|
10
|
+
readonly addressId: string;
|
|
11
|
+
readonly businessId: string | null;
|
|
12
|
+
readonly currencyCode: CurrencyCode;
|
|
13
|
+
readonly createdAt: string;
|
|
14
|
+
readonly updatedAt: string;
|
|
15
|
+
readonly startedAt: string | null;
|
|
16
|
+
readonly firstBilledAt: string | null;
|
|
17
|
+
readonly nextBilledAt: string | null;
|
|
18
|
+
readonly pausedAt: string | null;
|
|
19
|
+
readonly canceledAt: string | null;
|
|
20
|
+
readonly discount: SubscriptionDiscountNotification | null;
|
|
21
|
+
readonly collectionMode: CollectionMode;
|
|
22
|
+
readonly billingDetails: BillingDetailsNotification | null;
|
|
23
|
+
readonly currentBillingPeriod: SubscriptionTimePeriodNotification | null;
|
|
24
|
+
readonly billingCycle: TimePeriodNotification;
|
|
25
|
+
readonly scheduledChange: SubscriptionScheduledChangeNotification | null;
|
|
26
|
+
readonly items: SubscriptionItemNotification[];
|
|
27
|
+
readonly customData: CustomData | null;
|
|
28
|
+
readonly importMeta: ImportMetaNotification | null;
|
|
29
|
+
constructor(subscription: ISubscriptionCreatedNotificationResponse);
|
|
30
|
+
}
|
|
@@ -5,7 +5,6 @@ import { type CustomData } from '../../../entities';
|
|
|
5
5
|
export declare class SubscriptionNotification {
|
|
6
6
|
readonly id: string;
|
|
7
7
|
readonly status: SubscriptionStatus;
|
|
8
|
-
readonly transactionId: string | null;
|
|
9
8
|
readonly customerId: string;
|
|
10
9
|
readonly addressId: string;
|
|
11
10
|
readonly businessId: string | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { PaymentMethodDeletedNotification } from '../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse } from '../../../types';
|
|
5
|
+
import { type IPaymentMethodDeletedNotificationResponse } from '../../types';
|
|
6
|
+
export declare class PaymentMethodDeletedEvent extends Event {
|
|
7
|
+
readonly eventType = EventName.PaymentMethodDeleted;
|
|
8
|
+
readonly data: PaymentMethodDeletedNotification;
|
|
9
|
+
constructor(response: IEventsResponse<IPaymentMethodDeletedNotificationResponse>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Event } from '../../../entities/events/event';
|
|
2
|
+
import { PaymentMethodNotification } from '../../entities';
|
|
3
|
+
import { EventName } from '../../helpers';
|
|
4
|
+
import { type IEventsResponse } from '../../../types';
|
|
5
|
+
import { type IPaymentMethodNotificationResponse } from '../../types';
|
|
6
|
+
export declare class PaymentMethodSavedEvent extends Event {
|
|
7
|
+
readonly eventType = EventName.PaymentMethodSaved;
|
|
8
|
+
readonly data: PaymentMethodNotification;
|
|
9
|
+
constructor(response: IEventsResponse<IPaymentMethodNotificationResponse>);
|
|
10
|
+
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionActivatedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionActivated;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionCanceledEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionCanceled;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Event } from '../../../entities/events/event';
|
|
2
|
-
import {
|
|
2
|
+
import { SubscriptionCreatedNotification } from '../../entities';
|
|
3
3
|
import { EventName } from '../../helpers';
|
|
4
4
|
import { type IEventsResponse } from '../../../types';
|
|
5
|
-
import { type
|
|
5
|
+
import { type ISubscriptionCreatedNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionCreatedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionCreated;
|
|
8
|
-
readonly data:
|
|
9
|
-
constructor(response: IEventsResponse<
|
|
8
|
+
readonly data: SubscriptionCreatedNotification;
|
|
9
|
+
constructor(response: IEventsResponse<ISubscriptionCreatedNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionImportedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionImported;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionPastDueEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionPastDue;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionPausedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionPaused;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionResumedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionResumed;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionTrialingEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionTrialing;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@ import { type IEventsResponse } from '../../../types';
|
|
|
5
5
|
import { type ISubscriptionNotificationResponse } from '../../types';
|
|
6
6
|
export declare class SubscriptionUpdatedEvent extends Event {
|
|
7
7
|
readonly eventType = EventName.SubscriptionUpdated;
|
|
8
|
-
readonly data:
|
|
8
|
+
readonly data: SubscriptionNotification;
|
|
9
9
|
constructor(response: IEventsResponse<ISubscriptionNotificationResponse>);
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AddressCreatedEvent, type AddressUpdatedEvent, type AddressImportedEvent, type BusinessCreatedEvent, type AdjustmentCreatedEvent, type AdjustmentUpdatedEvent, type BusinessUpdatedEvent, type CustomerCreatedEvent, type CustomerUpdatedEvent, type DiscountCreatedEvent, type DiscountImportedEvent, type DiscountUpdatedEvent, type PayoutCreatedEvent, type PayoutPaidEvent, type PriceCreatedEvent, type PriceUpdatedEvent, type ProductCreatedEvent, type ProductUpdatedEvent, type SubscriptionCreatedEvent, type SubscriptionActivatedEvent, type SubscriptionCanceledEvent, type SubscriptionImportedEvent, type SubscriptionPausedEvent, type SubscriptionResumedEvent, type SubscriptionTrialingEvent, type SubscriptionUpdatedEvent, type TransactionCanceledEvent, type TransactionBilledEvent, type TransactionCompletedEvent, type TransactionCreatedEvent, type TransactionPaidEvent, type SubscriptionPastDueEvent, type TransactionPastDueEvent, type TransactionPaymentFailedEvent, type TransactionReadyEvent, type TransactionUpdatedEvent, type ReportUpdatedEvent, type ReportCreatedEvent, type BusinessImportedEvent, type CustomerImportedEvent, type PriceImportedEvent, type ProductImportedEvent } from '../events';
|
|
2
|
-
export type EventEntity = AddressCreatedEvent | AddressUpdatedEvent | AddressImportedEvent | AdjustmentUpdatedEvent | AdjustmentCreatedEvent | BusinessCreatedEvent | BusinessUpdatedEvent | BusinessImportedEvent | CustomerCreatedEvent | CustomerUpdatedEvent | CustomerImportedEvent | DiscountCreatedEvent | DiscountUpdatedEvent | DiscountImportedEvent | PayoutCreatedEvent | PayoutPaidEvent | PriceCreatedEvent | PriceUpdatedEvent | PriceImportedEvent | ProductCreatedEvent | ProductUpdatedEvent | ProductImportedEvent | SubscriptionActivatedEvent | SubscriptionCanceledEvent | SubscriptionCreatedEvent | SubscriptionImportedEvent | SubscriptionPastDueEvent | SubscriptionPausedEvent | SubscriptionResumedEvent | SubscriptionTrialingEvent | SubscriptionUpdatedEvent | TransactionBilledEvent | TransactionCanceledEvent | TransactionCompletedEvent | TransactionCreatedEvent | TransactionPaidEvent | TransactionPastDueEvent | TransactionPaymentFailedEvent | TransactionReadyEvent | TransactionUpdatedEvent | ReportUpdatedEvent | ReportCreatedEvent;
|
|
1
|
+
import { type AddressCreatedEvent, type AddressUpdatedEvent, type AddressImportedEvent, type BusinessCreatedEvent, type AdjustmentCreatedEvent, type AdjustmentUpdatedEvent, type BusinessUpdatedEvent, type CustomerCreatedEvent, type CustomerUpdatedEvent, type DiscountCreatedEvent, type DiscountImportedEvent, type DiscountUpdatedEvent, type PaymentMethodDeletedEvent, type PaymentMethodSavedEvent, type PayoutCreatedEvent, type PayoutPaidEvent, type PriceCreatedEvent, type PriceUpdatedEvent, type ProductCreatedEvent, type ProductUpdatedEvent, type SubscriptionCreatedEvent, type SubscriptionActivatedEvent, type SubscriptionCanceledEvent, type SubscriptionImportedEvent, type SubscriptionPausedEvent, type SubscriptionResumedEvent, type SubscriptionTrialingEvent, type SubscriptionUpdatedEvent, type TransactionCanceledEvent, type TransactionBilledEvent, type TransactionCompletedEvent, type TransactionCreatedEvent, type TransactionPaidEvent, type SubscriptionPastDueEvent, type TransactionPastDueEvent, type TransactionPaymentFailedEvent, type TransactionReadyEvent, type TransactionUpdatedEvent, type ReportUpdatedEvent, type ReportCreatedEvent, type BusinessImportedEvent, type CustomerImportedEvent, type PriceImportedEvent, type ProductImportedEvent } from '../events';
|
|
2
|
+
export type EventEntity = AddressCreatedEvent | AddressUpdatedEvent | AddressImportedEvent | AdjustmentUpdatedEvent | AdjustmentCreatedEvent | BusinessCreatedEvent | BusinessUpdatedEvent | BusinessImportedEvent | CustomerCreatedEvent | CustomerUpdatedEvent | CustomerImportedEvent | DiscountCreatedEvent | DiscountUpdatedEvent | DiscountImportedEvent | PaymentMethodDeletedEvent | PaymentMethodSavedEvent | PayoutCreatedEvent | PayoutPaidEvent | PriceCreatedEvent | PriceUpdatedEvent | PriceImportedEvent | ProductCreatedEvent | ProductUpdatedEvent | ProductImportedEvent | SubscriptionActivatedEvent | SubscriptionCanceledEvent | SubscriptionCreatedEvent | SubscriptionImportedEvent | SubscriptionPastDueEvent | SubscriptionPausedEvent | SubscriptionResumedEvent | SubscriptionTrialingEvent | SubscriptionUpdatedEvent | TransactionBilledEvent | TransactionCanceledEvent | TransactionCompletedEvent | TransactionCreatedEvent | TransactionPaidEvent | TransactionPastDueEvent | TransactionPaymentFailedEvent | TransactionReadyEvent | TransactionUpdatedEvent | ReportUpdatedEvent | ReportCreatedEvent;
|
|
3
3
|
export declare enum EventName {
|
|
4
4
|
AddressCreated = "address.created",
|
|
5
5
|
AddressUpdated = "address.updated",
|
|
@@ -15,6 +15,8 @@ export declare enum EventName {
|
|
|
15
15
|
DiscountCreated = "discount.created",
|
|
16
16
|
DiscountUpdated = "discount.updated",
|
|
17
17
|
DiscountImported = "discount.imported",
|
|
18
|
+
PaymentMethodDeleted = "payment_method.deleted",
|
|
19
|
+
PaymentMethodSaved = "payment_method.saved",
|
|
18
20
|
PayoutCreated = "payout.created",
|
|
19
21
|
PayoutPaid = "payout.paid",
|
|
20
22
|
PriceCreated = "price.created",
|
|
@@ -44,4 +46,4 @@ export declare enum EventName {
|
|
|
44
46
|
ReportCreated = "report.created",
|
|
45
47
|
ReportUpdated = "report.updated"
|
|
46
48
|
}
|
|
47
|
-
export type IEventName = 'address.created' | 'address.updated' | 'address.imported' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'business.imported' | 'customer.created' | 'customer.imported' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payout.created' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'price.imported' | 'product.updated' | 'product.created' | 'product.imported' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated' | 'report.created' | 'report.updated';
|
|
49
|
+
export type IEventName = 'address.created' | 'address.updated' | 'address.imported' | 'adjustment.created' | 'adjustment.updated' | 'business.created' | 'business.updated' | 'business.imported' | 'customer.created' | 'customer.imported' | 'customer.updated' | 'discount.created' | 'discount.updated' | 'discount.imported' | 'payment_method.saved' | 'payment_method.deleted' | 'payout.created' | 'payout.updated' | 'payout.paid' | 'price.updated' | 'price.created' | 'price.imported' | 'product.updated' | 'product.created' | 'product.imported' | 'subscription.activated' | 'subscription.canceled' | 'subscription.imported' | 'subscription.created' | 'subscription.past_due' | 'subscription.paused' | 'subscription.resumed' | 'subscription.trialing' | 'subscription.updated' | 'transaction.billed' | 'transaction.canceled' | 'transaction.completed' | 'transaction.paid' | 'transaction.created' | 'transaction.past_due' | 'transaction.payment_failed' | 'transaction.ready' | 'transaction.updated' | 'report.created' | 'report.updated';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SavedPaymentDeletionReason, type SavedPaymentMethodType, type SavedPaymentOrigin } from '../../../enums';
|
|
2
|
+
export interface IPaymentMethodDeletedNotificationResponse {
|
|
3
|
+
id: string;
|
|
4
|
+
customer_id: string;
|
|
5
|
+
address_id: string;
|
|
6
|
+
deletion_reason: SavedPaymentDeletionReason;
|
|
7
|
+
type: SavedPaymentMethodType;
|
|
8
|
+
origin: SavedPaymentOrigin;
|
|
9
|
+
saved_at: string;
|
|
10
|
+
updated_at: string;
|
|
11
|
+
}
|
package/dist/types/notifications/types/payment-method/payment-method-notification-response.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SavedPaymentMethodType, type SavedPaymentOrigin } from '../../../enums';
|
|
2
|
+
export interface IPaymentMethodNotificationResponse {
|
|
3
|
+
id: string;
|
|
4
|
+
customer_id: string;
|
|
5
|
+
address_id: string;
|
|
6
|
+
type: SavedPaymentMethodType;
|
|
7
|
+
origin: SavedPaymentOrigin;
|
|
8
|
+
saved_at: string;
|
|
9
|
+
updated_at: string;
|
|
10
|
+
}
|
package/dist/types/notifications/types/subscription/subscription-created-notification-response.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type IBillingDetailsNotificationResponse, type IImportMetaNotificationResponse, type ISubscriptionDiscountNotificationResponse, type ISubscriptionItemNotificationResponse, type ISubscriptionScheduledChangeNotificationResponse, type ISubscriptionTimePeriodNotificationResponse, type ITimePeriodNotification } from '../index';
|
|
2
|
+
import { type CollectionMode, type CurrencyCode, type SubscriptionStatus } from '../../../enums';
|
|
3
|
+
import { type ICustomData } from '../../../types';
|
|
4
|
+
export interface ISubscriptionCreatedNotificationResponse {
|
|
5
|
+
id: string;
|
|
6
|
+
status: SubscriptionStatus;
|
|
7
|
+
transaction_id: string;
|
|
8
|
+
customer_id: string;
|
|
9
|
+
address_id: string;
|
|
10
|
+
business_id?: string | null;
|
|
11
|
+
currency_code: CurrencyCode;
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
started_at?: string | null;
|
|
15
|
+
first_billed_at?: string | null;
|
|
16
|
+
next_billed_at?: string | null;
|
|
17
|
+
paused_at?: string | null;
|
|
18
|
+
canceled_at?: string | null;
|
|
19
|
+
discount?: ISubscriptionDiscountNotificationResponse | null;
|
|
20
|
+
collection_mode: CollectionMode;
|
|
21
|
+
billing_details?: IBillingDetailsNotificationResponse | null;
|
|
22
|
+
current_billing_period?: ISubscriptionTimePeriodNotificationResponse | null;
|
|
23
|
+
billing_cycle: ITimePeriodNotification;
|
|
24
|
+
scheduled_change?: ISubscriptionScheduledChangeNotificationResponse | null;
|
|
25
|
+
items: ISubscriptionItemNotificationResponse[];
|
|
26
|
+
custom_data?: ICustomData | null;
|
|
27
|
+
import_meta?: IImportMetaNotificationResponse | null;
|
|
28
|
+
}
|
package/dist/types/paddle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource } from './resources';
|
|
1
|
+
import { AddressesResource, AdjustmentsResource, BusinessesResource, CustomersResource, DiscountsResource, EventTypesResource, NotificationSettingsResource, NotificationsResource, PaymentMethodsResource, PricesResource, PricingPreviewResource, ProductsResource, ReportsResource, SimulationTypesResource, SimulationsResource, SimulationRunsResource, SimulationRunEventsResource, SubscriptionsResource, TransactionsResource } from './resources';
|
|
2
2
|
import { type PaddleOptions } from './internal';
|
|
3
3
|
import { EventsResource } from './resources/events';
|
|
4
4
|
import { Webhooks } from './notifications';
|
|
@@ -14,6 +14,7 @@ export declare class Paddle {
|
|
|
14
14
|
businesses: BusinessesResource;
|
|
15
15
|
discounts: DiscountsResource;
|
|
16
16
|
subscriptions: SubscriptionsResource;
|
|
17
|
+
paymentMethods: PaymentMethodsResource;
|
|
17
18
|
pricingPreview: PricingPreviewResource;
|
|
18
19
|
events: EventsResource;
|
|
19
20
|
webhooks: Webhooks;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreditBalance, Customer, CustomerCollection } from '../../entities';
|
|
1
|
+
import { CreditBalance, Customer, CustomerCollection, AuthToken } from '../../entities';
|
|
2
2
|
import { BaseResource } from '../../internal/base';
|
|
3
3
|
import { type CreateCustomerRequestBody, type GetCreditBalanceQueryParameters, type ListCustomerQueryParameters, type UpdateCustomerRequestBody } from './operations';
|
|
4
4
|
export * from './operations';
|
|
@@ -9,4 +9,5 @@ export declare class CustomersResource extends BaseResource {
|
|
|
9
9
|
update(customerId: string, updateCustomer: UpdateCustomerRequestBody): Promise<Customer>;
|
|
10
10
|
getCreditBalance(customerId: string, queryParams?: GetCreditBalanceQueryParameters): Promise<CreditBalance[]>;
|
|
11
11
|
archive(customerId: string): Promise<Customer>;
|
|
12
|
+
generateAuthToken(customerId: string): Promise<AuthToken>;
|
|
12
13
|
}
|
|
@@ -7,6 +7,7 @@ export * from './prices';
|
|
|
7
7
|
export * from './products';
|
|
8
8
|
export * from './subscriptions';
|
|
9
9
|
export * from './transactions';
|
|
10
|
+
export * from './payment-methods';
|
|
10
11
|
export * from './pricing-preview';
|
|
11
12
|
export * from './event-types';
|
|
12
13
|
export * from './notification-settings';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PaymentMethod, PaymentMethodCollection } from '../../entities';
|
|
2
|
+
import { BaseResource } from '../../internal/base';
|
|
3
|
+
import { type ListCustomerPaymentMethodQueryParameters } from './operations';
|
|
4
|
+
export * from './operations';
|
|
5
|
+
export declare class PaymentMethodsResource extends BaseResource {
|
|
6
|
+
list(customerId: string, queryParams?: ListCustomerPaymentMethodQueryParameters): PaymentMethodCollection;
|
|
7
|
+
get(customerId: string, paymentMethodId: string): Promise<PaymentMethod>;
|
|
8
|
+
delete(customerId: string, paymentMethodId: string): Promise<undefined>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list-customer-payment-method-query-parameters';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EventName, type IAddressNotificationResponse, type IAdjustmentNotificationResponse, type IBusinessNotificationResponse, type ICustomerNotificationResponse, type IDiscountNotificationResponse, type IPayoutNotificationResponse, type IPriceNotificationResponse, type IProductNotificationResponse, type IReportNotificationResponse, type ISubscriptionNotificationResponse, type ITransactionNotificationResponse } from '../../notifications';
|
|
1
|
+
import { type EventName, type IAddressNotificationResponse, type IAdjustmentNotificationResponse, type IBusinessNotificationResponse, type ICustomerNotificationResponse, type IDiscountNotificationResponse, type IPaymentMethodNotificationResponse, type IPaymentMethodDeletedNotificationResponse, type IPayoutNotificationResponse, type IPriceNotificationResponse, type IProductNotificationResponse, type IReportNotificationResponse, type ISubscriptionCreatedNotificationResponse, type ISubscriptionNotificationResponse, type ITransactionNotificationResponse } from '../../notifications';
|
|
2
2
|
export interface IEventsResponse<T = object> {
|
|
3
3
|
event_id: string;
|
|
4
4
|
notification_id: string | null;
|
|
@@ -48,6 +48,12 @@ interface IDiscountUpdated extends IEventsResponse<IDiscountNotificationResponse
|
|
|
48
48
|
interface IDiscountImported extends IEventsResponse<IDiscountNotificationResponse> {
|
|
49
49
|
event_type: EventName.DiscountImported;
|
|
50
50
|
}
|
|
51
|
+
interface IPaymentMethodDeleted extends IEventsResponse<IPaymentMethodDeletedNotificationResponse> {
|
|
52
|
+
event_type: EventName.PaymentMethodDeleted;
|
|
53
|
+
}
|
|
54
|
+
interface IPaymentMethodSaved extends IEventsResponse<IPaymentMethodNotificationResponse> {
|
|
55
|
+
event_type: EventName.PaymentMethodSaved;
|
|
56
|
+
}
|
|
51
57
|
interface IPayoutCreated extends IEventsResponse<IPayoutNotificationResponse> {
|
|
52
58
|
event_type: EventName.PayoutCreated;
|
|
53
59
|
}
|
|
@@ -78,7 +84,7 @@ interface ISubscriptionActivated extends IEventsResponse<ISubscriptionNotificati
|
|
|
78
84
|
interface ISubscriptionCanceled extends IEventsResponse<ISubscriptionNotificationResponse> {
|
|
79
85
|
event_type: EventName.SubscriptionCanceled;
|
|
80
86
|
}
|
|
81
|
-
interface ISubscriptionCreated extends IEventsResponse<
|
|
87
|
+
interface ISubscriptionCreated extends IEventsResponse<ISubscriptionCreatedNotificationResponse> {
|
|
82
88
|
event_type: EventName.SubscriptionCreated;
|
|
83
89
|
}
|
|
84
90
|
interface ISubscriptionImported extends IEventsResponse<ISubscriptionNotificationResponse> {
|
|
@@ -132,5 +138,5 @@ interface IReportCreated extends IEventsResponse<IReportNotificationResponse> {
|
|
|
132
138
|
interface IReportUpdated extends IEventsResponse<IReportNotificationResponse> {
|
|
133
139
|
event_type: EventName.ReportUpdated;
|
|
134
140
|
}
|
|
135
|
-
export type IEvents = IAddressCreated | IAddressUpdated | IAddressImported | IAdjustmentCreated | IAdjustmentUpdated | IBusinessCreated | IBusinessUpdated | IBusinessImported | ICustomerCreated | ICustomerUpdated | ICustomerImported | IDiscountCreated | IDiscountUpdated | IDiscountImported | IPayoutCreated | IPayoutPaid | IPriceCreated | IPriceUpdated | IPriceImported | IProductCreated | IProductUpdated | IProductImported | ISubscriptionActivated | ISubscriptionCanceled | ISubscriptionCreated | ISubscriptionImported | ISubscriptionPastDue | ISubscriptionPaused | ISubscriptionResumed | ISubscriptionTrialing | ISubscriptionUpdated | ITransactionBilled | ITransactionCanceled | ITransactionCompleted | ITransactionCreated | ITransactionPaid | ITransactionPastDue | ITransactionPaymentFailed | ITransactionReady | ITransactionUpdated | IReportCreated | IReportUpdated;
|
|
141
|
+
export type IEvents = IAddressCreated | IAddressUpdated | IAddressImported | IAdjustmentCreated | IAdjustmentUpdated | IBusinessCreated | IBusinessUpdated | IBusinessImported | ICustomerCreated | ICustomerUpdated | ICustomerImported | IDiscountCreated | IDiscountUpdated | IDiscountImported | IPaymentMethodDeleted | IPaymentMethodSaved | IPayoutCreated | IPayoutPaid | IPriceCreated | IPriceUpdated | IPriceImported | IProductCreated | IProductUpdated | IProductImported | ISubscriptionActivated | ISubscriptionCanceled | ISubscriptionCreated | ISubscriptionImported | ISubscriptionPastDue | ISubscriptionPaused | ISubscriptionResumed | ISubscriptionTrialing | ISubscriptionUpdated | ITransactionBilled | ITransactionCanceled | ITransactionCompleted | ITransactionCreated | ITransactionPaid | ITransactionPastDue | ITransactionPaymentFailed | ITransactionReady | ITransactionUpdated | IReportCreated | IReportUpdated;
|
|
136
142
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './payment-method';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IPaymentCardResponse, type IPayPalResponse } from '../';
|
|
2
|
+
import { type SavedPaymentMethodType, type SavedPaymentOrigin } from '../../enums';
|
|
3
|
+
export interface IPaymentMethodResponse {
|
|
4
|
+
id: string;
|
|
5
|
+
customer_id: string;
|
|
6
|
+
address_id: string;
|
|
7
|
+
type: SavedPaymentMethodType;
|
|
8
|
+
card?: IPaymentCardResponse | null;
|
|
9
|
+
paypal?: IPayPalResponse | null;
|
|
10
|
+
origin: SavedPaymentOrigin;
|
|
11
|
+
saved_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
}
|
|
@@ -14,6 +14,7 @@ export * from './adjustment-original-amount-response';
|
|
|
14
14
|
export * from './chargeback-fee';
|
|
15
15
|
export * from './transaction-payout-totals-adjusted-response';
|
|
16
16
|
export * from './unit-totals';
|
|
17
|
+
export * from './paypal';
|
|
17
18
|
export * from './payment-card-response';
|
|
18
19
|
export * from './payment-method-details';
|
|
19
20
|
export * from './transaction-payment-attempt-response';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.10.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paddle/paddle-node-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|