connectbase-client 3.54.0 → 4.0.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 CHANGED
@@ -3,6 +3,36 @@
3
3
  본 SDK 의 모든 주요 변경사항을 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/) 형식으로 기록합니다.
4
4
  버전은 [Semantic Versioning](https://semver.org/lang/ko/) 을 따릅니다.
5
5
 
6
+ ## [4.0.0] - 2026-07-23
7
+
8
+ ### Changed — ⚠️ BREAKING: MoR 결제 필드 프로바이더 중립화 + Dodo Payments 지원
9
+
10
+ Paddle 전용이던 결제/구독 필드를 프로바이더 중립(MoR = Merchant of Record) 이름으로 정규화하고,
11
+ `dodo`(Dodo Payments)를 새 MoR 프로바이더로 추가했다. 결제 엔진을 Paddle↔Dodo(향후 Polar/Lemon
12
+ Squeezy) 간에 코드 변경 없이 바꿀 수 있다.
13
+
14
+ **필드 리네임 (subscription / payment 응답·요청):**
15
+
16
+ | 이전 (`paddle_*`) | 이후 (중립) |
17
+ |---|---|
18
+ | `paddle_price_id` | `provider_price_ref` |
19
+ | `paddle_transaction_id` | `provider_ref` |
20
+ | `paddle_client_token` | `client_token` |
21
+ | `paddle_environment` | `environment` |
22
+ | `paddle_checkout_url` | `checkout_url` |
23
+ | `new_paddle_price_id` | `new_provider_price_ref` |
24
+
25
+ **추가:**
26
+ - checkout 응답에 `launch_mode`(`"overlay"` | `"redirect"`) — 프론트가 결제창 여는 방식을 결정
27
+ (Paddle=오버레이 client_token, Dodo=리다이렉트 checkout_url).
28
+ - provider 유니온에 `"dodo"`.
29
+
30
+ **마이그레이션:** `cb.subscription.create/changePlan/previewChangePlan`, `cb.payment.prepare/confirm`
31
+ 사용부에서 `paddle_price_id`→`provider_price_ref`, `paddle_transaction_id`→`provider_ref`,
32
+ `paddle_client_token`→`client_token`, `paddle_environment`→`environment`,
33
+ `paddle_checkout_url`→`checkout_url` 로 교체. `proration_mode`/`on_payment_failure` 값 어휘는 그대로
34
+ (프로바이더 중립 어휘로 문서화).
35
+
6
36
  ## [3.54.0] - 2026-07-23
7
37
 
8
38
  ### Added — 구독 요금제 스왑 + Paddle proration (`cb.subscription.changePlan` / `previewChangePlan`)
package/dist/index.d.mts CHANGED
@@ -5173,7 +5173,7 @@ declare class OAuthAPI {
5173
5173
  } | null>;
5174
5174
  }
5175
5175
 
5176
- type PaymentProvider = "toss" | "stripe" | "payapp" | "paypal" | "paddle";
5176
+ type PaymentProvider = "toss" | "stripe" | "payapp" | "paypal" | "paddle" | "dodo";
5177
5177
  type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" | "partial_canceled" | "aborted" | "expired" | "failed";
