Skip to content

Commit

Permalink
Adding latest API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayasingam-paddle committed Feb 14, 2024
1 parent d2b0f3c commit 822318d
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx
### Added

- Added `availablePaymentMethods` as an `include` Parameter to all transaction operations.
- Added `importMeta` to Subscription webhooks.

### Changed

Expand All @@ -23,6 +24,10 @@ Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx

- Fixed `effective_from` enum in Resume subscription operations.

### Deprecated

- Deprecated `storedPaymentMethodId` from transaction payments in favour of `paymentMethodId` field.

---

## 0.3.0 - 2024-01-11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const SubscriptionActivatedMockExpectation = {
startsAt: '2023-08-11T08:07:35.449123Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const SubscriptionCanceledMockExpectation = {
currencyCode: 'USD',
currentBillingPeriod: null,
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const SubscriptionCreatedMockExpectation = {
startsAt: '2023-08-11T08:07:35.449123Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const SubscriptionImportedMockExpectation = {
startsAt: '2023-04-13T09:07:04.730931Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01gxwxe6vzgz6hcsbwjs6zrszr',
discount: null,
firstBilledAt: '2023-04-13T09:07:04.730931Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const SubscriptionPastDueMockExpectation = {
startsAt: '2023-10-11T08:07:35.449123Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const SubscriptionPausedMockExpectation = {
currencyCode: 'USD',
currentBillingPeriod: null,
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const SubscriptionResumedMockExpectation = {
startsAt: '2023-11-11T08:33:04.443903Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const SubscriptionTrialingMockExpectation = {
startsAt: '2023-08-18T13:15:46.864158Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h84cjfwmdph1k8kgsyjt3k7g',
discount: null,
firstBilledAt: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const SubscriptionUpdatedMockExpectation = {
startsAt: '2023-09-11T08:07:35.449123Z',
},
customData: null,
importMeta: null,
customerId: 'ctm_01h7hswb86rtps5ggbq7ybydcw',
discount: null,
firstBilledAt: '2023-08-11T08:07:35.449123Z',
Expand Down
3 changes: 3 additions & 0 deletions src/entities/subscription/subscription-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import {
BillingDetails,
type CustomData,
ImportMeta,
SubscriptionDiscount,
SubscriptionItem,
SubscriptionScheduledChange,
Expand Down Expand Up @@ -39,6 +40,7 @@ export class SubscriptionNotification {
public readonly scheduledChange: SubscriptionScheduledChange | null;
public readonly items: SubscriptionItem[];
public readonly customData: CustomData | null;
public readonly importMeta: ImportMeta | null;

constructor(subscription: ISubscriptionNotificationResponse) {
this.id = subscription.id;
Expand Down Expand Up @@ -67,5 +69,6 @@ export class SubscriptionNotification {
: null;
this.items = subscription.items.map((item) => new SubscriptionItem(item));
this.customData = subscription.custom_data ? subscription.custom_data : null;
this.importMeta = subscription.import_meta ? new ImportMeta(subscription.import_meta) : null;
}
}
2 changes: 2 additions & 0 deletions src/types/subscription/subscription-notification-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import {
type IBillingDetailsResponse,
type ICustomData,
type IImportMetaResponse,
type INextTransactionResponse,
type ISubscriptionDiscountResponse,
type ISubscriptionItemResponse,
Expand Down Expand Up @@ -40,6 +41,7 @@ export interface ISubscriptionNotificationResponse {
scheduled_change?: ISubscriptionScheduledChangeResponse | null;
items: ISubscriptionItemResponse[];
custom_data?: ICustomData | null;
import_meta?: IImportMetaResponse | null;
next_transaction?: INextTransactionResponse | null;
recurring_transaction_details?: ITransactionDetailsPreviewResponse | null;
}

0 comments on commit 822318d

Please sign in to comment.