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
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ in a response, this weakens the Typescript type but does not cause existing usag
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.

## 3.4.0 - 2025-11-11

### Added

- Added additional support for local Korean payment methods. See [related changelog](https://developer.paddle.com/changelog/2025/improved-korean-payment-methods?utm_source=dx&utm_medium=paddle-node-sdk)

## 3.3.0 - 2025-10-07

### Added
Expand Down Expand Up @@ -447,11 +453,10 @@ see [related changelog](https://developer.paddle.com/changelog/2024/product-pric
### Removed

- **Breaking change:** Removed `*Includes` entity in favour of standard entities.

- Use `Price` instead of `PriceWithIncludes`
- Use `Product` instead of `ProductWithIncludes`
- Use `Subscription` instead of `SubscriptionIncludes`
- Use `Transaction` instead of `TransactionIncludes`
- Use `Price` instead of `PriceWithIncludes`
- Use `Product` instead of `ProductWithIncludes`
- Use `Subscription` instead of `SubscriptionIncludes`
- Use `Transaction` instead of `TransactionIncludes`

---

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paddle/paddle-node-sdk",
"version": "3.3.0",
"version": "3.4.0",
"description": "A Node.js SDK that you can use to integrate Paddle Billing with applications written in server-side JavaScript.",
"main": "dist/cjs/index.cjs.node.js",
"module": "dist/esm/index.esm.node.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export const TransactionCompletedMock: IEventsResponse<ITransactionNotificationR
captured_at: '2023-08-22T07:15:43.792797Z',
method_details: {
card: { type: 'visa', last4: '4242', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Joe Bloggs' },
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand All @@ -213,6 +214,7 @@ export const TransactionCompletedMock: IEventsResponse<ITransactionNotificationR
captured_at: null,
method_details: {
card: { type: 'visa', last4: '0000', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Joe Bloggs' },
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand Down Expand Up @@ -555,6 +557,7 @@ export const TransactionCompletedMockExpectation = {
last4: '4242',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand All @@ -576,6 +579,7 @@ export const TransactionCompletedMockExpectation = {
last4: '0000',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/mocks/notifications/transaction-paid.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export const TransactionPaidMock: IEventsResponse<ITransactionNotificationRespon
captured_at: '2023-04-13T09:07:04.730931Z',
method_details: {
card: { type: 'visa', last4: '3184', expiry_year: 2024, expiry_month: 1, cardholder_name: 'Jo Williams' },
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand Down Expand Up @@ -461,6 +462,7 @@ export const TransactionPaidMockExpectation = {
last4: '3184',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const TransactionPastDueMock: IEventsResponse<ITransactionNotificationRes
captured_at: null,
method_details: {
card: { type: 'visa', last4: '3184', expiry_year: 2025, expiry_month: 1, cardholder_name: 'Jo Williams' },
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand Down Expand Up @@ -387,6 +388,7 @@ export const TransactionPastDueMockExpectation = {
last4: '3184',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const TransactionPaymentFailedMock: IEventsResponse<ITransactionNotificat
captured_at: null,
method_details: {
card: { type: 'visa', last4: '0000', expiry_year: 2025, expiry_month: 12, cardholder_name: 'Jo Williams' },
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand Down Expand Up @@ -491,6 +492,7 @@ export const TransactionPaymentFailedMockExpectation = {
last4: '0000',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export const TransactionRevisedMock: IEventsResponse<ITransactionNotificationRes
expiry_month: 1,
cardholder_name: 'Michael McGovern',
},
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand All @@ -308,6 +309,7 @@ export const TransactionRevisedMock: IEventsResponse<ITransactionNotificationRes
expiry_month: 1,
cardholder_name: 'Michael McGovern',
},
south_korea_local_card: null,
type: 'card',
underlying_details: null,
},
Expand Down Expand Up @@ -632,6 +634,7 @@ export const TransactionRevisedMockExpectation = {
last4: '3184',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand All @@ -653,6 +656,7 @@ export const TransactionRevisedMockExpectation = {
last4: '0002',
type: 'visa',
},
southKoreaLocalCard: null,
type: 'card',
underlyingDetails: null,
},
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/mocks/resources/payment-methods.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const PaymentMethodMock: IPaymentMethodResponse = {
cardholder_name: 'Sam Miller',
},
paypal: null,
south_korea_local_card: null,
underlying_details: null,
origin: 'saved_during_purchase',
saved_at: '2024-05-03T11:50:23.422Z',
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/mocks/resources/transactions.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ export const TransactionMock: ITransactionResponse = {
last4: '',
type: 'american_express',
},
south_korea_local_card: null,
underlying_details: null,
},
created_at: '2024-10-12T07:20:50.52Z',
Expand Down
7 changes: 6 additions & 1 deletion src/entities/payment-method/payment-method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import type { SavedPaymentMethodType, SavedPaymentOrigin } from '../../enums/index.js';
import type { IPaymentMethodResponse } from '../../types/index.js';
import { PaymentCard, PaymentMethodUnderlyingDetails, PayPal } from '../shared/index.js';
import { PaymentCard, PaymentMethodUnderlyingDetails, PayPal, SouthKoreaLocalCard } from '../shared/index.js';

export class PaymentMethod {
public readonly id: string;
Expand All @@ -15,6 +15,8 @@ export class PaymentMethod {
public readonly type: SavedPaymentMethodType;
public readonly card: PaymentCard | null;
public readonly paypal: PayPal | null;
public readonly southKoreaLocalCard: SouthKoreaLocalCard | null;
/** @deprecated */
public readonly underlyingDetails: PaymentMethodUnderlyingDetails | null;
public readonly origin: SavedPaymentOrigin;
public readonly savedAt: string;
Expand All @@ -27,6 +29,9 @@ export class PaymentMethod {
this.type = paymentMethodResponse.type;
this.card = paymentMethodResponse.card ? new PaymentCard(paymentMethodResponse.card) : null;
this.paypal = paymentMethodResponse.paypal ? new PayPal(paymentMethodResponse.paypal) : null;
this.southKoreaLocalCard = paymentMethodResponse.south_korea_local_card
? new SouthKoreaLocalCard(paymentMethodResponse.south_korea_local_card)
: null;
this.underlyingDetails = paymentMethodResponse.underlying_details
? new PaymentMethodUnderlyingDetails(paymentMethodResponse.underlying_details)
: null;
Expand Down
1 change: 1 addition & 0 deletions src/entities/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ export * from './simulation-event-request.js';
export * from './simulation-event-response.js';
export * from './payment-method-underlying-details.js';
export * from './korean-market-underlying-details.js';
export * from './south-korea-local-card.js';
6 changes: 6 additions & 0 deletions src/entities/shared/payment-method-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ import { type PaymentType } from '../../enums/index.js';
import { PaymentCard } from './payment-card.js';
import { type IPaymentMethodDetails } from '../../types/index.js';
import { PaymentMethodUnderlyingDetails } from './payment-method-underlying-details.js';
import { SouthKoreaLocalCard } from './south-korea-local-card.js';

export class PaymentMethodDetails {
public readonly type: PaymentType;
public readonly card: PaymentCard | null;
public readonly southKoreaLocalCard: SouthKoreaLocalCard | null;
/** @deprecated */
public readonly underlyingDetails: PaymentMethodUnderlyingDetails | null;

constructor(paymentMethodDetails: IPaymentMethodDetails) {
this.type = paymentMethodDetails.type;
this.card = paymentMethodDetails.card ? new PaymentCard(paymentMethodDetails.card) : null;
this.southKoreaLocalCard = paymentMethodDetails.south_korea_local_card
? new SouthKoreaLocalCard(paymentMethodDetails.south_korea_local_card)
: null;
this.underlyingDetails = paymentMethodDetails.underlying_details
? new PaymentMethodUnderlyingDetails(paymentMethodDetails.underlying_details)
: null;
Expand Down
18 changes: 18 additions & 0 deletions src/entities/shared/south-korea-local-card.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* ! Autogenerated code !
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/

import { type SouthKoreaLocalCardType } from '../../enums/index.js';
import { type ISouthKoreaLocalCardResponse } from '../../types/index.js';

export class SouthKoreaLocalCard {
public readonly type: SouthKoreaLocalCardType;
public readonly last4: string;

constructor(southKoreaLocalCard: ISouthKoreaLocalCardResponse) {
this.type = southKoreaLocalCard.type;
this.last4 = southKoreaLocalCard.last4;
}
}
10 changes: 9 additions & 1 deletion src/enums/payment-method/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@
* Changes may be overwritten as part of auto-generation.
*/

/**
* @deprecated 'korea_local' is deprecated. Use 'south_korea_local_card', 'kakao_pay', 'naver_pay', 'payco', or 'samsung_pay' instead.
*/
export type SavedPaymentMethodType =
| 'alipay'
| 'apple_pay'
| 'blik'
| 'card'
| 'google_pay'
| 'mb_way'
| 'kakao_pay'
| 'korea_local'
| 'south_korea_local_card'
| 'mb_way'
| 'naver_pay'
| 'payco'
| 'paypal'
| 'pix'
| 'samsung_pay'
| 'upi';
8 changes: 8 additions & 0 deletions src/enums/shared/available-payment-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Changes may be overwritten as part of auto-generation.
*/

/**
* @deprecated 'korea_local' is deprecated. Use 'south_korea_local_card', 'kakao_pay', 'naver_pay', 'payco', or 'samsung_pay' instead.
*/
export type AvailablePaymentMethod =
| 'alipay'
| 'apple_pay'
Expand All @@ -12,8 +15,13 @@ export type AvailablePaymentMethod =
| 'card'
| 'google_pay'
| 'ideal'
| 'kakao_pay'
| 'korea_local'
| 'south_korea_local_card'
| 'mb_way'
| 'naver_pay'
| 'payco'
| 'paypal'
| 'pix'
| 'samsung_pay'
| 'upi';
1 change: 1 addition & 0 deletions src/enums/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ export * from './catalog-type.js';
export * from './available-payment-methods.js';
export * from './disposition.js';
export * from './korean-market-underlying-payment-method-type.js';
export * from './south-korea-local-card-type.js';
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Changes may be overwritten as part of auto-generation.
*/

/**
* @deprecated The following values are deprecated: 'kakaopay', 'naverpaycard', 'naverpaypoint', 'payco', 'samsungpay'
*/
export type KoreanMarketUnderlyingPaymentMethodType =
| 'bc'
| 'citi'
Expand Down
8 changes: 8 additions & 0 deletions src/enums/shared/payment-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Changes may be overwritten as part of auto-generation.
*/

/**
* @deprecated 'korea_local' is deprecated. Use 'south_korea_local_card', 'kakao_pay', 'naver_pay', 'payco', or 'samsung_pay' instead.
*/
export type PaymentType =
| 'alipay'
| 'apple_pay'
Expand All @@ -12,11 +15,16 @@ export type PaymentType =
| 'card'
| 'google_pay'
| 'ideal'
| 'kakao_pay'
| 'korea_local'
| 'south_korea_local_card'
| 'mb_way'
| 'naver_pay'
| 'offline'
| 'payco'
| 'paypal'
| 'pix'
| 'samsung_pay'
| 'unknown'
| 'upi'
| 'wire_transfer';
30 changes: 30 additions & 0 deletions src/enums/shared/south-korea-local-card-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* ! Autogenerated code !
* Do not make changes to this file.
* Changes may be overwritten as part of auto-generation.
*/

export type SouthKoreaLocalCardType =
| 'bc'
| 'citi'
| 'hana'
| 'hyundai'
| 'jeju'
| 'jeonbuk'
| 'kakaobank'
| 'kbank'
| 'kdbbank'
| 'kookmin'
| 'kwangju'
| 'lotte'
| 'mg'
| 'nh'
| 'post'
| 'samsung'
| 'savingsbank'
| 'shinhan'
| 'shinhyup'
| 'suhyup'
| 'tossbank'
| 'unknown'
| 'woori';
1 change: 1 addition & 0 deletions src/notifications/entities/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ export * from './payout-totals-adjustment-notification.js';
export * from './import-meta-notification.js';
export * from './korean-market-underlying-details-notification.js';
export * from './payment-method-underlying-details-notification.js';
export * from './south-korea-local-card-notification.js';
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ import { type PaymentType } from '../../../enums/index.js';
import { PaymentCardNotification } from './payment-card-notification.js';
import { type IPaymentMethodDetailsNotification } from '../../types/index.js';
import { PaymentMethodUnderlyingDetailsNotification } from './payment-method-underlying-details-notification.js';
import { SouthKoreaLocalCardNotification } from './south-korea-local-card-notification.js';

export class PaymentMethodDetailsNotification {
public readonly type: PaymentType;
public readonly card: PaymentCardNotification | null;
public readonly southKoreaLocalCard: SouthKoreaLocalCardNotification | null;
/** @deprecated */
public readonly underlyingDetails: PaymentMethodUnderlyingDetailsNotification | null;

constructor(paymentMethodDetails: IPaymentMethodDetailsNotification) {
this.type = paymentMethodDetails.type;
this.card = paymentMethodDetails.card ? new PaymentCardNotification(paymentMethodDetails.card) : null;
this.southKoreaLocalCard = paymentMethodDetails.south_korea_local_card
? new SouthKoreaLocalCardNotification(paymentMethodDetails.south_korea_local_card)
: null;
this.underlyingDetails = paymentMethodDetails.underlying_details
? new PaymentMethodUnderlyingDetailsNotification(paymentMethodDetails.underlying_details)
: null;
Expand Down
Loading