dodopayments 2.17.2 → 2.19.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/client.d.mts +8 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +14 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +14 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/balances.d.mts +52 -0
  18. package/resources/balances.d.mts.map +1 -0
  19. package/resources/balances.d.ts +52 -0
  20. package/resources/balances.d.ts.map +1 -0
  21. package/resources/balances.js +16 -0
  22. package/resources/balances.js.map +1 -0
  23. package/resources/balances.mjs +12 -0
  24. package/resources/balances.mjs.map +1 -0
  25. package/resources/checkout-sessions.d.mts +289 -493
  26. package/resources/checkout-sessions.d.mts.map +1 -1
  27. package/resources/checkout-sessions.d.ts +289 -493
  28. package/resources/checkout-sessions.d.ts.map +1 -1
  29. package/resources/index.d.mts +2 -1
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +2 -1
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js +3 -1
  34. package/resources/index.js.map +1 -1
  35. package/resources/index.mjs +1 -0
  36. package/resources/index.mjs.map +1 -1
  37. package/resources/payments.d.mts +5 -0
  38. package/resources/payments.d.mts.map +1 -1
  39. package/resources/payments.d.ts +5 -0
  40. package/resources/payments.d.ts.map +1 -1
  41. package/resources/subscriptions.d.mts +20 -0
  42. package/resources/subscriptions.d.mts.map +1 -1
  43. package/resources/subscriptions.d.ts +20 -0
  44. package/resources/subscriptions.d.ts.map +1 -1
  45. package/resources/webhook-events.d.mts +1 -1
  46. package/resources/webhook-events.d.mts.map +1 -1
  47. package/resources/webhook-events.d.ts +1 -1
  48. package/resources/webhook-events.d.ts.map +1 -1
  49. package/src/client.ts +48 -5
  50. package/src/internal/parse.ts +6 -0
  51. package/src/resources/balances.ts +271 -0
  52. package/src/resources/checkout-sessions.ts +338 -577
  53. package/src/resources/index.ts +14 -0
  54. package/src/resources/payments.ts +6 -0
  55. package/src/resources/subscriptions.ts +22 -0
  56. package/src/resources/webhook-events.ts +6 -1
  57. package/src/version.ts +1 -1
  58. package/version.d.mts +1 -1
  59. package/version.d.ts +1 -1
  60. package/version.js +1 -1
  61. package/version.mjs +1 -1
@@ -9,6 +9,12 @@ export {
9
9
  type AddonListParams,
10
10
  type AddonResponsesDefaultPageNumberPagination,
11
11
  } from './addons';
12
+ export {
13
+ Balances,
14
+ type BalanceLedgerEntry,
15
+ type BalanceRetrieveLedgerParams,
16
+ type BalanceLedgerEntriesDefaultPageNumberPagination,
17
+ } from './balances';
12
18
  export {
13
19
  Brands,
14
20
  type Brand,
@@ -19,9 +25,17 @@ export {
19
25
  } from './brands';
20
26
  export {
21
27
  CheckoutSessions,
28
+ type CheckoutSessionBillingAddress,
29
+ type CheckoutSessionCustomization,
30
+ type CheckoutSessionFlags,
22
31
  type CheckoutSessionRequest,
23
32
  type CheckoutSessionResponse,
24
33
  type CheckoutSessionStatus,
34
+ type CustomField,
35
+ type ProductItemReq,
36
+ type SubscriptionData,
37
+ type ThemeConfig,
38
+ type ThemeModeConfig,
25
39
  type CheckoutSessionPreviewResponse,
26
40
  type CheckoutSessionCreateParams,
27
41
  type CheckoutSessionPreviewParams,
@@ -320,6 +320,12 @@ export interface Payment {
320
320
  */
321
321
  product_cart?: Array<Payment.ProductCart> | null;
322
322
 
323
+ /**
324
+ * Summary of the refund status for this payment. None if no succeeded refunds
325
+ * exist.
326
+ */
327
+ refund_status?: 'partial' | 'full' | null;
328
+
323
329
  /**
324
330
  * This represents the portion of settlement_amount that corresponds to taxes
325
331
  * collected. Especially relevant for adaptive pricing where the tax component must
@@ -982,6 +982,17 @@ export interface SubscriptionChangePlanParams {
982
982
  * be taken
983
983
  */
984
984
  metadata?: { [key: string]: string } | null;
985
+
986
+ /**
987
+ * Controls behavior when the plan change payment fails.
988
+ *
989
+ * - `prevent_change`: Keep subscription on current plan until payment succeeds
990
+ * - `apply_change` (default): Apply plan change immediately regardless of payment
991
+ * outcome
992
+ *
993
+ * If not specified, uses the business-level default setting.
994
+ */
995
+ on_payment_failure?: 'prevent_change' | 'apply_change' | null;
985
996
  }
986
997
 
987
998
  export interface SubscriptionChargeParams {
@@ -1066,6 +1077,17 @@ export interface SubscriptionPreviewChangePlanParams {
1066
1077
  * be taken
1067
1078
  */
1068
1079
  metadata?: { [key: string]: string } | null;
1080
+
1081
+ /**
1082
+ * Controls behavior when the plan change payment fails.
1083
+ *
1084
+ * - `prevent_change`: Keep subscription on current plan until payment succeeds
1085
+ * - `apply_change` (default): Apply plan change immediately regardless of payment
1086
+ * outcome
1087
+ *
1088
+ * If not specified, uses the business-level default setting.
1089
+ */
1090
+ on_payment_failure?: 'prevent_change' | 'apply_change' | null;
1069
1091
  }
1070
1092
 
1071
1093
  export interface SubscriptionRetrieveUsageHistoryParams extends DefaultPageNumberPaginationParams {
@@ -34,7 +34,12 @@ export type WebhookEventType =
34
34
  | 'subscription.expired'
35
35
  | 'subscription.plan_changed'
36
36
  | 'subscription.updated'
37
- | 'license_key.created';
37
+ | 'license_key.created'
38
+ | 'payout.not_initiated'
39
+ | 'payout.on_hold'
40
+ | 'payout.in_progress'
41
+ | 'payout.failed'
42
+ | 'payout.success';
38
43
 
39
44
  export interface WebhookPayload {
40
45
  business_id: string;
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '2.17.2'; // x-release-please-version
1
+ export const VERSION = '2.19.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.17.2";
1
+ export declare const VERSION = "2.19.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.17.2";
1
+ export declare const VERSION = "2.19.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '2.17.2'; // x-release-please-version
4
+ exports.VERSION = '2.19.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.17.2'; // x-release-please-version
1
+ export const VERSION = '2.19.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map