connectbase-client 4.2.0 → 4.3.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 +56 -0
- package/dist/index.d.mts +155 -28
- package/dist/index.d.ts +155 -28
- package/dist/index.js +24 -9
- package/dist/index.mjs +24 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,62 @@
|
|
|
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.3.0] - 2026-07-25
|
|
7
|
+
|
|
8
|
+
### Added — 퍼블릭 키 단위 결제 모드 (`payment_mode`)
|
|
9
|
+
|
|
10
|
+
키마다 결제 자격증명 모드를 고정할 수 있다: `inherit`(기본, 앱 설정을 따름) | `test` | `live`.
|
|
11
|
+
같은 앱에서 QA 빌드는 테스트 결제, 프로덕션 빌드는 라이브 결제로 **동시에** 운영할 수 있다 —
|
|
12
|
+
지금까지는 모드가 앱×프로바이더 단위 단일 값이라, 라이브 전환 이후 결제 회귀 테스트를 하려면
|
|
13
|
+
콘솔에서 모드를 되돌려야 했고 그동안 실고객 결제가 테스트로 처리됐다.
|
|
14
|
+
|
|
15
|
+
모드를 정하는 주체가 서버에 저장된 키 설정이라 클라이언트는 고를 수 없다 — 브라우저가 test 를
|
|
16
|
+
골라 무료로 "결제 성공"을 만드는 우회는 여전히 불가능하다.
|
|
17
|
+
|
|
18
|
+
- `CreatePublicKeyRequest.payment_mode`, `UpdatePublicKeyRequest.payment_mode`
|
|
19
|
+
- `PublicKeyItem.payment_mode`, `CreatePublicKeyResponse.payment_mode`,
|
|
20
|
+
`UpdatePublicKeyResponse.payment_mode`
|
|
21
|
+
- `PublicKeyPaymentMode` 타입 export
|
|
22
|
+
|
|
23
|
+
### Added — 구독의 결제 모드 (단건결제와 대칭)
|
|
24
|
+
|
|
25
|
+
구독에는 모드 필드가 아예 없어 **어떤 경로로도 테스트 구독을 만들 수 없었다** — 유일한 스위치가
|
|
26
|
+
콘솔의 프로바이더 모드였고, 그것을 되돌린 사이 실고객 결제가 테스트로 처리됐다.
|
|
27
|
+
|
|
28
|
+
- `CreateSubscriptionRequest.payment_mode` — 단건결제 `prepare()` 의 `payment_mode` 와 적용
|
|
29
|
+
조건이 완전히 동일하다(서버 시크릿 키 호출에서만 적용, 브라우저 공개 키 호출에서는 무시).
|
|
30
|
+
- `SubscriptionResponse.payment_mode` — 이 구독이 고정한 모드. 프로바이더 중립 필드라 목록에서
|
|
31
|
+
테스트 구독과 실구독을 가를 수 있다(`environment` 는 Paddle 전용이라 쓸 수 없었다).
|
|
32
|
+
- 키 단위 결제 모드는 결제뿐 아니라 **구독 생성·빌링키 발급에도 동일하게 적용**된다.
|
|
33
|
+
|
|
34
|
+
### Added — 결제 금액의 통화·정산·국가 정보
|
|
35
|
+
|
|
36
|
+
MoR(Paddle/Dodo)은 고객에게 **표시통화**로 청구하고 머천트에게는 환산된 **정산통화**로 지급한다.
|
|
37
|
+
지금까지는 정산통화 금액이 표시통화 라벨을 달고 나가 앱이 거짓 금액을 표시할 수 있었다
|
|
38
|
+
(예: `$10.10` 이 `₩1,010` 으로).
|
|
39
|
+
|
|
40
|
+
- `PaymentDetail.settlement_amount` / `.settlement_currency` / `.country`
|
|
41
|
+
- `PaymentListItem.currency` (기존에는 금액만 있고 통화가 없었다)
|
|
42
|
+
- `SubscriptionResponse.country` / `.mode`
|
|
43
|
+
- `SubscriptionPaymentResponse.provider` / `.settlement_amount` / `.settlement_currency` / `.country`
|
|
44
|
+
- `ChangePlanPreview.recurring_currency` / `.settlement_amount` / `.settlement_currency`
|
|
45
|
+
|
|
46
|
+
### Added — Dodo 요금제 변경 미리보기
|
|
47
|
+
|
|
48
|
+
`cb.subscription.previewChangePlan()` 이 Dodo 구독에서도 동작한다(기존에는 Paddle 전용).
|
|
49
|
+
|
|
50
|
+
- `ProrationMode` 에 `difference_immediately` 추가 (Dodo 전용 — 차액만 즉시 청구)
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- `ChangePlanPreview.currency` 는 **즉시청구액의 통화**로 명확해졌다. 새 정기 단가의 통화는
|
|
55
|
+
`recurring_currency` 를 쓴다(비어 있으면 `currency` 와 동일).
|
|
56
|
+
- 프로바이더가 지원하지 않는 `proration_mode` 는 근사 대체 없이 400 `invalid_proration_mode` 다.
|
|
57
|
+
이전에는 Dodo 에서 `prorated_next_billing_period`("다음 청구일에 부과")가
|
|
58
|
+
`difference_immediately`("지금 차액 청구")로 조용히 바뀌어, 요청하지 않은 즉시 출금이 발생했다.
|
|
59
|
+
- 미리보기 미지원 프로바이더의 에러 코드가 `plan_change_unsupported` → `plan_change_preview_unsupported`
|
|
60
|
+
로 분리됐다. 전자는 "요금제 변경 자체가 불가", 후자는 "미리보기만 없고 `changePlan` 은 동작"이다.
|
|
61
|
+
|
|
6
62
|
## [4.2.0] - 2026-07-25
|
|
7
63
|
|
|
8
64
|
### Added — 패키징 앱 네이티브 API 보강 (`cb.native.*`)
|
package/dist/index.d.mts
CHANGED
|
@@ -5275,11 +5275,15 @@ type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" |
|
|
|
5275
5275
|
interface PreparePaymentRequest {
|
|
5276
5276
|
payment_provider?: PaymentProvider;
|
|
5277
5277
|
/**
|
|
5278
|
-
* 사용할 자격증명 모드 오버라이드(선택).
|
|
5278
|
+
* 사용할 자격증명 모드 오버라이드(선택).
|
|
5279
5279
|
*
|
|
5280
5280
|
* **서버에서 시크릿 키(`cb_sk_*`)로 호출할 때만 적용된다.** 브라우저에 실리는 공개 키
|
|
5281
5281
|
* (`cb_pk_*`) 호출에서는 무시된다 — 클라이언트가 test 를 골라 실제 돈 없이 "결제 성공"을
|
|
5282
5282
|
* 만들 수 있으면 결제 성공에 걸린 권한 부여가 통째로 우회되기 때문이다.
|
|
5283
|
+
*
|
|
5284
|
+
* 모드 결정 우선순위: 이 오버라이드 → **퍼블릭 키에 고정된 모드**(콘솔에서 키마다 지정) →
|
|
5285
|
+
* 콘솔의 프로바이더 모드 → test. 브라우저 앱에서 QA/프로덕션 결제를 나누려면 이 필드가 아니라
|
|
5286
|
+
* 키 단위 `payment_mode` 를 쓴다(`cb.publicKey` 참조).
|
|
5283
5287
|
*/
|
|
5284
5288
|
payment_mode?: PaymentMode;
|
|
5285
5289
|
/**
|
|
@@ -5374,8 +5378,21 @@ interface PaymentDetail {
|
|
|
5374
5378
|
payment_id: string;
|
|
5375
5379
|
order_id: string;
|
|
5376
5380
|
order_name: string;
|
|
5381
|
+
/** 고객이 실제 청구받은 금액 — `currency` 기준 최소단위 */
|
|
5377
5382
|
amount: number;
|
|
5383
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
5378
5384
|
currency: string;
|
|
5385
|
+
/**
|
|
5386
|
+
* 정산통화 환산액 (MoR 프로바이더가 제공할 때만).
|
|
5387
|
+
*
|
|
5388
|
+
* Paddle/Dodo 는 고객에게 표시통화로 청구하고 머천트에게는 환산된 정산통화로 지급한다.
|
|
5389
|
+
* 실제 입금액 대사에 쓰고, **고객에게 보여줄 금액은 언제나 `amount`/`currency`** 다.
|
|
5390
|
+
*/
|
|
5391
|
+
settlement_amount?: number;
|
|
5392
|
+
/** `settlement_amount` 의 통화 (ISO 4217) */
|
|
5393
|
+
settlement_currency?: string;
|
|
5394
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 제공 시) */
|
|
5395
|
+
country?: string;
|
|
5379
5396
|
status: PaymentStatus;
|
|
5380
5397
|
payment_provider?: PaymentProvider;
|
|
5381
5398
|
/** 이 결제가 사용한 자격증명 모드 (test | live). */
|
|
@@ -5414,7 +5431,10 @@ interface PaymentListItem {
|
|
|
5414
5431
|
payment_id: string;
|
|
5415
5432
|
order_id: string;
|
|
5416
5433
|
order_name: string;
|
|
5434
|
+
/** 고객이 실제 청구받은 금액 — `currency` 기준 최소단위 */
|
|
5417
5435
|
amount: number;
|
|
5436
|
+
/** `amount` 의 통화 (ISO 4217). 다통화 결제에서 앱 기본 통화를 가정하면 거짓 금액이 된다 */
|
|
5437
|
+
currency: string;
|
|
5418
5438
|
status: PaymentStatus;
|
|
5419
5439
|
method?: string;
|
|
5420
5440
|
/** toss | stripe 등 */
|
|
@@ -5591,6 +5611,22 @@ declare class PaymentAPI {
|
|
|
5591
5611
|
/**
|
|
5592
5612
|
* Public Key 관련 타입 정의
|
|
5593
5613
|
*/
|
|
5614
|
+
/**
|
|
5615
|
+
* 이 키로 들어온 결제가 쓸 자격증명 모드.
|
|
5616
|
+
*
|
|
5617
|
+
* - `inherit`(기본): 앱 결제 설정의 프로바이더 모드를 따른다.
|
|
5618
|
+
* - `test`: 이 키의 결제는 항상 테스트 키로 처리된다.
|
|
5619
|
+
* - `live`: 이 키의 결제는 항상 라이브 키로 처리된다.
|
|
5620
|
+
*
|
|
5621
|
+
* 앱 하나로 QA 빌드와 프로덕션 빌드를 함께 운영할 때 쓴다 — QA 빌드에 `test` 키를 심으면
|
|
5622
|
+
* 앱 설정이 라이브여도 그 키의 결제만 테스트로 처리되므로, 라이브 전환 이후에도 안전하게
|
|
5623
|
+
* 결제 회귀 테스트를 할 수 있다.
|
|
5624
|
+
*
|
|
5625
|
+
* 모드를 정하는 주체가 **서버에 저장된 키 설정**이라 클라이언트는 고를 수 없다. QA 키가
|
|
5626
|
+
* 유출돼도 만들 수 있는 건 테스트 결제뿐이다(권한 지급 로직이 결제의 `payment_mode` 를 함께
|
|
5627
|
+
* 검사하도록 만드는 것을 권장한다).
|
|
5628
|
+
*/
|
|
5629
|
+
type PublicKeyPaymentMode = "inherit" | "test" | "live";
|
|
5594
5630
|
/**
|
|
5595
5631
|
* Public Key 아이템
|
|
5596
5632
|
*/
|
|
@@ -5603,6 +5639,8 @@ interface PublicKeyItem {
|
|
|
5603
5639
|
key_prefix: string;
|
|
5604
5640
|
/** 활성화 상태 */
|
|
5605
5641
|
is_active: boolean;
|
|
5642
|
+
/** 이 키로 들어온 결제의 자격증명 모드 */
|
|
5643
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5606
5644
|
/** 마지막 사용 시간 */
|
|
5607
5645
|
last_used_at?: string;
|
|
5608
5646
|
/** 만료일 (null이면 무제한) */
|
|
@@ -5616,6 +5654,8 @@ interface PublicKeyItem {
|
|
|
5616
5654
|
interface CreatePublicKeyRequest {
|
|
5617
5655
|
/** Public Key 이름 (예: Production, Development) */
|
|
5618
5656
|
name: string;
|
|
5657
|
+
/** 이 키로 들어온 결제의 자격증명 모드 (기본: inherit) */
|
|
5658
|
+
payment_mode?: PublicKeyPaymentMode;
|
|
5619
5659
|
/** 만료일 (옵션) */
|
|
5620
5660
|
expires_at?: string;
|
|
5621
5661
|
}
|
|
@@ -5633,6 +5673,8 @@ interface CreatePublicKeyResponse {
|
|
|
5633
5673
|
key_prefix: string;
|
|
5634
5674
|
/** 활성화 상태 */
|
|
5635
5675
|
is_active: boolean;
|
|
5676
|
+
/** 이 키로 들어온 결제의 자격증명 모드 */
|
|
5677
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5636
5678
|
/** 만료일 */
|
|
5637
5679
|
expires_at?: string;
|
|
5638
5680
|
/** 생성일 */
|
|
@@ -5652,6 +5694,8 @@ interface UpdatePublicKeyRequest {
|
|
|
5652
5694
|
name?: string;
|
|
5653
5695
|
/** 활성화/비활성화 */
|
|
5654
5696
|
is_active?: boolean;
|
|
5697
|
+
/** 이 키로 들어온 결제의 자격증명 모드 변경 */
|
|
5698
|
+
payment_mode?: PublicKeyPaymentMode;
|
|
5655
5699
|
}
|
|
5656
5700
|
/**
|
|
5657
5701
|
* Public Key 수정 응답
|
|
@@ -5661,6 +5705,7 @@ interface UpdatePublicKeyResponse {
|
|
|
5661
5705
|
name: string;
|
|
5662
5706
|
key_prefix: string;
|
|
5663
5707
|
is_active: boolean;
|
|
5708
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5664
5709
|
expires_at?: string;
|
|
5665
5710
|
created_at: string;
|
|
5666
5711
|
}
|
|
@@ -7410,8 +7455,19 @@ interface CreateSubscriptionRequest {
|
|
|
7410
7455
|
customer_phone?: string;
|
|
7411
7456
|
/** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
|
|
7412
7457
|
expire_date?: string;
|
|
7413
|
-
/**
|
|
7458
|
+
/** MoR 필수: PG 카탈로그의 recurring price/product ref (Paddle `pri_*` / Dodo `pdt_*`) */
|
|
7414
7459
|
provider_price_ref?: string;
|
|
7460
|
+
/**
|
|
7461
|
+
* 사용할 자격증명 모드 오버라이드 (test|live). 단건결제 `prepare()` 의 `payment_mode` 와
|
|
7462
|
+
* 적용 조건이 **완전히 동일**하다 — 서버 시크릿 키(`cb_sk_*`)로 승격된 호출에서만 적용되고,
|
|
7463
|
+
* 브라우저 공개 키(`cb_pk_*`) 호출에서는 무시된다.
|
|
7464
|
+
*
|
|
7465
|
+
* 모드 결정 우선순위: 이 오버라이드 → 퍼블릭 키에 고정된 모드 → 앱 결제 설정의 프로바이더 모드
|
|
7466
|
+
* → test. 브라우저 앱에서 QA/프로덕션을 나누려면 이 필드가 아니라 키 단위 모드를 쓴다.
|
|
7467
|
+
*
|
|
7468
|
+
* 구독은 생성 시점 모드가 고정되므로 이후 갱신 청구·해지도 같은 키로 처리된다.
|
|
7469
|
+
*/
|
|
7470
|
+
payment_mode?: "test" | "live";
|
|
7415
7471
|
/** 메타데이터 */
|
|
7416
7472
|
metadata?: Record<string, unknown>;
|
|
7417
7473
|
}
|
|
@@ -7441,10 +7497,26 @@ interface SubscriptionResponse {
|
|
|
7441
7497
|
plan_name: string;
|
|
7442
7498
|
/** 플랜 설명 */
|
|
7443
7499
|
plan_description: string;
|
|
7444
|
-
/**
|
|
7500
|
+
/**
|
|
7501
|
+
* 이 구독이 고정한 자격증명 모드 (test=테스트 키 | live=실결제).
|
|
7502
|
+
*
|
|
7503
|
+
* 생성 시점 값이 박히므로 이후 앱 모드를 바꿔도 갱신 청구는 원래 키로 처리된다.
|
|
7504
|
+
* **프로바이더 중립 필드**라 목록에서 테스트 구독과 실구독을 가르는 데 이 필드를 쓴다
|
|
7505
|
+
* (`environment` 는 Paddle 의 sandbox|production 이라 다른 프로바이더에서는 기대할 수 없다).
|
|
7506
|
+
*/
|
|
7507
|
+
payment_mode?: "test" | "live";
|
|
7508
|
+
/**
|
|
7509
|
+
* 정기 청구 단가 (`currency` 기준 최소단위).
|
|
7510
|
+
*
|
|
7511
|
+
* MoR(Paddle/Dodo)은 상품 통화와 고객 표시통화가 다를 수 있으므로(adaptive currency),
|
|
7512
|
+
* 이 값을 해석할 때는 반드시 `currency` 를 함께 봐야 한다. 앱의 기본 통화를 가정하면
|
|
7513
|
+
* 거짓 금액이 된다(예: $10.10 을 ₩1,010 으로 표기).
|
|
7514
|
+
*/
|
|
7445
7515
|
amount: number;
|
|
7446
|
-
/** 통화 */
|
|
7516
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
7447
7517
|
currency: string;
|
|
7518
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 프로바이더가 제공할 때만) */
|
|
7519
|
+
country?: string;
|
|
7448
7520
|
/** 결제 주기 */
|
|
7449
7521
|
billing_cycle: BillingCycle;
|
|
7450
7522
|
/** 결제일 */
|
|
@@ -7465,7 +7537,10 @@ interface SubscriptionResponse {
|
|
|
7465
7537
|
ended_at: string | null;
|
|
7466
7538
|
/** 트라이얼 종료일 */
|
|
7467
7539
|
trial_end_at: string | null;
|
|
7468
|
-
/**
|
|
7540
|
+
/**
|
|
7541
|
+
* 총 결제 금액 — 결제 이력 금액의 합이며 **각 결제의 표시통화** 기준이다.
|
|
7542
|
+
* 위 `currency` 와 다를 수 있으므로, 통화별 정확한 집계는 결제 이력의 `currency` 로 그룹핑할 것.
|
|
7543
|
+
*/
|
|
7469
7544
|
total_paid: number;
|
|
7470
7545
|
/** 결제 횟수 */
|
|
7471
7546
|
payment_count: number;
|
|
@@ -7513,7 +7588,23 @@ interface CancelSubscriptionRequest {
|
|
|
7513
7588
|
* - `full_next_billing_period`: 새 플랜 전액을 다음 청구일에 부과.
|
|
7514
7589
|
* - `do_not_bill`: 전환만 하고 청구하지 않음.
|
|
7515
7590
|
*/
|
|
7516
|
-
|
|
7591
|
+
/**
|
|
7592
|
+
* 요금제 스왑 시 남은 금액 정산 방식.
|
|
7593
|
+
*
|
|
7594
|
+
* **프로바이더별 지원 범위가 다르다.** 미지원 값은 근사 대체 없이 400
|
|
7595
|
+
* `invalid_proration_mode` 로 거절된다 — "다음 청구일에 부과"를 조용히 "지금 청구"로 바꾸면
|
|
7596
|
+
* 요청하지 않은 즉시 출금이 발생하기 때문이다.
|
|
7597
|
+
*
|
|
7598
|
+
* | 값 | Paddle | Dodo |
|
|
7599
|
+
* | --- | --- | --- |
|
|
7600
|
+
* | `prorated_immediately` (기본) | ✅ | ✅ |
|
|
7601
|
+
* | `full_immediately` | ✅ | ✅ |
|
|
7602
|
+
* | `do_not_bill` | ✅ | ✅ |
|
|
7603
|
+
* | `prorated_next_billing_period` | ✅ | ❌ |
|
|
7604
|
+
* | `full_next_billing_period` | ✅ | ❌ |
|
|
7605
|
+
* | `difference_immediately` | ❌ | ✅ |
|
|
7606
|
+
*/
|
|
7607
|
+
type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "full_immediately" | "full_next_billing_period" | "difference_immediately" | "do_not_bill";
|
|
7517
7608
|
/**
|
|
7518
7609
|
* 즉시청구(prorated/full_immediately) 실패 시 플랜 변경을 적용할지.
|
|
7519
7610
|
*
|
|
@@ -7522,19 +7613,22 @@ type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "
|
|
|
7522
7613
|
*/
|
|
7523
7614
|
type OnPaymentFailure = "prevent_change" | "apply_change";
|
|
7524
7615
|
/**
|
|
7525
|
-
* 요금제 스왑(플랜 변경) 요청 — Paddle
|
|
7616
|
+
* 요금제 스왑(플랜 변경) 요청 — MoR(Paddle/Dodo) 구독 전용.
|
|
7617
|
+
*
|
|
7618
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
7619
|
+
* proration 으로 정산한다. 예) 혼자→가족 in-place 업그레이드.
|
|
7526
7620
|
*
|
|
7527
|
-
*
|
|
7528
|
-
*
|
|
7621
|
+
* toss/stripe/payapp/paypal 구독은 PG 네이티브 proration 이 없어 400
|
|
7622
|
+
* `plan_change_unsupported` 다.
|
|
7529
7623
|
*/
|
|
7530
7624
|
interface ChangePlanRequest {
|
|
7531
|
-
/** 새 recurring price
|
|
7625
|
+
/** 새 recurring price/product ref (Paddle `pri_*` / Dodo `pdt_*`) — 필수 */
|
|
7532
7626
|
provider_price_ref: string;
|
|
7533
7627
|
/** 우리 표시용 플랜명 (선택) */
|
|
7534
7628
|
plan_name?: string;
|
|
7535
7629
|
/** 우리 표시용 플랜 설명 (선택) */
|
|
7536
7630
|
plan_description?: string;
|
|
7537
|
-
/** 우리 기록용 정기 금액 (선택 — 미지정 시
|
|
7631
|
+
/** 우리 기록용 정기 금액 (선택 — 미지정 시 PG 값으로 자동 수렴) */
|
|
7538
7632
|
amount?: number;
|
|
7539
7633
|
/** 정산 방식 (기본: prorated_immediately) */
|
|
7540
7634
|
proration_mode?: ProrationMode;
|
|
@@ -7546,8 +7640,12 @@ interface ChangePlanRequest {
|
|
|
7546
7640
|
/**
|
|
7547
7641
|
* 요금제 스왑 미리보기 응답 — 실제 적용 없이 정산 결과만 계산.
|
|
7548
7642
|
*
|
|
7549
|
-
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된
|
|
7550
|
-
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로
|
|
7643
|
+
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된 PG 계산값(권위)이다.
|
|
7644
|
+
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로 노출한다(직접 차액을 계산하지 말 것).
|
|
7645
|
+
*
|
|
7646
|
+
* **통화가 둘인 이유**: 즉시청구는 고객 표시통화로, 정기 단가는 상품 통화로 계산된다. MoR 의
|
|
7647
|
+
* adaptive currency 에서 이 둘이 다를 수 있어 각각 통화를 싣는다. 금액을 표시할 때는 반드시
|
|
7648
|
+
* 짝이 되는 통화 필드를 함께 써야 한다 — 하나의 통화로 뭉치면 확정 직전 화면에 거짓 금액이 뜬다.
|
|
7551
7649
|
*/
|
|
7552
7650
|
interface ChangePlanPreview {
|
|
7553
7651
|
/** 적용된 정산 모드 */
|
|
@@ -7556,13 +7654,19 @@ interface ChangePlanPreview {
|
|
|
7556
7654
|
immediate_charge_action?: "charge" | "credit";
|
|
7557
7655
|
/** 지금 순액(minor). 청구=양수, 크레딧=음수 */
|
|
7558
7656
|
immediate_charge_amount: number;
|
|
7657
|
+
/** `immediate_charge_amount` 의 통화 (ISO 4217) */
|
|
7658
|
+
currency: string;
|
|
7559
7659
|
/** 새 플랜의 다음 정기 청구액(minor) */
|
|
7560
7660
|
recurring_amount: number;
|
|
7561
|
-
/**
|
|
7562
|
-
|
|
7661
|
+
/** `recurring_amount` 의 통화. 비어 있으면 `currency` 와 동일 */
|
|
7662
|
+
recurring_currency?: string;
|
|
7663
|
+
/** 즉시청구의 정산통화 환산액 (MoR 제공 시) — 매출 대사용, 고객 표시에는 쓰지 말 것 */
|
|
7664
|
+
settlement_amount?: number;
|
|
7665
|
+
/** `settlement_amount` 의 통화 */
|
|
7666
|
+
settlement_currency?: string;
|
|
7563
7667
|
/** 다음 청구 예정일 */
|
|
7564
7668
|
next_billed_at?: string | null;
|
|
7565
|
-
/** 미리보기가 반영한 새 price
|
|
7669
|
+
/** 미리보기가 반영한 새 price/product ref */
|
|
7566
7670
|
new_provider_price_ref?: string;
|
|
7567
7671
|
}
|
|
7568
7672
|
interface ListSubscriptionsRequest {
|
|
@@ -7585,14 +7689,22 @@ interface SubscriptionPaymentResponse {
|
|
|
7585
7689
|
id: string;
|
|
7586
7690
|
/** 구독 ID */
|
|
7587
7691
|
subscription_id: string;
|
|
7692
|
+
/** 이 청구를 처리한 결제 프로바이더 */
|
|
7693
|
+
provider?: string;
|
|
7588
7694
|
/** 토스 결제 키 */
|
|
7589
7695
|
payment_key: string;
|
|
7590
7696
|
/** 주문 ID */
|
|
7591
7697
|
order_id: string;
|
|
7592
|
-
/** 결제 금액 */
|
|
7698
|
+
/** 결제 금액 — 고객이 실제 청구받은 **표시통화** 기준 */
|
|
7593
7699
|
amount: number;
|
|
7594
|
-
/** 통화 */
|
|
7700
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
7595
7701
|
currency: string;
|
|
7702
|
+
/** 정산통화 환산액 (MoR 제공 시) — 매출 대사용, 고객 표시에는 쓰지 말 것 */
|
|
7703
|
+
settlement_amount?: number;
|
|
7704
|
+
/** `settlement_amount` 의 통화 */
|
|
7705
|
+
settlement_currency?: string;
|
|
7706
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 제공 시) */
|
|
7707
|
+
country?: string;
|
|
7596
7708
|
/** 결제 상태 */
|
|
7597
7709
|
status: SubscriptionPaymentStatus;
|
|
7598
7710
|
/** 기간 시작일 */
|
|
@@ -7861,14 +7973,19 @@ declare class SubscriptionAPI {
|
|
|
7861
7973
|
*/
|
|
7862
7974
|
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
7863
7975
|
/**
|
|
7864
|
-
* 요금제 스왑 (플랜 변경) — Paddle
|
|
7976
|
+
* 요금제 스왑 (플랜 변경) — MoR(Paddle · Dodo) 구독 전용
|
|
7865
7977
|
*
|
|
7866
|
-
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을
|
|
7867
|
-
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
7868
|
-
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
7978
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
7979
|
+
* proration 으로 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
7980
|
+
* PG 가 자동 크레딧해 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
7981
|
+
* 수렴합니다.
|
|
7869
7982
|
*
|
|
7870
7983
|
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
7871
|
-
*
|
|
7984
|
+
* 프로바이더가 지원하지 않는 정산 모드는 근사 대체 없이 400 `invalid_proration_mode` 입니다
|
|
7985
|
+
* (지원표는 {@link ProrationMode} 참조). 확정 전 정산액을 보여주려면 {@link previewChangePlan}
|
|
7986
|
+
* 을 먼저 호출하세요.
|
|
7987
|
+
*
|
|
7988
|
+
* toss/stripe/payapp/paypal 구독은 400 `plan_change_unsupported` 입니다.
|
|
7872
7989
|
*
|
|
7873
7990
|
* @param subscriptionId - 구독 ID
|
|
7874
7991
|
* @param data - 새 price + 정산 옵션
|
|
@@ -7877,7 +7994,7 @@ declare class SubscriptionAPI {
|
|
|
7877
7994
|
* @example
|
|
7878
7995
|
* ```typescript
|
|
7879
7996
|
* await client.subscription.changePlan(subscriptionId, {
|
|
7880
|
-
* provider_price_ref: 'pri_family_monthly',
|
|
7997
|
+
* provider_price_ref: 'pri_family_monthly', // Dodo 는 'pdt_*'
|
|
7881
7998
|
* plan_name: '가족 플랜',
|
|
7882
7999
|
* amount: 24900,
|
|
7883
8000
|
* proration_mode: 'prorated_immediately',
|
|
@@ -7886,12 +8003,20 @@ declare class SubscriptionAPI {
|
|
|
7886
8003
|
*/
|
|
7887
8004
|
changePlan(subscriptionId: string, data: ChangePlanRequest): Promise<SubscriptionResponse>;
|
|
7888
8005
|
/**
|
|
7889
|
-
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle
|
|
8006
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle · Dodo)
|
|
7890
8007
|
*
|
|
7891
|
-
* 세금·기존 크레딧 잔액까지 반영된
|
|
8008
|
+
* 세금·기존 크레딧 잔액까지 반영된 PG 계산값을 반환하므로, 확정 화면에
|
|
7892
8009
|
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
7893
8010
|
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
7894
8011
|
*
|
|
8012
|
+
* **금액은 반드시 짝이 되는 통화와 함께 표시하세요.** 즉시청구는 고객 표시통화
|
|
8013
|
+
* (`currency`), 정기 단가는 상품 통화(`recurring_currency`, 비면 `currency` 와 동일)입니다 —
|
|
8014
|
+
* MoR 의 adaptive currency 에서 둘이 다를 수 있습니다.
|
|
8015
|
+
*
|
|
8016
|
+
* 미리보기를 제공하지 않는 프로바이더는 400 `plan_change_preview_unsupported` 입니다.
|
|
8017
|
+
* 이는 **미리보기만** 없다는 뜻이며 {@link changePlan} 자체는 동작합니다
|
|
8018
|
+
* (요금제 변경 자체가 불가한 경우는 `plan_change_unsupported` 로 구분됩니다).
|
|
8019
|
+
*
|
|
7895
8020
|
* @param subscriptionId - 구독 ID
|
|
7896
8021
|
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
7897
8022
|
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
@@ -7901,7 +8026,9 @@ declare class SubscriptionAPI {
|
|
|
7901
8026
|
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
7902
8027
|
* provider_price_ref: 'pri_family_monthly',
|
|
7903
8028
|
* })
|
|
7904
|
-
* //
|
|
8029
|
+
* // 통화를 함께 포맷한다 — 금액만 쓰면 다통화에서 거짓 금액이 된다
|
|
8030
|
+
* format(preview.immediate_charge_amount, preview.currency)
|
|
8031
|
+
* format(preview.recurring_amount, preview.recurring_currency ?? preview.currency)
|
|
7905
8032
|
* ```
|
|
7906
8033
|
*/
|
|
7907
8034
|
previewChangePlan(subscriptionId: string, data: ChangePlanRequest): Promise<ChangePlanPreview>;
|
|
@@ -9638,4 +9765,4 @@ declare class ConnectBase {
|
|
|
9638
9765
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
9639
9766
|
}
|
|
9640
9767
|
|
|
9641
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, type PaymentMode, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
9768
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, type PaymentMode, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublicKeyPaymentMode, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.d.ts
CHANGED
|
@@ -5275,11 +5275,15 @@ type PaymentStatus = "pending" | "ready" | "in_progress" | "done" | "canceled" |
|
|
|
5275
5275
|
interface PreparePaymentRequest {
|
|
5276
5276
|
payment_provider?: PaymentProvider;
|
|
5277
5277
|
/**
|
|
5278
|
-
* 사용할 자격증명 모드 오버라이드(선택).
|
|
5278
|
+
* 사용할 자격증명 모드 오버라이드(선택).
|
|
5279
5279
|
*
|
|
5280
5280
|
* **서버에서 시크릿 키(`cb_sk_*`)로 호출할 때만 적용된다.** 브라우저에 실리는 공개 키
|
|
5281
5281
|
* (`cb_pk_*`) 호출에서는 무시된다 — 클라이언트가 test 를 골라 실제 돈 없이 "결제 성공"을
|
|
5282
5282
|
* 만들 수 있으면 결제 성공에 걸린 권한 부여가 통째로 우회되기 때문이다.
|
|
5283
|
+
*
|
|
5284
|
+
* 모드 결정 우선순위: 이 오버라이드 → **퍼블릭 키에 고정된 모드**(콘솔에서 키마다 지정) →
|
|
5285
|
+
* 콘솔의 프로바이더 모드 → test. 브라우저 앱에서 QA/프로덕션 결제를 나누려면 이 필드가 아니라
|
|
5286
|
+
* 키 단위 `payment_mode` 를 쓴다(`cb.publicKey` 참조).
|
|
5283
5287
|
*/
|
|
5284
5288
|
payment_mode?: PaymentMode;
|
|
5285
5289
|
/**
|
|
@@ -5374,8 +5378,21 @@ interface PaymentDetail {
|
|
|
5374
5378
|
payment_id: string;
|
|
5375
5379
|
order_id: string;
|
|
5376
5380
|
order_name: string;
|
|
5381
|
+
/** 고객이 실제 청구받은 금액 — `currency` 기준 최소단위 */
|
|
5377
5382
|
amount: number;
|
|
5383
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
5378
5384
|
currency: string;
|
|
5385
|
+
/**
|
|
5386
|
+
* 정산통화 환산액 (MoR 프로바이더가 제공할 때만).
|
|
5387
|
+
*
|
|
5388
|
+
* Paddle/Dodo 는 고객에게 표시통화로 청구하고 머천트에게는 환산된 정산통화로 지급한다.
|
|
5389
|
+
* 실제 입금액 대사에 쓰고, **고객에게 보여줄 금액은 언제나 `amount`/`currency`** 다.
|
|
5390
|
+
*/
|
|
5391
|
+
settlement_amount?: number;
|
|
5392
|
+
/** `settlement_amount` 의 통화 (ISO 4217) */
|
|
5393
|
+
settlement_currency?: string;
|
|
5394
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 제공 시) */
|
|
5395
|
+
country?: string;
|
|
5379
5396
|
status: PaymentStatus;
|
|
5380
5397
|
payment_provider?: PaymentProvider;
|
|
5381
5398
|
/** 이 결제가 사용한 자격증명 모드 (test | live). */
|
|
@@ -5414,7 +5431,10 @@ interface PaymentListItem {
|
|
|
5414
5431
|
payment_id: string;
|
|
5415
5432
|
order_id: string;
|
|
5416
5433
|
order_name: string;
|
|
5434
|
+
/** 고객이 실제 청구받은 금액 — `currency` 기준 최소단위 */
|
|
5417
5435
|
amount: number;
|
|
5436
|
+
/** `amount` 의 통화 (ISO 4217). 다통화 결제에서 앱 기본 통화를 가정하면 거짓 금액이 된다 */
|
|
5437
|
+
currency: string;
|
|
5418
5438
|
status: PaymentStatus;
|
|
5419
5439
|
method?: string;
|
|
5420
5440
|
/** toss | stripe 등 */
|
|
@@ -5591,6 +5611,22 @@ declare class PaymentAPI {
|
|
|
5591
5611
|
/**
|
|
5592
5612
|
* Public Key 관련 타입 정의
|
|
5593
5613
|
*/
|
|
5614
|
+
/**
|
|
5615
|
+
* 이 키로 들어온 결제가 쓸 자격증명 모드.
|
|
5616
|
+
*
|
|
5617
|
+
* - `inherit`(기본): 앱 결제 설정의 프로바이더 모드를 따른다.
|
|
5618
|
+
* - `test`: 이 키의 결제는 항상 테스트 키로 처리된다.
|
|
5619
|
+
* - `live`: 이 키의 결제는 항상 라이브 키로 처리된다.
|
|
5620
|
+
*
|
|
5621
|
+
* 앱 하나로 QA 빌드와 프로덕션 빌드를 함께 운영할 때 쓴다 — QA 빌드에 `test` 키를 심으면
|
|
5622
|
+
* 앱 설정이 라이브여도 그 키의 결제만 테스트로 처리되므로, 라이브 전환 이후에도 안전하게
|
|
5623
|
+
* 결제 회귀 테스트를 할 수 있다.
|
|
5624
|
+
*
|
|
5625
|
+
* 모드를 정하는 주체가 **서버에 저장된 키 설정**이라 클라이언트는 고를 수 없다. QA 키가
|
|
5626
|
+
* 유출돼도 만들 수 있는 건 테스트 결제뿐이다(권한 지급 로직이 결제의 `payment_mode` 를 함께
|
|
5627
|
+
* 검사하도록 만드는 것을 권장한다).
|
|
5628
|
+
*/
|
|
5629
|
+
type PublicKeyPaymentMode = "inherit" | "test" | "live";
|
|
5594
5630
|
/**
|
|
5595
5631
|
* Public Key 아이템
|
|
5596
5632
|
*/
|
|
@@ -5603,6 +5639,8 @@ interface PublicKeyItem {
|
|
|
5603
5639
|
key_prefix: string;
|
|
5604
5640
|
/** 활성화 상태 */
|
|
5605
5641
|
is_active: boolean;
|
|
5642
|
+
/** 이 키로 들어온 결제의 자격증명 모드 */
|
|
5643
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5606
5644
|
/** 마지막 사용 시간 */
|
|
5607
5645
|
last_used_at?: string;
|
|
5608
5646
|
/** 만료일 (null이면 무제한) */
|
|
@@ -5616,6 +5654,8 @@ interface PublicKeyItem {
|
|
|
5616
5654
|
interface CreatePublicKeyRequest {
|
|
5617
5655
|
/** Public Key 이름 (예: Production, Development) */
|
|
5618
5656
|
name: string;
|
|
5657
|
+
/** 이 키로 들어온 결제의 자격증명 모드 (기본: inherit) */
|
|
5658
|
+
payment_mode?: PublicKeyPaymentMode;
|
|
5619
5659
|
/** 만료일 (옵션) */
|
|
5620
5660
|
expires_at?: string;
|
|
5621
5661
|
}
|
|
@@ -5633,6 +5673,8 @@ interface CreatePublicKeyResponse {
|
|
|
5633
5673
|
key_prefix: string;
|
|
5634
5674
|
/** 활성화 상태 */
|
|
5635
5675
|
is_active: boolean;
|
|
5676
|
+
/** 이 키로 들어온 결제의 자격증명 모드 */
|
|
5677
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5636
5678
|
/** 만료일 */
|
|
5637
5679
|
expires_at?: string;
|
|
5638
5680
|
/** 생성일 */
|
|
@@ -5652,6 +5694,8 @@ interface UpdatePublicKeyRequest {
|
|
|
5652
5694
|
name?: string;
|
|
5653
5695
|
/** 활성화/비활성화 */
|
|
5654
5696
|
is_active?: boolean;
|
|
5697
|
+
/** 이 키로 들어온 결제의 자격증명 모드 변경 */
|
|
5698
|
+
payment_mode?: PublicKeyPaymentMode;
|
|
5655
5699
|
}
|
|
5656
5700
|
/**
|
|
5657
5701
|
* Public Key 수정 응답
|
|
@@ -5661,6 +5705,7 @@ interface UpdatePublicKeyResponse {
|
|
|
5661
5705
|
name: string;
|
|
5662
5706
|
key_prefix: string;
|
|
5663
5707
|
is_active: boolean;
|
|
5708
|
+
payment_mode: PublicKeyPaymentMode;
|
|
5664
5709
|
expires_at?: string;
|
|
5665
5710
|
created_at: string;
|
|
5666
5711
|
}
|
|
@@ -7410,8 +7455,19 @@ interface CreateSubscriptionRequest {
|
|
|
7410
7455
|
customer_phone?: string;
|
|
7411
7456
|
/** payapp 정기결제 만료일 yyyy-mm-dd (미입력시 +10년) */
|
|
7412
7457
|
expire_date?: string;
|
|
7413
|
-
/**
|
|
7458
|
+
/** MoR 필수: PG 카탈로그의 recurring price/product ref (Paddle `pri_*` / Dodo `pdt_*`) */
|
|
7414
7459
|
provider_price_ref?: string;
|
|
7460
|
+
/**
|
|
7461
|
+
* 사용할 자격증명 모드 오버라이드 (test|live). 단건결제 `prepare()` 의 `payment_mode` 와
|
|
7462
|
+
* 적용 조건이 **완전히 동일**하다 — 서버 시크릿 키(`cb_sk_*`)로 승격된 호출에서만 적용되고,
|
|
7463
|
+
* 브라우저 공개 키(`cb_pk_*`) 호출에서는 무시된다.
|
|
7464
|
+
*
|
|
7465
|
+
* 모드 결정 우선순위: 이 오버라이드 → 퍼블릭 키에 고정된 모드 → 앱 결제 설정의 프로바이더 모드
|
|
7466
|
+
* → test. 브라우저 앱에서 QA/프로덕션을 나누려면 이 필드가 아니라 키 단위 모드를 쓴다.
|
|
7467
|
+
*
|
|
7468
|
+
* 구독은 생성 시점 모드가 고정되므로 이후 갱신 청구·해지도 같은 키로 처리된다.
|
|
7469
|
+
*/
|
|
7470
|
+
payment_mode?: "test" | "live";
|
|
7415
7471
|
/** 메타데이터 */
|
|
7416
7472
|
metadata?: Record<string, unknown>;
|
|
7417
7473
|
}
|
|
@@ -7441,10 +7497,26 @@ interface SubscriptionResponse {
|
|
|
7441
7497
|
plan_name: string;
|
|
7442
7498
|
/** 플랜 설명 */
|
|
7443
7499
|
plan_description: string;
|
|
7444
|
-
/**
|
|
7500
|
+
/**
|
|
7501
|
+
* 이 구독이 고정한 자격증명 모드 (test=테스트 키 | live=실결제).
|
|
7502
|
+
*
|
|
7503
|
+
* 생성 시점 값이 박히므로 이후 앱 모드를 바꿔도 갱신 청구는 원래 키로 처리된다.
|
|
7504
|
+
* **프로바이더 중립 필드**라 목록에서 테스트 구독과 실구독을 가르는 데 이 필드를 쓴다
|
|
7505
|
+
* (`environment` 는 Paddle 의 sandbox|production 이라 다른 프로바이더에서는 기대할 수 없다).
|
|
7506
|
+
*/
|
|
7507
|
+
payment_mode?: "test" | "live";
|
|
7508
|
+
/**
|
|
7509
|
+
* 정기 청구 단가 (`currency` 기준 최소단위).
|
|
7510
|
+
*
|
|
7511
|
+
* MoR(Paddle/Dodo)은 상품 통화와 고객 표시통화가 다를 수 있으므로(adaptive currency),
|
|
7512
|
+
* 이 값을 해석할 때는 반드시 `currency` 를 함께 봐야 한다. 앱의 기본 통화를 가정하면
|
|
7513
|
+
* 거짓 금액이 된다(예: $10.10 을 ₩1,010 으로 표기).
|
|
7514
|
+
*/
|
|
7445
7515
|
amount: number;
|
|
7446
|
-
/** 통화 */
|
|
7516
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
7447
7517
|
currency: string;
|
|
7518
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 프로바이더가 제공할 때만) */
|
|
7519
|
+
country?: string;
|
|
7448
7520
|
/** 결제 주기 */
|
|
7449
7521
|
billing_cycle: BillingCycle;
|
|
7450
7522
|
/** 결제일 */
|
|
@@ -7465,7 +7537,10 @@ interface SubscriptionResponse {
|
|
|
7465
7537
|
ended_at: string | null;
|
|
7466
7538
|
/** 트라이얼 종료일 */
|
|
7467
7539
|
trial_end_at: string | null;
|
|
7468
|
-
/**
|
|
7540
|
+
/**
|
|
7541
|
+
* 총 결제 금액 — 결제 이력 금액의 합이며 **각 결제의 표시통화** 기준이다.
|
|
7542
|
+
* 위 `currency` 와 다를 수 있으므로, 통화별 정확한 집계는 결제 이력의 `currency` 로 그룹핑할 것.
|
|
7543
|
+
*/
|
|
7469
7544
|
total_paid: number;
|
|
7470
7545
|
/** 결제 횟수 */
|
|
7471
7546
|
payment_count: number;
|
|
@@ -7513,7 +7588,23 @@ interface CancelSubscriptionRequest {
|
|
|
7513
7588
|
* - `full_next_billing_period`: 새 플랜 전액을 다음 청구일에 부과.
|
|
7514
7589
|
* - `do_not_bill`: 전환만 하고 청구하지 않음.
|
|
7515
7590
|
*/
|
|
7516
|
-
|
|
7591
|
+
/**
|
|
7592
|
+
* 요금제 스왑 시 남은 금액 정산 방식.
|
|
7593
|
+
*
|
|
7594
|
+
* **프로바이더별 지원 범위가 다르다.** 미지원 값은 근사 대체 없이 400
|
|
7595
|
+
* `invalid_proration_mode` 로 거절된다 — "다음 청구일에 부과"를 조용히 "지금 청구"로 바꾸면
|
|
7596
|
+
* 요청하지 않은 즉시 출금이 발생하기 때문이다.
|
|
7597
|
+
*
|
|
7598
|
+
* | 값 | Paddle | Dodo |
|
|
7599
|
+
* | --- | --- | --- |
|
|
7600
|
+
* | `prorated_immediately` (기본) | ✅ | ✅ |
|
|
7601
|
+
* | `full_immediately` | ✅ | ✅ |
|
|
7602
|
+
* | `do_not_bill` | ✅ | ✅ |
|
|
7603
|
+
* | `prorated_next_billing_period` | ✅ | ❌ |
|
|
7604
|
+
* | `full_next_billing_period` | ✅ | ❌ |
|
|
7605
|
+
* | `difference_immediately` | ❌ | ✅ |
|
|
7606
|
+
*/
|
|
7607
|
+
type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "full_immediately" | "full_next_billing_period" | "difference_immediately" | "do_not_bill";
|
|
7517
7608
|
/**
|
|
7518
7609
|
* 즉시청구(prorated/full_immediately) 실패 시 플랜 변경을 적용할지.
|
|
7519
7610
|
*
|
|
@@ -7522,19 +7613,22 @@ type ProrationMode = "prorated_immediately" | "prorated_next_billing_period" | "
|
|
|
7522
7613
|
*/
|
|
7523
7614
|
type OnPaymentFailure = "prevent_change" | "apply_change";
|
|
7524
7615
|
/**
|
|
7525
|
-
* 요금제 스왑(플랜 변경) 요청 — Paddle
|
|
7616
|
+
* 요금제 스왑(플랜 변경) 요청 — MoR(Paddle/Dodo) 구독 전용.
|
|
7617
|
+
*
|
|
7618
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
7619
|
+
* proration 으로 정산한다. 예) 혼자→가족 in-place 업그레이드.
|
|
7526
7620
|
*
|
|
7527
|
-
*
|
|
7528
|
-
*
|
|
7621
|
+
* toss/stripe/payapp/paypal 구독은 PG 네이티브 proration 이 없어 400
|
|
7622
|
+
* `plan_change_unsupported` 다.
|
|
7529
7623
|
*/
|
|
7530
7624
|
interface ChangePlanRequest {
|
|
7531
|
-
/** 새 recurring price
|
|
7625
|
+
/** 새 recurring price/product ref (Paddle `pri_*` / Dodo `pdt_*`) — 필수 */
|
|
7532
7626
|
provider_price_ref: string;
|
|
7533
7627
|
/** 우리 표시용 플랜명 (선택) */
|
|
7534
7628
|
plan_name?: string;
|
|
7535
7629
|
/** 우리 표시용 플랜 설명 (선택) */
|
|
7536
7630
|
plan_description?: string;
|
|
7537
|
-
/** 우리 기록용 정기 금액 (선택 — 미지정 시
|
|
7631
|
+
/** 우리 기록용 정기 금액 (선택 — 미지정 시 PG 값으로 자동 수렴) */
|
|
7538
7632
|
amount?: number;
|
|
7539
7633
|
/** 정산 방식 (기본: prorated_immediately) */
|
|
7540
7634
|
proration_mode?: ProrationMode;
|
|
@@ -7546,8 +7640,12 @@ interface ChangePlanRequest {
|
|
|
7546
7640
|
/**
|
|
7547
7641
|
* 요금제 스왑 미리보기 응답 — 실제 적용 없이 정산 결과만 계산.
|
|
7548
7642
|
*
|
|
7549
|
-
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된
|
|
7550
|
-
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로
|
|
7643
|
+
* `immediate_charge_amount` 는 세금·기존 크레딧 잔액까지 반영된 PG 계산값(권위)이다.
|
|
7644
|
+
* 확정 화면에 "지금 ₩X 청구, 이후 ₩Y/주기" 로 그대로 노출한다(직접 차액을 계산하지 말 것).
|
|
7645
|
+
*
|
|
7646
|
+
* **통화가 둘인 이유**: 즉시청구는 고객 표시통화로, 정기 단가는 상품 통화로 계산된다. MoR 의
|
|
7647
|
+
* adaptive currency 에서 이 둘이 다를 수 있어 각각 통화를 싣는다. 금액을 표시할 때는 반드시
|
|
7648
|
+
* 짝이 되는 통화 필드를 함께 써야 한다 — 하나의 통화로 뭉치면 확정 직전 화면에 거짓 금액이 뜬다.
|
|
7551
7649
|
*/
|
|
7552
7650
|
interface ChangePlanPreview {
|
|
7553
7651
|
/** 적용된 정산 모드 */
|
|
@@ -7556,13 +7654,19 @@ interface ChangePlanPreview {
|
|
|
7556
7654
|
immediate_charge_action?: "charge" | "credit";
|
|
7557
7655
|
/** 지금 순액(minor). 청구=양수, 크레딧=음수 */
|
|
7558
7656
|
immediate_charge_amount: number;
|
|
7657
|
+
/** `immediate_charge_amount` 의 통화 (ISO 4217) */
|
|
7658
|
+
currency: string;
|
|
7559
7659
|
/** 새 플랜의 다음 정기 청구액(minor) */
|
|
7560
7660
|
recurring_amount: number;
|
|
7561
|
-
/**
|
|
7562
|
-
|
|
7661
|
+
/** `recurring_amount` 의 통화. 비어 있으면 `currency` 와 동일 */
|
|
7662
|
+
recurring_currency?: string;
|
|
7663
|
+
/** 즉시청구의 정산통화 환산액 (MoR 제공 시) — 매출 대사용, 고객 표시에는 쓰지 말 것 */
|
|
7664
|
+
settlement_amount?: number;
|
|
7665
|
+
/** `settlement_amount` 의 통화 */
|
|
7666
|
+
settlement_currency?: string;
|
|
7563
7667
|
/** 다음 청구 예정일 */
|
|
7564
7668
|
next_billed_at?: string | null;
|
|
7565
|
-
/** 미리보기가 반영한 새 price
|
|
7669
|
+
/** 미리보기가 반영한 새 price/product ref */
|
|
7566
7670
|
new_provider_price_ref?: string;
|
|
7567
7671
|
}
|
|
7568
7672
|
interface ListSubscriptionsRequest {
|
|
@@ -7585,14 +7689,22 @@ interface SubscriptionPaymentResponse {
|
|
|
7585
7689
|
id: string;
|
|
7586
7690
|
/** 구독 ID */
|
|
7587
7691
|
subscription_id: string;
|
|
7692
|
+
/** 이 청구를 처리한 결제 프로바이더 */
|
|
7693
|
+
provider?: string;
|
|
7588
7694
|
/** 토스 결제 키 */
|
|
7589
7695
|
payment_key: string;
|
|
7590
7696
|
/** 주문 ID */
|
|
7591
7697
|
order_id: string;
|
|
7592
|
-
/** 결제 금액 */
|
|
7698
|
+
/** 결제 금액 — 고객이 실제 청구받은 **표시통화** 기준 */
|
|
7593
7699
|
amount: number;
|
|
7594
|
-
/** 통화 */
|
|
7700
|
+
/** `amount` 의 통화 (ISO 4217) */
|
|
7595
7701
|
currency: string;
|
|
7702
|
+
/** 정산통화 환산액 (MoR 제공 시) — 매출 대사용, 고객 표시에는 쓰지 말 것 */
|
|
7703
|
+
settlement_amount?: number;
|
|
7704
|
+
/** `settlement_amount` 의 통화 */
|
|
7705
|
+
settlement_currency?: string;
|
|
7706
|
+
/** 청구 국가 ISO 3166-1 alpha-2 (MoR 제공 시) */
|
|
7707
|
+
country?: string;
|
|
7596
7708
|
/** 결제 상태 */
|
|
7597
7709
|
status: SubscriptionPaymentStatus;
|
|
7598
7710
|
/** 기간 시작일 */
|
|
@@ -7861,14 +7973,19 @@ declare class SubscriptionAPI {
|
|
|
7861
7973
|
*/
|
|
7862
7974
|
cancel(subscriptionId: string, data?: CancelSubscriptionRequest): Promise<SubscriptionResponse>;
|
|
7863
7975
|
/**
|
|
7864
|
-
* 요금제 스왑 (플랜 변경) — Paddle
|
|
7976
|
+
* 요금제 스왑 (플랜 변경) — MoR(Paddle · Dodo) 구독 전용
|
|
7865
7977
|
*
|
|
7866
|
-
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을
|
|
7867
|
-
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
7868
|
-
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
7978
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
7979
|
+
* proration 으로 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
7980
|
+
* PG 가 자동 크레딧해 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
7981
|
+
* 수렴합니다.
|
|
7869
7982
|
*
|
|
7870
7983
|
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
7871
|
-
*
|
|
7984
|
+
* 프로바이더가 지원하지 않는 정산 모드는 근사 대체 없이 400 `invalid_proration_mode` 입니다
|
|
7985
|
+
* (지원표는 {@link ProrationMode} 참조). 확정 전 정산액을 보여주려면 {@link previewChangePlan}
|
|
7986
|
+
* 을 먼저 호출하세요.
|
|
7987
|
+
*
|
|
7988
|
+
* toss/stripe/payapp/paypal 구독은 400 `plan_change_unsupported` 입니다.
|
|
7872
7989
|
*
|
|
7873
7990
|
* @param subscriptionId - 구독 ID
|
|
7874
7991
|
* @param data - 새 price + 정산 옵션
|
|
@@ -7877,7 +7994,7 @@ declare class SubscriptionAPI {
|
|
|
7877
7994
|
* @example
|
|
7878
7995
|
* ```typescript
|
|
7879
7996
|
* await client.subscription.changePlan(subscriptionId, {
|
|
7880
|
-
* provider_price_ref: 'pri_family_monthly',
|
|
7997
|
+
* provider_price_ref: 'pri_family_monthly', // Dodo 는 'pdt_*'
|
|
7881
7998
|
* plan_name: '가족 플랜',
|
|
7882
7999
|
* amount: 24900,
|
|
7883
8000
|
* proration_mode: 'prorated_immediately',
|
|
@@ -7886,12 +8003,20 @@ declare class SubscriptionAPI {
|
|
|
7886
8003
|
*/
|
|
7887
8004
|
changePlan(subscriptionId: string, data: ChangePlanRequest): Promise<SubscriptionResponse>;
|
|
7888
8005
|
/**
|
|
7889
|
-
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle
|
|
8006
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle · Dodo)
|
|
7890
8007
|
*
|
|
7891
|
-
* 세금·기존 크레딧 잔액까지 반영된
|
|
8008
|
+
* 세금·기존 크레딧 잔액까지 반영된 PG 계산값을 반환하므로, 확정 화면에
|
|
7892
8009
|
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
7893
8010
|
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
7894
8011
|
*
|
|
8012
|
+
* **금액은 반드시 짝이 되는 통화와 함께 표시하세요.** 즉시청구는 고객 표시통화
|
|
8013
|
+
* (`currency`), 정기 단가는 상품 통화(`recurring_currency`, 비면 `currency` 와 동일)입니다 —
|
|
8014
|
+
* MoR 의 adaptive currency 에서 둘이 다를 수 있습니다.
|
|
8015
|
+
*
|
|
8016
|
+
* 미리보기를 제공하지 않는 프로바이더는 400 `plan_change_preview_unsupported` 입니다.
|
|
8017
|
+
* 이는 **미리보기만** 없다는 뜻이며 {@link changePlan} 자체는 동작합니다
|
|
8018
|
+
* (요금제 변경 자체가 불가한 경우는 `plan_change_unsupported` 로 구분됩니다).
|
|
8019
|
+
*
|
|
7895
8020
|
* @param subscriptionId - 구독 ID
|
|
7896
8021
|
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
7897
8022
|
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
@@ -7901,7 +8026,9 @@ declare class SubscriptionAPI {
|
|
|
7901
8026
|
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
7902
8027
|
* provider_price_ref: 'pri_family_monthly',
|
|
7903
8028
|
* })
|
|
7904
|
-
* //
|
|
8029
|
+
* // 통화를 함께 포맷한다 — 금액만 쓰면 다통화에서 거짓 금액이 된다
|
|
8030
|
+
* format(preview.immediate_charge_amount, preview.currency)
|
|
8031
|
+
* format(preview.recurring_amount, preview.recurring_currency ?? preview.currency)
|
|
7905
8032
|
* ```
|
|
7906
8033
|
*/
|
|
7907
8034
|
previewChangePlan(subscriptionId: string, data: ChangePlanRequest): Promise<ChangePlanPreview>;
|
|
@@ -9638,4 +9765,4 @@ declare class ConnectBase {
|
|
|
9638
9765
|
updateConfig(config: Partial<ConnectBaseConfig>): void;
|
|
9639
9766
|
}
|
|
9640
9767
|
|
|
9641
|
-
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, type PaymentMode, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
|
9768
|
+
export { AIAPI, type AIChatRequest, type AIChatResponse, type AIChatStreamCallbacks, type AIChatStreamOptions, type AIMessage, type AISource, type AIStreamChunk, type AITool, type AIToolCall, type AIToolEvent, AUTH_MEMBER_ID_TOKEN, type AckMessagesRequest, type AdMobDailyReport, type AdMobReportResponse, type AdMobReportSummary, type AdReportResponse, type AdReportSummary, type AdmobConnectionInfo, AdsAPI, type AdsenseConnectionInfo, type AgenticSearchProgress, type AggregateResult, type AggregateStage, type AnalyticsConfig, type AnalyticsEvent, ApiError, type ApiErrorDetail, type AppStatsResponse, type ArchivePolicy, type AtomicOperator, type AtomicOperatorType, AuthError, type AuthSettingsResponse, type BackupInfo, type BatchOperation, type BatchOperationResult, type BatchSetPageMetaRequest, type BatchWriteResult, type BillingCycle, type BillingKeyResponse, type BiometricInfo, type BiometricResult, type BulkCreateResponse, type BulkError, type CPUInfo, type CancelPaymentRequest, type CancelPaymentResponse, type CancelSubscriptionRequest, type CategoryInfo, type ChangePlanPreview, type ChangePlanRequest, type Channel, type ChannelMembership, type ChannelStats, type ChargeWithBillingKeyRequest, type ChargeWithBillingKeyResponse, type ChatMessage, type ClientMessage, type ColumnSchema, type CommentListResponse, type CompleteUploadRequest, type CompleteUploadResponse, type ConfirmBillingKeyRequest, type ConfirmPaymentRequest, type ConfirmPaymentResponse, ConnectBase, type ConnectBaseConfig, type ConnectedData, type ConnectionState, type ConsentOptions, type ConsumeMessagesResponse, type ConsumeOptions, type CopyTableRequest, type CopyTableResponse, type CreateBackupRequest, type CreateChannelRequest, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreateColumnRequest, type CreateDataRequest, type CreateDocumentRequest, type CreateFolderRequest, type CreateFolderResponse, type CreateGeoIndexRequest, type CreateIndexRequest, type CreateLobbyRequest, type CreatePlaylistRequest, type CreatePublicKeyRequest, type CreatePublicKeyResponse, type CreateRelationRequest, type CreateRolePayload, type CreateRoleResult, type CreateRoomResult, type CreateSearchIndexRequest, type CreateSecurityRuleRequest, type CreateSubscriptionRequest, type CreateTableRequest, type CreateTriggerRequest, type CreateVideoStorageRequest, type DailyReport, type DataItem, type DataType, type DatabaseChange, type DatabaseChangeMessage, type DatabaseChangeType, type DatabaseRealtimeConnectOptions, type DatabaseRealtimeFilter, type DatabaseRealtimeHandlers, type DatabaseRealtimeSubscription, type DatabaseSnapshot, type DatabaseSnapshotMessage, type DatabaseSubscribeOptions, type DeleteWhereResponse, type DeviceInfo, type DocumentResponse, type EnabledProviderInfo, type EnabledProvidersResponse, EndpointAPI, type EndpointCallInit, type ErrorHandler, type ErrorMessage, type ErrorReport, type ErrorTrackerConfig, type ErrorType, type ExportDataRequest, type ExportDataResponse, type FetchDataResponse, type FetchFilesResponse, type FetchPublicKeysResponse, type FileItem, type FileStats, GameAPI, type GameAction, type GameClientConfig, type GameConfig, GameConfigAPI, type GameConfigPatch, type GameConnectionState, type GameConnectionStatus, type GameDelta, GameError, type GameErrorCode, type GameEventHandlers, type GamePlayer, GameRoom, type GameRoomConfig, type GameRoomInfo, GameRoomTransport, type GameServerMessage, type GameServerMessageType, type GameState, type GameTransportConfig, type GenerateUploadURLByPathRequest, type GenerateUploadURLRequest, type GenerateUploadURLResponse, type GeoBoundingBox, type GeoIndex, type GeoNear, type GeoPoint, type GeoPolygon, type GeoQuery, type GeoResponse, type GeoResult, type GetAuthorizationURLResponse, type GetFileByPathResponse, type GoogleConnectionStatus, type HistoryResponse, type ICEServer, type ICEServersResponse, type ImageResult, type ImportDataRequest, type ImportDataResponse, type IndexAnalysis, type IndexRecommendation, type InitUploadResponse, type InvokeFunctionRequest, type InvokeFunctionResponse, type IssueBillingKeyRequest, type IssueBillingKeyResponse, type JoinQueueRequest, type JoinRoomRequest, type JoinRoomResponse, type KnowledgeSearchRequest, type KnowledgeSearchResponse, type KnowledgeSearchResult, type LeaderboardEntry, type LeaderboardListResponse, type LeaderboardScoreEntry, type LifecyclePolicy, type ListBillingKeysResponse, type ListDocumentsResponse, type ListPageMetasOptions, type ListPageMetasResponse, type ListPaymentsOptions, type ListSubscriptionPaymentsRequest, type ListSubscriptionPaymentsResponse, type ListSubscriptionsRequest, type ListSubscriptionsResponse, type LobbyInfo, type LobbyInvite, type LobbyMember, type LobbyVisibility, type MatchResult, type MatchmakingTicket, type MatchqueueListResponse, type MatchqueueTicket, type MemberInfoResponse, type MemberSignInRequest, type MemberSignInResponse, type MemberSignUpRequest, type MemberSignUpResponse, type MembershipTier, type MemoryInfo, type MessageHandler, type MigrateDataRequest, type MigrateDataResponse, type MoveFileRequest, type NackMessageRequest, NativeAPI, type OAuthCallbackResponse, type OAuthProvider, type OnPaymentFailure, type OpenDialogOptions, type OpenDialogResult, type PageMetaResponse, type PartyInfo, type PartyInvite, type PartyMember, type PauseSubscriptionRequest, type PaymentDetail, type PaymentListItem, type PaymentListResult, type PaymentMode, type PaymentProvider, type PaymentStatus, type PeerInfo, type Platform, type PlayerEvent, type PlayerStats, type Playlist, type PlaylistItem, type PollUntilOptions, type PongMessage, type PopulateOption, type Position, type PreparePaymentRequest, type PreparePaymentResponse, type PresenceChangeHandler, type PresenceInfo, type PresenceSetOptions, type PresenceStatus, type PresenceStatusResult, type ProrationMode, type PublicKeyItem, type PublicKeyPaymentMode, type PublishBatchRequest, type PublishBatchResponse, type PublishMessageRequest, type PublishMessageResponse, type PushPlatform, type PushStatsResult, type QualityProgress, type QueryOptions, type QueueInfoResponse, type QueueMessage, type ReadReceiptHandler, type ReadReceiptInfo, type RealtimeConnectOptions, type RealtimeMessage, type RegisterDeviceRequest, type RelationType, type RenameFileRequest, type RenameFileResponse, type ReplayHighlight, type ReplayInfo, type ReplayPlayerInfo, type RestoreBackupRequest, type RestoreBackupResponse, type RetentionPolicy, type RoleDetail, type RoleList, type RoleListItem, type RolePermissionItem, type RoleUserItem, RolesAPI, type RoomInfo, type RoomStaleMessage, type RoomSummary, type RoomsResponse, type SaveDialogOptions, type SaveDialogResult, type ScriptDetailResponse, type ScriptListResponse, type ScriptMeta, type ScriptVersion, type ScriptVersionListResponse, type SearchIndex, type SearchOptions, type SearchResponse, type SearchResult, type SecurityRule, type SendOptions, type SendSuperChatOptions, type SendSuperChatResponse, type ServerMessage, SessionManager, type SetPageMetaRequest, type Shorts, type ShortsListResponse, type SignalingMessage, type SignalingMessageType, type SlowQueryInfo, type SpectatorInfo, type SpectatorPlayerState, type SpectatorState, type SpeechRecognizeOptions, type SpeechResult, type StateChange, type StateChangeHandler, type StorageUploadOptions, type StorageUploadProgress, type StreamContentPart, type StreamDoneCallback, type StreamDoneData, type StreamErrorCallback, type StreamHandlers, type StreamImageURLPart, type StreamMessage, type StreamOptions, type StreamSession, type StreamTextPart, type StreamTokenCallback, type StreamToolCallCallback, type StreamToolResultCallback, type StreamURLResponse, type SubscribeOptions, type SubscribeTopicRequest, type SubscribedData, type Subscription, type SubscriptionPaymentResponse, type SubscriptionPaymentStatus, type SubscriptionResponse, type SubscriptionStatus, type SuperChat, type SuperChatType, type SystemInfo, type TTLConfig, type TableAccessLevel, type TableColumnDef, type TableIndex, type TableRelation, type TableSchema, type TableSchemaDefinition, type TokenPersistence, type TransactionRead, type TransactionResult, type TransactionWrite, type TransactionWriteResult, type TranscodeStatus, type TransportType, type Trigger, type TriggerEvent, type TriggerHandlerType, type TypingChangeHandler, type TypingInfo, type UpdateBillingKeyRequest, type UpdateChannelRequest, type UpdateColumnRequest, type UpdateCustomDataRequest, type UpdateCustomDataResponse, type UpdateDataRequest, type UpdateDocumentRequest, type UpdateLobbyRequest, type UpdatePublicKeyRequest, type UpdatePublicKeyResponse, type UpdateRolePayload, type UpdateSecurityRuleRequest, type UpdateSubscriptionRequest, type UpdateTriggerRequest, type UpdateVideoRequest, type UpdateVideoStorageRequest, type UploadByPathOptions, type UploadFileOptions, type UploadFileResponse, type UploadOptions, type UploadProgress, type VAPIDPublicKeyResponse, type ValidateResponse, type ValidationSchema, type ValidationSchemaField, type ValidationStateTransitions, type Video, type VideoComment, type VideoCompleteUploadResponse, type VideoListOptions, type VideoListResponse, VideoProcessingError, type VideoQuality, type VideoStatus, type VideoStorage, type VideoStorageListResponse, type VideoVisibility, type VoiceChannel, type VoiceMember, type WaitOptions, type WatchHistoryItem, type WebPushSubscription, type WebRTCConnectOptions, type WebRTCConnectionState, type WebRTCMode, type WhereCondition, type WhereOperator, ConnectBase as default, detectInAppBrowser, escapeToExternalBrowser, isWebTransportSupported, toCreateRoomWire };
|
package/dist/index.js
CHANGED
|
@@ -8987,14 +8987,19 @@ var SubscriptionAPI = class {
|
|
|
8987
8987
|
);
|
|
8988
8988
|
}
|
|
8989
8989
|
/**
|
|
8990
|
-
* 요금제 스왑 (플랜 변경) — Paddle
|
|
8990
|
+
* 요금제 스왑 (플랜 변경) — MoR(Paddle · Dodo) 구독 전용
|
|
8991
8991
|
*
|
|
8992
|
-
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을
|
|
8993
|
-
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
8994
|
-
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
8992
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
8993
|
+
* proration 으로 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
8994
|
+
* PG 가 자동 크레딧해 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
8995
|
+
* 수렴합니다.
|
|
8995
8996
|
*
|
|
8996
8997
|
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
8997
|
-
*
|
|
8998
|
+
* 프로바이더가 지원하지 않는 정산 모드는 근사 대체 없이 400 `invalid_proration_mode` 입니다
|
|
8999
|
+
* (지원표는 {@link ProrationMode} 참조). 확정 전 정산액을 보여주려면 {@link previewChangePlan}
|
|
9000
|
+
* 을 먼저 호출하세요.
|
|
9001
|
+
*
|
|
9002
|
+
* toss/stripe/payapp/paypal 구독은 400 `plan_change_unsupported` 입니다.
|
|
8998
9003
|
*
|
|
8999
9004
|
* @param subscriptionId - 구독 ID
|
|
9000
9005
|
* @param data - 새 price + 정산 옵션
|
|
@@ -9003,7 +9008,7 @@ var SubscriptionAPI = class {
|
|
|
9003
9008
|
* @example
|
|
9004
9009
|
* ```typescript
|
|
9005
9010
|
* await client.subscription.changePlan(subscriptionId, {
|
|
9006
|
-
* provider_price_ref: 'pri_family_monthly',
|
|
9011
|
+
* provider_price_ref: 'pri_family_monthly', // Dodo 는 'pdt_*'
|
|
9007
9012
|
* plan_name: '가족 플랜',
|
|
9008
9013
|
* amount: 24900,
|
|
9009
9014
|
* proration_mode: 'prorated_immediately',
|
|
@@ -9018,12 +9023,20 @@ var SubscriptionAPI = class {
|
|
|
9018
9023
|
);
|
|
9019
9024
|
}
|
|
9020
9025
|
/**
|
|
9021
|
-
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle
|
|
9026
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle · Dodo)
|
|
9022
9027
|
*
|
|
9023
|
-
* 세금·기존 크레딧 잔액까지 반영된
|
|
9028
|
+
* 세금·기존 크레딧 잔액까지 반영된 PG 계산값을 반환하므로, 확정 화면에
|
|
9024
9029
|
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
9025
9030
|
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
9026
9031
|
*
|
|
9032
|
+
* **금액은 반드시 짝이 되는 통화와 함께 표시하세요.** 즉시청구는 고객 표시통화
|
|
9033
|
+
* (`currency`), 정기 단가는 상품 통화(`recurring_currency`, 비면 `currency` 와 동일)입니다 —
|
|
9034
|
+
* MoR 의 adaptive currency 에서 둘이 다를 수 있습니다.
|
|
9035
|
+
*
|
|
9036
|
+
* 미리보기를 제공하지 않는 프로바이더는 400 `plan_change_preview_unsupported` 입니다.
|
|
9037
|
+
* 이는 **미리보기만** 없다는 뜻이며 {@link changePlan} 자체는 동작합니다
|
|
9038
|
+
* (요금제 변경 자체가 불가한 경우는 `plan_change_unsupported` 로 구분됩니다).
|
|
9039
|
+
*
|
|
9027
9040
|
* @param subscriptionId - 구독 ID
|
|
9028
9041
|
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
9029
9042
|
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
@@ -9033,7 +9046,9 @@ var SubscriptionAPI = class {
|
|
|
9033
9046
|
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
9034
9047
|
* provider_price_ref: 'pri_family_monthly',
|
|
9035
9048
|
* })
|
|
9036
|
-
* //
|
|
9049
|
+
* // 통화를 함께 포맷한다 — 금액만 쓰면 다통화에서 거짓 금액이 된다
|
|
9050
|
+
* format(preview.immediate_charge_amount, preview.currency)
|
|
9051
|
+
* format(preview.recurring_amount, preview.recurring_currency ?? preview.currency)
|
|
9037
9052
|
* ```
|
|
9038
9053
|
*/
|
|
9039
9054
|
async previewChangePlan(subscriptionId, data) {
|
package/dist/index.mjs
CHANGED
|
@@ -8941,14 +8941,19 @@ var SubscriptionAPI = class {
|
|
|
8941
8941
|
);
|
|
8942
8942
|
}
|
|
8943
8943
|
/**
|
|
8944
|
-
* 요금제 스왑 (플랜 변경) — Paddle
|
|
8944
|
+
* 요금제 스왑 (플랜 변경) — MoR(Paddle · Dodo) 구독 전용
|
|
8945
8945
|
*
|
|
8946
|
-
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price 로 갈아타고 남은 금액을
|
|
8947
|
-
* 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
8948
|
-
* 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
8946
|
+
* 하나의 구독을 유지한 채(id 동일) 다른 recurring price/product 로 갈아타고 남은 금액을 PG 의
|
|
8947
|
+
* proration 으로 즉시 정산합니다. 예) 혼자→가족 in-place 업그레이드 — 이미 낸 혼자 미사용분을
|
|
8948
|
+
* PG 가 자동 크레딧해 첫 가족 청구에서 차감합니다. 즉시청구 차액의 결제 확정은 웹훅(SoT)으로
|
|
8949
|
+
* 수렴합니다.
|
|
8949
8950
|
*
|
|
8950
8951
|
* `proration_mode` 미지정 시 `prorated_immediately`(업그레이드 기본)가 적용됩니다.
|
|
8951
|
-
*
|
|
8952
|
+
* 프로바이더가 지원하지 않는 정산 모드는 근사 대체 없이 400 `invalid_proration_mode` 입니다
|
|
8953
|
+
* (지원표는 {@link ProrationMode} 참조). 확정 전 정산액을 보여주려면 {@link previewChangePlan}
|
|
8954
|
+
* 을 먼저 호출하세요.
|
|
8955
|
+
*
|
|
8956
|
+
* toss/stripe/payapp/paypal 구독은 400 `plan_change_unsupported` 입니다.
|
|
8952
8957
|
*
|
|
8953
8958
|
* @param subscriptionId - 구독 ID
|
|
8954
8959
|
* @param data - 새 price + 정산 옵션
|
|
@@ -8957,7 +8962,7 @@ var SubscriptionAPI = class {
|
|
|
8957
8962
|
* @example
|
|
8958
8963
|
* ```typescript
|
|
8959
8964
|
* await client.subscription.changePlan(subscriptionId, {
|
|
8960
|
-
* provider_price_ref: 'pri_family_monthly',
|
|
8965
|
+
* provider_price_ref: 'pri_family_monthly', // Dodo 는 'pdt_*'
|
|
8961
8966
|
* plan_name: '가족 플랜',
|
|
8962
8967
|
* amount: 24900,
|
|
8963
8968
|
* proration_mode: 'prorated_immediately',
|
|
@@ -8972,12 +8977,20 @@ var SubscriptionAPI = class {
|
|
|
8972
8977
|
);
|
|
8973
8978
|
}
|
|
8974
8979
|
/**
|
|
8975
|
-
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle
|
|
8980
|
+
* 요금제 스왑 정산 미리보기 — 실제 적용 없이 청구/크레딧 금액만 계산 (Paddle · Dodo)
|
|
8976
8981
|
*
|
|
8977
|
-
* 세금·기존 크레딧 잔액까지 반영된
|
|
8982
|
+
* 세금·기존 크레딧 잔액까지 반영된 PG 계산값을 반환하므로, 확정 화면에
|
|
8978
8983
|
* "지금 ₩X 청구, 이후 ₩Y/주기 (다음 청구일 …)" 를 그대로 노출하면 됩니다.
|
|
8979
8984
|
* 직접 차액을 계산하지 마세요 — 이 값이 권위입니다.
|
|
8980
8985
|
*
|
|
8986
|
+
* **금액은 반드시 짝이 되는 통화와 함께 표시하세요.** 즉시청구는 고객 표시통화
|
|
8987
|
+
* (`currency`), 정기 단가는 상품 통화(`recurring_currency`, 비면 `currency` 와 동일)입니다 —
|
|
8988
|
+
* MoR 의 adaptive currency 에서 둘이 다를 수 있습니다.
|
|
8989
|
+
*
|
|
8990
|
+
* 미리보기를 제공하지 않는 프로바이더는 400 `plan_change_preview_unsupported` 입니다.
|
|
8991
|
+
* 이는 **미리보기만** 없다는 뜻이며 {@link changePlan} 자체는 동작합니다
|
|
8992
|
+
* (요금제 변경 자체가 불가한 경우는 `plan_change_unsupported` 로 구분됩니다).
|
|
8993
|
+
*
|
|
8981
8994
|
* @param subscriptionId - 구독 ID
|
|
8982
8995
|
* @param data - 새 price + 정산 옵션 ({@link changePlan} 과 동일 body)
|
|
8983
8996
|
* @returns 정산 미리보기 (지금 청구/크레딧 · 새 정기 청구액 · 다음 청구일)
|
|
@@ -8987,7 +9000,9 @@ var SubscriptionAPI = class {
|
|
|
8987
9000
|
* const preview = await client.subscription.previewChangePlan(subscriptionId, {
|
|
8988
9001
|
* provider_price_ref: 'pri_family_monthly',
|
|
8989
9002
|
* })
|
|
8990
|
-
* //
|
|
9003
|
+
* // 통화를 함께 포맷한다 — 금액만 쓰면 다통화에서 거짓 금액이 된다
|
|
9004
|
+
* format(preview.immediate_charge_amount, preview.currency)
|
|
9005
|
+
* format(preview.recurring_amount, preview.recurring_currency ?? preview.currency)
|
|
8991
9006
|
* ```
|
|
8992
9007
|
*/
|
|
8993
9008
|
async previewChangePlan(subscriptionId, data) {
|