File tree 6 files changed +17
-9
lines changed
6 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ When we make [non-breaking changes](https://developer.paddle.com/api-reference/a
12
12
13
13
This means when upgrading minor versions of the SDK, you may notice type errors. You can safely ignore these or fix by adding additional type guards.
14
14
15
+ ## 1.2.1 - 2024-03-20
16
+
17
+ ### Fixed
18
+
19
+ - Handled missing ` unitPriceOverrides ` in the ` subscriptions.getPaymentMethodChangeTransaction ` operation.
20
+
21
+ ---
22
+
15
23
## 1.2.0 - 2024-03-19
16
24
17
25
### Changed
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @paddle/paddle-node-sdk" ,
3
- "version" : " 1.2.0 " ,
3
+ "version" : " 1.2.1 " ,
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/index.js" ,
6
6
"types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -37,9 +37,8 @@ export class Price {
37
37
this . trialPeriod = price . trial_period ? new TimePeriod ( price . trial_period ) : null ;
38
38
this . taxMode = price . tax_mode ;
39
39
this . unitPrice = new Money ( price . unit_price ) ;
40
- this . unitPriceOverrides = price . unit_price_overrides . map (
41
- ( unit_price_override ) => new UnitPriceOverride ( unit_price_override ) ,
42
- ) ;
40
+ this . unitPriceOverrides =
41
+ price . unit_price_overrides ?. map ( ( unit_price_override ) => new UnitPriceOverride ( unit_price_override ) ) ?? [ ] ;
43
42
this . quantity = new PriceQuantity ( price . quantity ) ;
44
43
this . status = price . status ;
45
44
this . createdAt = price . created_at ;
Original file line number Diff line number Diff line change @@ -43,9 +43,10 @@ export class PriceNotification {
43
43
this . trialPeriod = price . trial_period ? new TimePeriodNotification ( price . trial_period ) : null ;
44
44
this . taxMode = price . tax_mode ;
45
45
this . unitPrice = new MoneyNotification ( price . unit_price ) ;
46
- this . unitPriceOverrides = price . unit_price_overrides . map (
47
- ( unit_price_override ) => new UnitPriceOverrideNotification ( unit_price_override ) ,
48
- ) ;
46
+ this . unitPriceOverrides =
47
+ price . unit_price_overrides ?. map (
48
+ ( unit_price_override ) => new UnitPriceOverrideNotification ( unit_price_override ) ,
49
+ ) ?? [ ] ;
49
50
this . quantity = new PriceQuantityNotification ( price . quantity ) ;
50
51
this . status = price . status ;
51
52
this . createdAt = price . created_at ?? null ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export interface IPriceNotificationResponse {
25
25
trial_period ?: ITimePeriodNotification | null ;
26
26
tax_mode : TaxMode ;
27
27
unit_price : IMoneyNotificationResponse ;
28
- unit_price_overrides : IUnitPriceOverrideNotificationResponse [ ] ;
28
+ unit_price_overrides : IUnitPriceOverrideNotificationResponse [ ] | null ;
29
29
quantity : IPriceQuantityNotification ;
30
30
status : Status ;
31
31
created_at ?: string | null ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export interface IPriceResponse {
25
25
trial_period ?: ITimePeriod | null ;
26
26
tax_mode : TaxMode ;
27
27
unit_price : IMoneyResponse ;
28
- unit_price_overrides : IUnitPriceOverrideResponse [ ] ;
28
+ unit_price_overrides : IUnitPriceOverrideResponse [ ] | null ;
29
29
quantity : IPriceQuantity ;
30
30
status : Status ;
31
31
created_at : string ;
You can’t perform that action at this time.
0 commit comments