5178
5178
  interface PreparePaymentRequest {
5179
5179
  amount: number;
@@ -5200,10 +5200,11 @@ interface PreparePaymentResponse {
5200
5200
  payapp_mul_no?: string;
5201
5201
  paypal_approve_url?: string;
5202
5202
  paypal_order_id?: string;
5203
- paddle_transaction_id?: string;
5204
- paddle_client_token?: string;
5205
- paddle_environment?: string;
5206
- paddle_checkout_url?: string;
5203
+ provider_ref?: string;
5204
+ client_token?: string;
5205
+ environment?: string;
5206
+ checkout_url?: string;
5207
+ launch_mode?: "overlay" | "redirect";
5207
5208
  }
5208
5209
  interface CreateCheckoutSessionRequest {
5209
5210
  amount: number;
@@ -5230,7 +5231,7 @@ interface ConfirmPaymentRequest {
5230
5231
  amount: number;
5231
5232
  stripe_payment_intent_id?: string;
5232
5233
  paypal_order_id?: string;
5233
- paddle_transaction_id?: string;
5234
+ provider_ref?: string;
5234
5235
  }
5235
5236
  interface ConfirmPaymentResponse {
5236
5237
  payment_id: string;
@@ -7290,7 +7291,7 @@ interface CreateSubscriptionRequest {
7290
7291
  /** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
7291
7292
  expire_date?: string;
7292
7293
  /** paddle 필수: Paddle 카탈로그의 recurring price ID (pri_*) */
7293
- paddle_price_id?: string;
7294
+ provider_price_ref?: string;
7294
7295
  /** 메타데이터 */
7295
7296
  metadata?: Record<string, unknown>;
7296
7297
  }
@@ -7300,21 +7301,22 @@ interface SubscriptionResponse {
7300
7301
  /** 구독 ID (문자열) */
7301
7302
  subscription_id: string;
7302
7303
  /** 결제 프로바이더 */
7303
- provider?: "toss" | "stripe" | "payapp" | "paypal" | "paddle";
7304
+ provider?: "toss" | "stripe" | "payapp" | "paypal" | "paddle" | "dodo";
7304
7305
  /** payapp: 카드등록+1회차 결제창 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
7305
7306
  payapp_pay_url?: string;
7306
7307
  /** paypal: 구독 승인+결제수단 등록 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
7307
7308
  paypal_approve_url?: string;
7308
7309
  /** paddle: Paddle.js Checkout.open({transactionId})로 오버레이. 확정은 웹훅이 SoT */
7309
- paddle_transaction_id?: string;
7310
+ provider_ref?: string;
7310
7311
  /** paddle: Paddle.js 초기화용 client-side token */
7311
- paddle_client_token?: string;
7312
+ client_token?: string;
7312
7313
  /** paddle: sandbox | production */
7313
- paddle_environment?: string;
7314
+ environment?: string;
7314
7315
  /** paddle: 호스티드 결제 페이지 URL (fallback) */
7315
- paddle_checkout_url?: string;
7316
+ checkout_url?: string;
7317
+ launch_mode?: "overlay" | "redirect";
7316
7318
  /** paddle: 현재 구독이 물린 recurring price ID (pri_*) */
7317
- paddle_price_id?: string;
7319
+ provider_price_ref?: string;
7318
7320
  /** 플랜 이름 */
7319
7321
  plan_name: string;
7320
7322
  /** 플랜 설명 */
@@ -7407,7 +7409,7 @@ type OnPaymentFailure = "prevent_change" | "apply_change";
7407
7409
  */
7408
7410
  interface ChangePlanRequest {
7409
7411
  /** 새 recurring price ID (pri_*) — 필수 */
7410
- paddle_price_id: string;
7412
+ provider_price_ref: string;
7411
7413
  /** 우리 표시용 플랜명 (선택) */
7412
7414
  plan_name?: string;
7413
7415
  /** 우리 표시용 플랜 설명 (선택) */
@@ -7441,7 +7443,7 @@ interface ChangePlanPreview {
7441
7443
  /** 다음 청구 예정일 */
7442
7444
  next_billed_at?: string | null;
7443
7445
  /** 미리보기가 반영한 새 price ID */
7444
- new_paddle_price_id?: string;
7446
+ new_provider_price_ref?: string;
7445
7447
  }
7446
7448
  interface ListSubscriptionsRequest {
7447
7449
  /** 상태 필터 */
@@ -7755,7 +7757,7 @@ declare class SubscriptionAPI {
7755
7757
  * @example
7756
7758
  * ```typescript
7757
7759
  * await client.subscription.changePlan(subscriptionId, {
7758
- * paddle_price_id: 'pri_family_monthly',
7760
+ * provider_price_ref: 'pri_family_monthly',
7759
7761
  * plan_name: '가족 플랜',
7760
7762
  * amount: 24900,
7761
7763
  * proration_mode: 'prorated_immediately',
@@ -7777,7 +7779,7 @@ declare class SubscriptionAPI {
7777
7779
  * @example
7778
7780
  * ```typescript
7779
7781
  * const preview = await client.subscription.previewChangePlan(subscriptionId, {
7780
- * paddle_price_id: 'pri_family_monthly',
7782
+ * provider_price_ref: 'pri_family_monthly',
7781
7783
  * })
7782
7784
  * // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
7783
7785
  * ```
package/dist/index.d.ts CHANGED
@@ -5173,7 +5173,7 @@ declare class OAuthAPI {
5173
5173
  } | null>;
5174
5174
  }
5175
5175
 
5176
- type PaymentProvider = "toss" | "stripe" | "payapp" | "paypal" | "paddle";
5176
+ type PaymentProvider = "toss" | "stripe" | "payapp" | "paypal" | "paddle" | "dodo";
5177
5177
  type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" | "partial_canceled" | "aborted" | "expired" | "failed";
5178
5178
  interface PreparePaymentRequest {
5179
5179
  amount: number;
@@ -5200,10 +5200,11 @@ interface PreparePaymentResponse {
5200
5200
  payapp_mul_no?: string;
5201
5201
  paypal_approve_url?: string;
5202
5202
  paypal_order_id?: string;
5203
- paddle_transaction_id?: string;
5204
- paddle_client_token?: string;
5205
- paddle_environment?: string;
5206
- paddle_checkout_url?: string;
5203
+ provider_ref?: string;
5204
+ client_token?: string;
5205
+ environment?: string;
5206
+ checkout_url?: string;
5207
+ launch_mode?: "overlay" | "redirect";
5207
5208
  }
5208
5209
  interface CreateCheckoutSessionRequest {
5209
5210
  amount: number;
@@ -5230,7 +5231,7 @@ interface ConfirmPaymentRequest {
5230
5231
  amount: number;
5231
5232
  stripe_payment_intent_id?: string;
5232
5233
  paypal_order_id?: string;
5233
- paddle_transaction_id?: string;
5234
+ provider_ref?: string;
5234
5235
  }
5235
5236
  interface ConfirmPaymentResponse {
5236
5237
  payment_id: string;
@@ -7290,7 +7291,7 @@ interface CreateSubscriptionRequest {
7290
7291
  /** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
7291
7292
  expire_date?: string;
7292
7293
  /** paddle 필수: Paddle 카탈로그의 recurring price ID (pri_*) */
7293
- paddle_price_id?: string;
7294
+ provider_price_ref?: string;
7294
7295
  /** 메타데이터 */
7295
7296
  metadata?: Record<string, unknown>;
7296
7297
  }
@@ -7300,21 +7301,22 @@ interface SubscriptionResponse {
7300
7301
  /** 구독 ID (문자열) */
7301
7302
  subscription_id: string;
7302
7303
  /** 결제 프로바이더 */
7303
- provider?: "toss" | "stripe" | "payapp" | "paypal" | "paddle";
7304
+ provider?: "toss" | "stripe" | "payapp" | "paypal" | "paddle" | "dodo";
7304
7305
  /** payapp: 카드등록+1회차 결제창 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
7305
7306
  payapp_pay_url?: string;
7306
7307
  /** paypal: 구독 승인+결제수단 등록 URL. 이 URL로 사용자를 redirect 시킨다 (위젯 불필요) */
7307
7308
  paypal_approve_url?: string;
7308
7309
  /** paddle: Paddle.js Checkout.open({transactionId})로 오버레이. 확정은 웹훅이 SoT */
7309
- paddle_transaction_id?: string;
7310
+ provider_ref?: string;
7310
7311
  /** paddle: Paddle.js 초기화용 client-side token */
7311
- paddle_client_token?: string;
7312
+ client_token?: string;
7312
7313
  /** paddle: sandbox | production */
7313
- paddle_environment?: string;
7314
+ environment?: string;
7314
7315
  /** paddle: 호스티드 결제 페이지 URL (fallback) */
7315
- paddle_checkout_url?: string;
7316
+ checkout_url?: string;
7317
+ launch_mode?: "overlay" | "redirect";
7316
7318
  /** paddle: 현재 구독이 물린 recurring price ID (pri_*) */
7317
- paddle_price_id?: string;
7319
+ provider_price_ref?: string;
7318
7320
  /** 플랜 이름 */
7319
7321
  plan_name: string;
7320
7322
  /** 플랜 설명 */
@@ -7407,7 +7409,7 @@ type OnPaymentFailure = "prevent_change" | "apply_change";
7407
7409
  */
7408
7410
  interface ChangePlanRequest {
7409
7411
  /** 새 recurring price ID (pri_*) — 필수 */
7410
- paddle_price_id: string;
7412
+ provider_price_ref: string;
7411
7413
  /** 우리 표시용 플랜명 (선택) */
7412
7414
  plan_name?: string;
7413
7415
  /** 우리 표시용 플랜 설명 (선택) */
@@ -7441,7 +7443,7 @@ interface ChangePlanPreview {
7441
7443
  /** 다음 청구 예정일 */
7442
7444
  next_billed_at?: string | null;
7443
7445
  /** 미리보기가 반영한 새 price ID */
7444
- new_paddle_price_id?: string;
7446
+ new_provider_price_ref?: string;
7445
7447
  }
7446
7448
  interface ListSubscriptionsRequest {
7447
7449
  /** 상태 필터 */
@@ -7755,7 +7757,7 @@ declare class SubscriptionAPI {
7755
7757
  * @example
7756
7758
  * ```typescript
7757
7759
  * await client.subscription.changePlan(subscriptionId, {
7758
- * paddle_price_id: 'pri_family_monthly',
7760
+ * provider_price_ref: 'pri_family_monthly',
7759
7761
  * plan_name: '가족 플랜',
7760
7762
  * amount: 24900,
7761
7763
  * proration_mode: 'prorated_immediately',
@@ -7777,7 +7779,7 @@ declare class SubscriptionAPI {
7777
7779
  * @example
7778
7780
  * ```typescript
7779
7781
  * const preview = await client.subscription.previewChangePlan(subscriptionId, {
7780
- * paddle_price_id: 'pri_family_monthly',
7782
+ * provider_price_ref: 'pri_family_monthly',
7781
7783
  * })
7782
7784
  * // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
7783
7785
  * ```
package/dist/index.js CHANGED
@@ -8873,7 +8873,7 @@ var SubscriptionAPI = class {
8873
8873
  * @example
8874
8874
  * ```typescript
8875
8875
  * await client.subscription.changePlan(subscriptionId, {
8876
- * paddle_price_id: 'pri_family_monthly',
8876
+ * provider_price_ref: 'pri_family_monthly',
8877
8877
  * plan_name: '가족 플랜',
8878
8878
  * amount: 24900,
8879
8879
  * proration_mode: 'prorated_immediately',
@@ -8901,7 +8901,7 @@ var SubscriptionAPI = class {
8901
8901
  * @example
8902
8902
  * ```typescript
8903
8903
  * const preview = await client.subscription.previewChangePlan(subscriptionId, {
8904
- * paddle_price_id: 'pri_family_monthly',
8904
+ * provider_price_ref: 'pri_family_monthly',
8905
8905
  * })
8906
8906
  * // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
8907
8907
  * ```
package/dist/index.mjs CHANGED
@@ -8827,7 +8827,7 @@ var SubscriptionAPI = class {
8827
8827
  * @example
8828
8828
  * ```typescript
8829
8829
  * await client.subscription.changePlan(subscriptionId, {
8830
- * paddle_price_id: 'pri_family_monthly',
8830
+ * provider_price_ref: 'pri_family_monthly',
8831
8831
  * plan_name: '가족 플랜',
8832
8832
  * amount: 24900,
8833
8833
  * proration_mode: 'prorated_immediately',
@@ -8855,7 +8855,7 @@ var SubscriptionAPI = class {
8855
8855
  * @example
8856
8856
  * ```typescript
8857
8857
  * const preview = await client.subscription.previewChangePlan(subscriptionId, {
8858
- * paddle_price_id: 'pri_family_monthly',
8858
+ * provider_price_ref: 'pri_family_monthly',
8859
8859
  * })
8860
8860
  * // preview.immediate_charge_amount, preview.recurring_amount, preview.next_billed_at
8861
8861
  * ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "connectbase-client",
3
- "version": "3.54.0",
3
+ "version": "4.0.0",
4
4
  "description": "Connect Base JavaScript/TypeScript SDK for browser and Node.js",
5
5
  "repository": {
6
6
  "type": "git",