@usethrottle/cart 3.11.1 → 3.12.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/dist/index.d.cts CHANGED
@@ -97,6 +97,19 @@ interface LineRecurringInput {
97
97
  intervalCount?: number;
98
98
  totalPayments?: number;
99
99
  trialDays?: number;
100
+ /**
101
+ * Custom installment schedule: 2-60 payments that differ in amount (per unit,
102
+ * minor units) and in the gap before each one. Row 0 has no gap. Replaces
103
+ * `interval`/`intervalUnit`/`intervalCount`/`totalPayments`/`trialDays`, which
104
+ * must be omitted or agree with it. The line's `unitPrice` must equal row 0.
105
+ */
106
+ schedule?: Array<{
107
+ amount: number;
108
+ intervalUnit?: SubscriptionIntervalUnit;
109
+ intervalCount?: number;
110
+ }>;
111
+ /** Read-only echo on responses: the sum of every row's per-unit amount. Ignored on input. */
112
+ scheduleUnitTotal?: number;
100
113
  }
101
114
  /** A merchant-declared subscription line's stored terms (it carries `plan`). */
102
115
  interface StoredLineRecurring {
@@ -111,6 +124,14 @@ interface StoredLineRecurring {
111
124
  amount: number | null;
112
125
  /** Display mirror of `totalPayments`. */
113
126
  count: number | null;
127
+ /** Present only on a custom installment schedule line. */
128
+ schedule?: Array<{
129
+ amount: number;
130
+ intervalUnit: string | null;
131
+ intervalCount: number | null;
132
+ }>;
133
+ /** Present only on a schedule line: the sum of every row's per-unit amount. */
134
+ scheduleUnitTotal?: number;
114
135
  }
115
136
  /** The plan line Throttle adds for a checkout session `recurring` intent. */
116
137
  interface LegacyLineRecurring {
package/dist/index.d.ts CHANGED
@@ -97,6 +97,19 @@ interface LineRecurringInput {
97
97
  intervalCount?: number;
98
98
  totalPayments?: number;
99
99
  trialDays?: number;
100
+ /**
101
+ * Custom installment schedule: 2-60 payments that differ in amount (per unit,
102
+ * minor units) and in the gap before each one. Row 0 has no gap. Replaces
103
+ * `interval`/`intervalUnit`/`intervalCount`/`totalPayments`/`trialDays`, which
104
+ * must be omitted or agree with it. The line's `unitPrice` must equal row 0.
105
+ */
106
+ schedule?: Array<{
107
+ amount: number;
108
+ intervalUnit?: SubscriptionIntervalUnit;
109
+ intervalCount?: number;
110
+ }>;
111
+ /** Read-only echo on responses: the sum of every row's per-unit amount. Ignored on input. */
112
+ scheduleUnitTotal?: number;
100
113
  }
101
114
  /** A merchant-declared subscription line's stored terms (it carries `plan`). */
102
115
  interface StoredLineRecurring {
@@ -111,6 +124,14 @@ interface StoredLineRecurring {
111
124
  amount: number | null;
112
125
  /** Display mirror of `totalPayments`. */
113
126
  count: number | null;
127
+ /** Present only on a custom installment schedule line. */
128
+ schedule?: Array<{
129
+ amount: number;
130
+ intervalUnit: string | null;
131
+ intervalCount: number | null;
132
+ }>;
133
+ /** Present only on a schedule line: the sum of every row's per-unit amount. */
134
+ scheduleUnitTotal?: number;
114
135
  }
115
136
  /** The plan line Throttle adds for a checkout session `recurring` intent. */
116
137
  interface LegacyLineRecurring {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usethrottle/cart",
3
- "version": "3.11.1",
3
+ "version": "3.12.0",
4
4
  "description": "Typed REST client for the Throttle Cart API.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",