@openrails/billing-ui 0.230.0 → 0.234.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 (65) hide show
  1. package/CHANGELOG.md +117 -9
  2. package/README.md +88 -39
  3. package/dist/account/account-billing.d.ts +3 -3
  4. package/dist/account/cancel-dialog.d.ts +2 -2
  5. package/dist/account/format.d.ts +4 -4
  6. package/dist/account/payment-methods-panel.d.ts +7 -9
  7. package/dist/account/section.d.ts +3 -1
  8. package/dist/checkout-page.d.ts +6 -1
  9. package/dist/client/client.d.ts +81 -62
  10. package/dist/client/generated/currencies.d.ts +1 -0
  11. package/dist/client/generated/error-codes.d.ts +7 -0
  12. package/dist/client/generated/routes.d.ts +764 -0
  13. package/dist/client/generated/wire.d.ts +772 -0
  14. package/dist/client/index.d.ts +3 -3
  15. package/dist/client/types.d.ts +498 -393
  16. package/dist/client-CWX6QpLa.js +920 -0
  17. package/dist/client-CWX6QpLa.js.map +1 -0
  18. package/dist/client.js +2 -3
  19. package/dist/components/methods.d.ts +3 -3
  20. package/dist/config-DZ97SQG2.js +341 -0
  21. package/dist/config-DZ97SQG2.js.map +1 -0
  22. package/dist/frame.d.ts +1 -1
  23. package/dist/index.d.ts +4 -4
  24. package/dist/index.js +1447 -1539
  25. package/dist/index.js.map +1 -1
  26. package/dist/lib/billing.d.ts +14 -0
  27. package/dist/lib/money.d.ts +1 -0
  28. package/dist/lib/period.d.ts +0 -2
  29. package/dist/lib/rail-meta.d.ts +4 -4
  30. package/dist/locales/de.js +11 -8
  31. package/dist/locales/de.js.map +1 -1
  32. package/dist/locales/en.d.ts +8 -5
  33. package/dist/locales/en.js +11 -8
  34. package/dist/locales/en.js.map +1 -1
  35. package/dist/locales/es.js +11 -8
  36. package/dist/locales/es.js.map +1 -1
  37. package/dist/locales/ja.js +11 -8
  38. package/dist/locales/ja.js.map +1 -1
  39. package/dist/locales/ko.js +11 -8
  40. package/dist/locales/ko.js.map +1 -1
  41. package/dist/locales/zh.js +11 -8
  42. package/dist/locales/zh.js.map +1 -1
  43. package/dist/psp.d.ts +10 -21
  44. package/dist/react/config.d.ts +34 -0
  45. package/dist/react/context.d.ts +5 -8
  46. package/dist/react/hooks.d.ts +20 -14
  47. package/dist/react/index.d.ts +1 -0
  48. package/dist/react/provider.d.ts +1 -9
  49. package/dist/react/remote.d.ts +0 -1
  50. package/dist/react.js +24 -28
  51. package/dist/react.js.map +1 -1
  52. package/dist/save-payment-method.d.ts +1 -1
  53. package/dist/source.d.ts +0 -9
  54. package/dist/styles.css +1 -1
  55. package/dist/types.d.ts +114 -55
  56. package/docs/payment-form-contract.md +23 -40
  57. package/package.json +3 -3
  58. package/dist/client/generated/openrails-routes.d.ts +0 -2
  59. package/dist/client-DhG2jv34.js +0 -771
  60. package/dist/client-DhG2jv34.js.map +0 -1
  61. package/dist/errors-T-PRm3vV.js +0 -54
  62. package/dist/errors-T-PRm3vV.js.map +0 -1
  63. package/dist/hooks-DLFF-zx5.js +0 -285
  64. package/dist/hooks-DLFF-zx5.js.map +0 -1
  65. package/docs/1055-nmi-host-integration.md +0 -28
@@ -6,6 +6,7 @@ export declare const pageSchema: <T extends z.ZodType>(item: T) => z.ZodObject<{
6
6
  limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7
7
  offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8
8
  has_more: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
9
+ next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
10
  }, z.core.$strip>;
10
11
  export interface Page<T> {
11
12
  data: T[];
@@ -13,23 +14,60 @@ export interface Page<T> {
13
14
  limit?: number | null;
14
15
  offset?: number | null;
15
16
  has_more?: boolean | null;
17
+ /** The next page's cursor; null on the last page of a cursor list. */
18
+ next_cursor?: string | null;
19
+ }
20
+ /** One page of a cursor list; `next_cursor` is null on the last page. */
21
+ export declare const listPageSchema: <T extends z.ZodType>(item: T) => z.ZodObject<{
22
+ data: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<T>>>, z.ZodTransform<z.core.output<T>[], z.core.output<T>[] | null | undefined>>;
23
+ next_cursor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
24
+ }, z.core.$strip>;
25
+ export interface ListPage<T> {
26
+ data: T[];
27
+ next_cursor: string | null;
16
28
  }
17
29
  export declare const subscriptionStatusSchema: z.ZodString;
18
- /** `pending | active | past_due | awaiting_method | unverified | cancelled`; kept open for new values. */
19
- export type SubscriptionStatus = "pending" | "active" | "past_due" | "awaiting_method" | "unverified" | "cancelled" | (string & {});
20
- export declare const subscriptionPriceSchema: z.ZodObject<{
30
+ /** `pending | active | past_due | awaiting_method | unverified | canceled`; kept open for new values. */
31
+ export type SubscriptionStatus = "pending" | "active" | "past_due" | "awaiting_method" | "unverified" | "canceled" | (string & {});
32
+ export declare const pspLinkStateSchema: z.ZodObject<{
33
+ status: z.ZodString;
34
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
35
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ }, z.core.$strip>;
37
+ /**
38
+ * A catalog price, embedded in a product (`GET /catalog/products`): `unit_amount` of
39
+ * `currency` for `access_duration_hours` of access (null: for good),
40
+ * charging every `billing_interval_hours` (null: one-time).
41
+ */
42
+ export declare const priceSchema: z.ZodObject<{
21
43
  id: z.ZodString;
22
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ key: z.ZodString;
45
+ revision: z.ZodOptional<z.ZodNumber>;
46
+ product_id: z.ZodString;
47
+ archived: z.ZodBoolean;
24
48
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
49
+ customer_amount: z.ZodOptional<z.ZodNullable<z.ZodObject<{
50
+ min_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
51
+ max_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
52
+ }, z.core.$strip>>>;
25
53
  currency: z.ZodString;
26
- auto_renew: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
27
- access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
+ access_duration_hours: z.ZodNullable<z.ZodNumber>;
55
+ billing_interval_hours: z.ZodNullable<z.ZodNumber>;
56
+ trial_unit_amount: z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
57
+ trial_duration_hours: z.ZodNullable<z.ZodNumber>;
58
+ psps: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
59
+ status: z.ZodString;
60
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
61
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ }, z.core.$strip>>>>;
63
+ created_at: z.ZodString;
64
+ updated_at: z.ZodString;
28
65
  }, z.core.$strip>;
29
- export type SubscriptionPrice = z.infer<typeof subscriptionPriceSchema>;
66
+ export type Price = z.infer<typeof priceSchema>;
30
67
  export declare const subscriptionProductSchema: z.ZodObject<{
31
68
  id: z.ZodString;
32
69
  key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ revision: z.ZodOptional<z.ZodNumber>;
33
71
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
72
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
73
  tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -58,6 +96,34 @@ export declare const paymentRecoverySchema: z.ZodObject<{
58
96
  }, z.core.$strip>>>;
59
97
  }, z.core.$strip>;
60
98
  export type PaymentRecovery = z.infer<typeof paymentRecoverySchema>;
99
+ /**
100
+ * A step the customer takes before an action completes. With
101
+ * `solana_sign_transactions` the wallet signs and sends `transactions` in
102
+ * order; the action is then repeated with the last signature.
103
+ */
104
+ export declare const nextActionSchema: z.ZodObject<{
105
+ type: z.ZodString;
106
+ redirect_to_url: z.ZodOptional<z.ZodNullable<z.ZodObject<{
107
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
+ }, z.core.$strip>>>;
109
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
110
+ }, z.core.$strip>;
111
+ export type NextAction = z.infer<typeof nextActionSchema>;
112
+ /**
113
+ * A declined renewal being collected. `retries_left` and `final_retry_at`
114
+ * follow the merchant's dunning policy; both are null when the provider runs
115
+ * the retries. While `waiting_for_new_card`, nothing is charged until the card
116
+ * is replaced, and the subscription ends at `final_retry_at`.
117
+ */
118
+ export declare const subscriptionDunningSchema: z.ZodObject<{
119
+ attempts: z.ZodNumber;
120
+ retries_left: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
121
+ next_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
+ final_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ waiting_for_new_card: z.ZodBoolean;
124
+ last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
125
+ }, z.core.$strip>;
126
+ export type SubscriptionDunning = z.infer<typeof subscriptionDunningSchema>;
61
127
  export declare const subscriptionSchema: z.ZodObject<{
62
128
  id: z.ZodString;
63
129
  status: z.ZodString;
@@ -70,47 +136,95 @@ export declare const subscriptionSchema: z.ZodObject<{
70
136
  ended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
71
137
  current_period_starts_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
138
  current_period_ends_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
- cancelled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ canceled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
140
  cancel_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
141
  resumable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
76
142
  cancel_scheduled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
77
143
  cancel_mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
78
144
  cancel_portal_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
- grace_ends_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
- next_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
+ access: z.ZodOptional<z.ZodNullable<z.ZodObject<{
146
+ starts_at: z.ZodString;
147
+ ends_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
148
+ }, z.core.$strip>>>;
149
+ dunning: z.ZodOptional<z.ZodNullable<z.ZodObject<{
150
+ attempts: z.ZodNumber;
151
+ retries_left: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
152
+ next_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
+ final_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
154
+ waiting_for_new_card: z.ZodBoolean;
155
+ last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
+ }, z.core.$strip>>>;
81
157
  price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
82
158
  id: z.ZodString;
83
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ key: z.ZodString;
160
+ revision: z.ZodOptional<z.ZodNumber>;
161
+ product_id: z.ZodString;
162
+ archived: z.ZodBoolean;
85
163
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
164
+ customer_amount: z.ZodOptional<z.ZodNullable<z.ZodObject<{
165
+ min_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
166
+ max_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
167
+ }, z.core.$strip>>>;
86
168
  currency: z.ZodString;
87
- auto_renew: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
88
- access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
169
+ access_duration_hours: z.ZodNullable<z.ZodNumber>;
170
+ billing_interval_hours: z.ZodNullable<z.ZodNumber>;
171
+ trial_unit_amount: z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
172
+ trial_duration_hours: z.ZodNullable<z.ZodNumber>;
173
+ psps: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
174
+ status: z.ZodString;
175
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
176
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
177
+ }, z.core.$strip>>>>;
178
+ created_at: z.ZodString;
179
+ updated_at: z.ZodString;
89
180
  }, z.core.$strip>>>;
90
181
  product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
91
182
  id: z.ZodString;
92
183
  key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
184
+ revision: z.ZodOptional<z.ZodNumber>;
93
185
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
186
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
187
  tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
188
  tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
97
189
  }, z.core.$strip>>>;
98
- scheduled_price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
99
- id: z.ZodString;
100
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
- unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
103
- currency: z.ZodString;
104
- auto_renew: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
105
- access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
106
- }, z.core.$strip>>>;
107
- scheduled_product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
108
- id: z.ZodString;
109
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
- display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
- tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
- tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
190
+ scheduled_change: z.ZodOptional<z.ZodNullable<z.ZodObject<{
191
+ price_id: z.ZodString;
192
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
193
+ effective_at: z.ZodString;
194
+ source: z.ZodString;
195
+ price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
196
+ id: z.ZodString;
197
+ key: z.ZodString;
198
+ revision: z.ZodOptional<z.ZodNumber>;
199
+ product_id: z.ZodString;
200
+ archived: z.ZodBoolean;
201
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
202
+ customer_amount: z.ZodOptional<z.ZodNullable<z.ZodObject<{
203
+ min_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
204
+ max_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
205
+ }, z.core.$strip>>>;
206
+ currency: z.ZodString;
207
+ access_duration_hours: z.ZodNullable<z.ZodNumber>;
208
+ billing_interval_hours: z.ZodNullable<z.ZodNumber>;
209
+ trial_unit_amount: z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
210
+ trial_duration_hours: z.ZodNullable<z.ZodNumber>;
211
+ psps: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
212
+ status: z.ZodString;
213
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
214
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
+ }, z.core.$strip>>>>;
216
+ created_at: z.ZodString;
217
+ updated_at: z.ZodString;
218
+ }, z.core.$strip>>>;
219
+ product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
220
+ id: z.ZodString;
221
+ key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
+ revision: z.ZodOptional<z.ZodNumber>;
223
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
227
+ }, z.core.$strip>>>;
114
228
  }, z.core.$strip>>>;
115
229
  card: z.ZodOptional<z.ZodNullable<z.ZodObject<{
116
230
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -127,15 +241,35 @@ export declare const subscriptionSchema: z.ZodObject<{
127
241
  status: z.ZodString;
128
242
  }, z.core.$strip>>>;
129
243
  }, z.core.$strip>>>;
244
+ next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
245
+ type: z.ZodString;
246
+ redirect_to_url: z.ZodOptional<z.ZodNullable<z.ZodObject<{
247
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
+ }, z.core.$strip>>>;
249
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
250
+ }, z.core.$strip>>>;
130
251
  created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
252
  updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
253
  }, z.core.$strip>;
133
254
  export type Subscription = z.infer<typeof subscriptionSchema> & {
134
255
  status: SubscriptionStatus;
135
256
  };
257
+ export declare const billingDetailsSchema: z.ZodObject<{
258
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
259
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
261
+ address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
262
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
264
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
265
+ state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
266
+ postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
+ }, z.core.$strip>>>;
269
+ }, z.core.$strip>;
270
+ export type BillingDetails = z.infer<typeof billingDetailsSchema>;
136
271
  export declare const paymentMethodSchema: z.ZodObject<{
137
272
  id: z.ZodString;
138
- type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
273
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
274
  psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
275
  card: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -147,6 +281,15 @@ export declare const paymentMethodSchema: z.ZodObject<{
147
281
  billing_details: z.ZodOptional<z.ZodNullable<z.ZodObject<{
148
282
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
149
283
  email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
+ address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
286
+ line1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ line2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
288
+ city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
289
+ state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ postal_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
+ }, z.core.$strip>>>;
150
293
  }, z.core.$strip>>>;
151
294
  health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
152
295
  expiry_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -158,34 +301,141 @@ export declare const paymentMethodSchema: z.ZodObject<{
158
301
  id: z.ZodString;
159
302
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
303
  }, z.core.$strip>>>>;
161
- default: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
162
- collection_default_currencies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
304
+ collection_currencies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
163
305
  created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
164
306
  }, z.core.$strip>;
165
307
  export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
308
+ /** A price's state on one PSP; public routes carry the status only. */
309
+ export declare const productSchema: z.ZodObject<{
310
+ id: z.ZodString;
311
+ key: z.ZodString;
312
+ revision: z.ZodOptional<z.ZodNumber>;
313
+ display_name: z.ZodString;
314
+ description: z.ZodString;
315
+ entitlements: z.ZodArray<z.ZodString>;
316
+ credit_grant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
317
+ currency: z.ZodString;
318
+ amount: z.ZodOptional<z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>>;
319
+ from_payment: z.ZodOptional<z.ZodBoolean>;
320
+ expires_after_days: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
321
+ }, z.core.$strip>>>;
322
+ tier_group: z.ZodNullable<z.ZodString>;
323
+ tier_rank: z.ZodNumber;
324
+ archived: z.ZodBoolean;
325
+ prices: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
326
+ id: z.ZodString;
327
+ key: z.ZodString;
328
+ revision: z.ZodOptional<z.ZodNumber>;
329
+ product_id: z.ZodString;
330
+ archived: z.ZodBoolean;
331
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
332
+ customer_amount: z.ZodOptional<z.ZodNullable<z.ZodObject<{
333
+ min_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
334
+ max_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
335
+ }, z.core.$strip>>>;
336
+ currency: z.ZodString;
337
+ access_duration_hours: z.ZodNullable<z.ZodNumber>;
338
+ billing_interval_hours: z.ZodNullable<z.ZodNumber>;
339
+ trial_unit_amount: z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
340
+ trial_duration_hours: z.ZodNullable<z.ZodNumber>;
341
+ psps: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
342
+ status: z.ZodString;
343
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
344
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
345
+ }, z.core.$strip>>>>;
346
+ created_at: z.ZodString;
347
+ updated_at: z.ZodString;
348
+ }, z.core.$strip>>>>, z.ZodTransform<{
349
+ id: string;
350
+ key: string;
351
+ product_id: string;
352
+ archived: boolean;
353
+ unit_amount: string;
354
+ currency: string;
355
+ access_duration_hours: number | null;
356
+ billing_interval_hours: number | null;
357
+ trial_unit_amount: string | null;
358
+ trial_duration_hours: number | null;
359
+ created_at: string;
360
+ updated_at: string;
361
+ revision?: number | undefined;
362
+ customer_amount?: {
363
+ min_amount: string;
364
+ max_amount: string;
365
+ } | null | undefined;
366
+ psps?: Record<string, {
367
+ status: string;
368
+ ids?: Record<string, string> | null | undefined;
369
+ sync_status?: string | null | undefined;
370
+ }> | null | undefined;
371
+ }[], {
372
+ id: string;
373
+ key: string;
374
+ product_id: string;
375
+ archived: boolean;
376
+ unit_amount: string;
377
+ currency: string;
378
+ access_duration_hours: number | null;
379
+ billing_interval_hours: number | null;
380
+ trial_unit_amount: string | null;
381
+ trial_duration_hours: number | null;
382
+ created_at: string;
383
+ updated_at: string;
384
+ revision?: number | undefined;
385
+ customer_amount?: {
386
+ min_amount: string;
387
+ max_amount: string;
388
+ } | null | undefined;
389
+ psps?: Record<string, {
390
+ status: string;
391
+ ids?: Record<string, string> | null | undefined;
392
+ sync_status?: string | null | undefined;
393
+ }> | null | undefined;
394
+ }[] | null | undefined>>;
395
+ created_at: z.ZodString;
396
+ updated_at: z.ZodString;
397
+ }, z.core.$strip>;
398
+ export type Product = z.infer<typeof productSchema>;
166
399
  export declare const paymentSchema: z.ZodObject<{
167
400
  id: z.ZodString;
168
- object: z.ZodOptional<z.ZodNullable<z.ZodString>>;
169
- status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
401
+ kind: z.ZodString;
402
+ status: z.ZodString;
170
403
  amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
171
404
  amount_refunded: z.ZodOptional<z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>>;
172
405
  currency: z.ZodString;
173
406
  subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
407
+ price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
408
+ channel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
409
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
175
- refunded: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
176
410
  created_at: z.ZodString;
177
411
  price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
178
- id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
179
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
180
- product: z.ZodOptional<z.ZodNullable<z.ZodString>>;
181
- type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
182
- recurring: z.ZodOptional<z.ZodNullable<z.ZodObject<{
183
- interval: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
+ id: z.ZodString;
413
+ key: z.ZodString;
414
+ revision: z.ZodOptional<z.ZodNumber>;
415
+ product_id: z.ZodString;
416
+ archived: z.ZodBoolean;
417
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
418
+ customer_amount: z.ZodOptional<z.ZodNullable<z.ZodObject<{
419
+ min_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
420
+ max_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
184
421
  }, z.core.$strip>>>;
422
+ currency: z.ZodString;
423
+ access_duration_hours: z.ZodNullable<z.ZodNumber>;
424
+ billing_interval_hours: z.ZodNullable<z.ZodNumber>;
425
+ trial_unit_amount: z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>;
426
+ trial_duration_hours: z.ZodNullable<z.ZodNumber>;
427
+ psps: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
428
+ status: z.ZodString;
429
+ ids: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
430
+ sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
431
+ }, z.core.$strip>>>>;
432
+ created_at: z.ZodString;
433
+ updated_at: z.ZodString;
185
434
  }, z.core.$strip>>>;
186
435
  product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
187
436
  id: z.ZodString;
188
437
  key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
438
+ revision: z.ZodOptional<z.ZodNumber>;
189
439
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
190
440
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
191
441
  tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -204,18 +454,50 @@ export declare const paymentSchema: z.ZodObject<{
204
454
  }, z.core.$strip>>>;
205
455
  }, z.core.$strip>;
206
456
  export type Payment = z.infer<typeof paymentSchema>;
457
+ /** A customer's money in one currency. */
458
+ export declare const balanceSchema: z.ZodObject<{
459
+ currency: z.ZodString;
460
+ billing_mode: z.ZodString;
461
+ balance_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
462
+ held_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
463
+ available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
464
+ owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
465
+ }, z.core.$strip>;
466
+ export type Balance = z.infer<typeof balanceSchema>;
467
+ /**
468
+ * The signed-in customer's summary (`GET /me`): money per currency, the card
469
+ * that pays each currency's invoices, and how many notices are unread.
470
+ */
471
+ export declare const accountSchema: z.ZodObject<{
472
+ id: z.ZodString;
473
+ balances: z.ZodArray<z.ZodObject<{
474
+ currency: z.ZodString;
475
+ billing_mode: z.ZodString;
476
+ balance_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
477
+ held_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
478
+ available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
479
+ owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
480
+ }, z.core.$strip>>;
481
+ collection_payment_methods: z.ZodArray<z.ZodObject<{
482
+ currency: z.ZodString;
483
+ payment_method_id: z.ZodString;
484
+ }, z.core.$strip>>;
485
+ unread_notifications: z.ZodNumber;
486
+ }, z.core.$strip>;
487
+ export type Account = z.infer<typeof accountSchema>;
207
488
  export declare const invoiceSchema: z.ZodObject<{
208
489
  id: z.ZodString;
209
490
  currency: z.ZodString;
210
491
  invoice_number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
211
- period_from: z.ZodString;
212
- period_to: z.ZodString;
492
+ period_starts_at: z.ZodString;
493
+ period_ends_at: z.ZodString;
213
494
  total_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
214
495
  amount_paid: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
215
496
  amount_due: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
216
497
  status: z.ZodString;
217
498
  issued_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
499
  due_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ delinquent: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
219
501
  paid_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
502
  recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
221
503
  last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -229,164 +511,6 @@ export declare const invoiceSchema: z.ZodObject<{
229
511
  created_at: z.ZodString;
230
512
  }, z.core.$strip>;
231
513
  export type Invoice = z.infer<typeof invoiceSchema>;
232
- export declare const invoicePageSchema: z.ZodObject<{
233
- invoices: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
234
- id: z.ZodString;
235
- currency: z.ZodString;
236
- invoice_number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
- period_from: z.ZodString;
238
- period_to: z.ZodString;
239
- total_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
240
- amount_paid: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
241
- amount_due: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
242
- status: z.ZodString;
243
- issued_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
244
- due_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
- paid_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
246
- recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
247
- last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
- retryable: z.ZodBoolean;
249
- blocked_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
- operation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
251
- id: z.ZodString;
252
- status: z.ZodString;
253
- }, z.core.$strip>>>;
254
- }, z.core.$strip>>>;
255
- created_at: z.ZodString;
256
- }, z.core.$strip>>>>, z.ZodTransform<{
257
- id: string;
258
- currency: string;
259
- period_from: string;
260
- period_to: string;
261
- total_amount: string;
262
- amount_paid: string;
263
- amount_due: string;
264
- status: string;
265
- created_at: string;
266
- invoice_number?: string | null | undefined;
267
- issued_at?: string | null | undefined;
268
- due_at?: string | null | undefined;
269
- paid_at?: string | null | undefined;
270
- recovery?: {
271
- retryable: boolean;
272
- last_failure_reason?: string | null | undefined;
273
- blocked_reason?: string | null | undefined;
274
- operation?: {
275
- id: string;
276
- status: string;
277
- } | null | undefined;
278
- } | null | undefined;
279
- }[], {
280
- id: string;
281
- currency: string;
282
- period_from: string;
283
- period_to: string;
284
- total_amount: string;
285
- amount_paid: string;
286
- amount_due: string;
287
- status: string;
288
- created_at: string;
289
- invoice_number?: string | null | undefined;
290
- issued_at?: string | null | undefined;
291
- due_at?: string | null | undefined;
292
- paid_at?: string | null | undefined;
293
- recovery?: {
294
- retryable: boolean;
295
- last_failure_reason?: string | null | undefined;
296
- blocked_reason?: string | null | undefined;
297
- operation?: {
298
- id: string;
299
- status: string;
300
- } | null | undefined;
301
- } | null | undefined;
302
- }[] | null | undefined>>;
303
- total: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
304
- limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
305
- offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
306
- }, z.core.$strip>;
307
- export declare const billingStatusSchema: z.ZodObject<{
308
- has_active_subscription: z.ZodBoolean;
309
- subscription: z.ZodOptional<z.ZodNullable<z.ZodObject<{
310
- id: z.ZodString;
311
- status: z.ZodString;
312
- rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
313
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
- price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
- psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
316
- payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
317
- started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
318
- ended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
- current_period_starts_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
- current_period_ends_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
321
- cancelled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
- cancel_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
323
- resumable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
324
- cancel_scheduled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
325
- cancel_mode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
- cancel_portal_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
- grace_ends_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
328
- next_retry_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
329
- price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
330
- id: z.ZodString;
331
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
- unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
334
- currency: z.ZodString;
335
- auto_renew: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
336
- access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
337
- }, z.core.$strip>>>;
338
- product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
339
- id: z.ZodString;
340
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
341
- display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
342
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
- tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
344
- tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
345
- }, z.core.$strip>>>;
346
- scheduled_price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
347
- id: z.ZodString;
348
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
349
- product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
350
- unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
351
- currency: z.ZodString;
352
- auto_renew: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
353
- access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
354
- }, z.core.$strip>>>;
355
- scheduled_product: z.ZodOptional<z.ZodNullable<z.ZodObject<{
356
- id: z.ZodString;
357
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
- display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
- tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
361
- tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
362
- }, z.core.$strip>>>;
363
- card: z.ZodOptional<z.ZodNullable<z.ZodObject<{
364
- brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
365
- last4: z.ZodOptional<z.ZodNullable<z.ZodString>>;
366
- exp_month: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
367
- exp_year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
368
- }, z.core.$strip>>>;
369
- recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
370
- last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
371
- retryable: z.ZodBoolean;
372
- blocked_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
373
- operation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
374
- id: z.ZodString;
375
- status: z.ZodString;
376
- }, z.core.$strip>>>;
377
- }, z.core.$strip>>>;
378
- created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
379
- updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
- }, z.core.$strip>>>;
381
- next_renewal_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
- entitlements: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
383
- entitlement: z.ZodString;
384
- start_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
385
- end_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
386
- revoked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
387
- }, z.core.$strip>>>>;
388
- }, z.core.$strip>;
389
- export type BillingStatus = z.infer<typeof billingStatusSchema>;
390
514
  /** Currency code (upper case) to its native-unit scale. */
391
515
  export type CurrencyScales = Readonly<Record<string, number>>;
392
516
  export declare const currencySchema: z.ZodObject<{
@@ -395,87 +519,6 @@ export declare const currencySchema: z.ZodObject<{
395
519
  minor_decimals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
396
520
  }, z.core.$strip>;
397
521
  export type Currency = z.infer<typeof currencySchema>;
398
- export declare const currencyRegistrySchema: z.ZodObject<{
399
- currencies: z.ZodArray<z.ZodObject<{
400
- code: z.ZodString;
401
- decimals: z.ZodNumber;
402
- minor_decimals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
403
- }, z.core.$strip>>;
404
- }, z.core.$strip>;
405
- /** A catalog price (`GET /prices`, embedded in `GET /products`). */
406
- export declare const priceSchema: z.ZodObject<{
407
- id: z.ZodString;
408
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
409
- unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
410
- currency: z.ZodString;
411
- type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
412
- recurring: z.ZodOptional<z.ZodNullable<z.ZodObject<{
413
- interval: z.ZodString;
414
- }, z.core.$strip>>>;
415
- product: z.ZodOptional<z.ZodNullable<z.ZodString>>;
416
- active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
417
- providers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
418
- metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
419
- created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
420
- }, z.core.$strip>;
421
- export type Price = z.infer<typeof priceSchema>;
422
- export declare const productSchema: z.ZodObject<{
423
- id: z.ZodString;
424
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
425
- name: z.ZodString;
426
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
427
- entitlements_spec: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>>>;
428
- tier_group: z.ZodOptional<z.ZodNullable<z.ZodString>>;
429
- tier_rank: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
430
- active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
431
- metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
432
- created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
433
- updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
434
- prices: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
435
- id: z.ZodString;
436
- key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
437
- unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
438
- currency: z.ZodString;
439
- type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
440
- recurring: z.ZodOptional<z.ZodNullable<z.ZodObject<{
441
- interval: z.ZodString;
442
- }, z.core.$strip>>>;
443
- product: z.ZodOptional<z.ZodNullable<z.ZodString>>;
444
- active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
445
- providers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
446
- metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
447
- created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
448
- }, z.core.$strip>>>>, z.ZodTransform<{
449
- id: string;
450
- unit_amount: string;
451
- currency: string;
452
- key?: string | null | undefined;
453
- type?: string | null | undefined;
454
- recurring?: {
455
- interval: string;
456
- } | null | undefined;
457
- product?: string | null | undefined;
458
- active?: boolean | null | undefined;
459
- providers?: string[] | null | undefined;
460
- metadata?: Record<string, string> | null | undefined;
461
- created_at?: string | null | undefined;
462
- }[], {
463
- id: string;
464
- unit_amount: string;
465
- currency: string;
466
- key?: string | null | undefined;
467
- type?: string | null | undefined;
468
- recurring?: {
469
- interval: string;
470
- } | null | undefined;
471
- product?: string | null | undefined;
472
- active?: boolean | null | undefined;
473
- providers?: string[] | null | undefined;
474
- metadata?: Record<string, string> | null | undefined;
475
- created_at?: string | null | undefined;
476
- }[] | null | undefined>>;
477
- }, z.core.$strip>;
478
- export type Product = z.infer<typeof productSchema>;
479
522
  export declare const tierChangePreviewSchema: z.ZodObject<{
480
523
  action: z.ZodString;
481
524
  price_id: z.ZodString;
@@ -495,12 +538,12 @@ export declare const tierChangeSchema: z.ZodObject<{
495
538
  effective: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
539
  price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
497
540
  subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
498
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
499
541
  next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
500
542
  type: z.ZodString;
501
543
  redirect_to_url: z.ZodOptional<z.ZodNullable<z.ZodObject<{
502
544
  url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
503
545
  }, z.core.$strip>>>;
546
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
504
547
  }, z.core.$strip>>>;
505
548
  delayed_start: z.ZodOptional<z.ZodNullable<z.ZodString>>;
506
549
  currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -511,10 +554,6 @@ export declare const tierChangeSchema: z.ZodObject<{
511
554
  operation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
512
555
  }, z.core.$strip>;
513
556
  export type TierChange = z.infer<typeof tierChangeSchema>;
514
- export declare const solanaCancelTxSchema: z.ZodObject<{
515
- transaction: z.ZodString;
516
- subscription_pda: z.ZodOptional<z.ZodNullable<z.ZodString>>;
517
- }, z.core.$strip>;
518
557
  export declare const solanaTokenSchema: z.ZodObject<{
519
558
  symbol: z.ZodString;
520
559
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -608,100 +647,163 @@ export declare const solanaTokensSchema: z.ZodObject<{
608
647
  } | null | undefined;
609
648
  }[] | null | undefined>>;
610
649
  }, z.core.$strip>;
611
- export declare const solanaConfigSchema: z.ZodObject<{
612
- network: z.ZodString;
613
- chain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
614
- rpcUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
615
- explorerCluster: z.ZodOptional<z.ZodNullable<z.ZodString>>;
616
- preferredToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
617
- tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
618
- symbol: z.ZodString;
619
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
620
- mint: z.ZodString;
650
+ /**
651
+ * The merchant's browser payment setup: its armed PSPs with their public
652
+ * values and, with a Solana PSP, the network and accepted tokens a wallet
653
+ * adapter is configured with.
654
+ */
655
+ export declare const paymentConfigSchema: z.ZodObject<{
656
+ psps: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
657
+ psp_id: z.ZodString;
658
+ key: z.ZodString;
659
+ rail: z.ZodString;
660
+ custodian: z.ZodString;
661
+ display_name: z.ZodString;
662
+ flow: z.ZodString;
663
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
664
+ checkout: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
665
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
666
+ retry_after: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
667
+ }, z.core.$strip>>>>, z.ZodTransform<{
668
+ psp_id: string;
669
+ key: string;
670
+ rail: string;
671
+ custodian: string;
672
+ display_name: string;
673
+ flow: string;
674
+ config?: Record<string, string> | null | undefined;
675
+ checkout?: boolean | null | undefined;
676
+ status?: string | null | undefined;
677
+ retry_after?: number | null | undefined;
678
+ }[], {
679
+ psp_id: string;
680
+ key: string;
681
+ rail: string;
682
+ custodian: string;
683
+ display_name: string;
684
+ flow: string;
685
+ config?: Record<string, string> | null | undefined;
686
+ checkout?: boolean | null | undefined;
687
+ status?: string | null | undefined;
688
+ retry_after?: number | null | undefined;
689
+ }[] | null | undefined>>;
690
+ solana: z.ZodOptional<z.ZodNullable<z.ZodObject<{
691
+ network: z.ZodString;
692
+ chain: z.ZodString;
693
+ preferred_token: z.ZodOptional<z.ZodNullable<z.ZodString>>;
694
+ tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
695
+ symbol: z.ZodString;
696
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
697
+ mint: z.ZodString;
698
+ decimals: z.ZodNumber;
699
+ preferred: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
700
+ recurring_eligible: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
701
+ }, z.core.$strip>>>>, z.ZodTransform<{
702
+ symbol: string;
703
+ mint: string;
704
+ decimals: number;
705
+ name?: string | null | undefined;
706
+ preferred?: boolean | null | undefined;
707
+ recurring_eligible?: boolean | null | undefined;
708
+ }[], {
709
+ symbol: string;
710
+ mint: string;
711
+ decimals: number;
712
+ name?: string | null | undefined;
713
+ preferred?: boolean | null | undefined;
714
+ recurring_eligible?: boolean | null | undefined;
715
+ }[] | null | undefined>>;
716
+ }, z.core.$strip>>>;
717
+ }, z.core.$strip>;
718
+ export type PaymentConfig = z.infer<typeof paymentConfigSchema>;
719
+ /**
720
+ * What a browser needs to know about the deployment and its merchant
721
+ * (`GET /config`): the mount's capabilities, the currency registry and the
722
+ * merchant's payment setup (null when the request resolves no merchant).
723
+ */
724
+ export declare const publicConfigSchema: z.ZodObject<{
725
+ capabilities: z.ZodObject<{
726
+ route_groups: z.ZodRecord<z.ZodString, z.ZodBoolean>;
727
+ features: z.ZodRecord<z.ZodString, z.ZodBoolean>;
728
+ }, z.core.$strip>;
729
+ currencies: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
730
+ code: z.ZodString;
621
731
  decimals: z.ZodNumber;
622
- price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
623
- preferred: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
624
- recurring_eligible: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
625
- quote: z.ZodOptional<z.ZodNullable<z.ZodObject<{
626
- amount: z.ZodString;
627
- units: z.ZodString;
628
- token_price_usd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
629
- fx_rate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
630
- fx_currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
631
- quoted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
632
- expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
633
- }, z.core.$strip>>>;
634
- balance: z.ZodOptional<z.ZodNullable<z.ZodObject<{
635
- amount: z.ZodString;
636
- units: z.ZodString;
637
- sufficient: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
638
- }, z.core.$strip>>>;
732
+ minor_decimals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
639
733
  }, z.core.$strip>>>>, z.ZodTransform<{
640
- symbol: string;
641
- mint: string;
734
+ code: string;
642
735
  decimals: number;
643
- name?: string | null | undefined;
644
- price?: string | null | undefined;
645
- preferred?: boolean | null | undefined;
646
- recurring_eligible?: boolean | null | undefined;
647
- quote?: {
648
- amount: string;
649
- units: string;
650
- token_price_usd?: string | null | undefined;
651
- fx_rate?: string | null | undefined;
652
- fx_currency?: string | null | undefined;
653
- quoted_at?: string | null | undefined;
654
- expires_at?: string | null | undefined;
655
- } | null | undefined;
656
- balance?: {
657
- amount: string;
658
- units: string;
659
- sufficient?: boolean | null | undefined;
660
- } | null | undefined;
736
+ minor_decimals?: number | null | undefined;
661
737
  }[], {
662
- symbol: string;
663
- mint: string;
738
+ code: string;
664
739
  decimals: number;
665
- name?: string | null | undefined;
666
- price?: string | null | undefined;
667
- preferred?: boolean | null | undefined;
668
- recurring_eligible?: boolean | null | undefined;
669
- quote?: {
670
- amount: string;
671
- units: string;
672
- token_price_usd?: string | null | undefined;
673
- fx_rate?: string | null | undefined;
674
- fx_currency?: string | null | undefined;
675
- quoted_at?: string | null | undefined;
676
- expires_at?: string | null | undefined;
677
- } | null | undefined;
678
- balance?: {
679
- amount: string;
680
- units: string;
681
- sufficient?: boolean | null | undefined;
682
- } | null | undefined;
740
+ minor_decimals?: number | null | undefined;
683
741
  }[] | null | undefined>>;
684
- features: z.ZodOptional<z.ZodNullable<z.ZodObject<{
685
- solanaPay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
686
- recurringSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
687
- solanaPayRecurringSubscriptions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
742
+ payment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
743
+ psps: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
744
+ psp_id: z.ZodString;
745
+ key: z.ZodString;
746
+ rail: z.ZodString;
747
+ custodian: z.ZodString;
748
+ display_name: z.ZodString;
749
+ flow: z.ZodString;
750
+ config: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
751
+ checkout: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
752
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
753
+ retry_after: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
754
+ }, z.core.$strip>>>>, z.ZodTransform<{
755
+ psp_id: string;
756
+ key: string;
757
+ rail: string;
758
+ custodian: string;
759
+ display_name: string;
760
+ flow: string;
761
+ config?: Record<string, string> | null | undefined;
762
+ checkout?: boolean | null | undefined;
763
+ status?: string | null | undefined;
764
+ retry_after?: number | null | undefined;
765
+ }[], {
766
+ psp_id: string;
767
+ key: string;
768
+ rail: string;
769
+ custodian: string;
770
+ display_name: string;
771
+ flow: string;
772
+ config?: Record<string, string> | null | undefined;
773
+ checkout?: boolean | null | undefined;
774
+ status?: string | null | undefined;
775
+ retry_after?: number | null | undefined;
776
+ }[] | null | undefined>>;
777
+ solana: z.ZodOptional<z.ZodNullable<z.ZodObject<{
778
+ network: z.ZodString;
779
+ chain: z.ZodString;
780
+ preferred_token: z.ZodOptional<z.ZodNullable<z.ZodString>>;
781
+ tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
782
+ symbol: z.ZodString;
783
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
784
+ mint: z.ZodString;
785
+ decimals: z.ZodNumber;
786
+ preferred: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
787
+ recurring_eligible: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
788
+ }, z.core.$strip>>>>, z.ZodTransform<{
789
+ symbol: string;
790
+ mint: string;
791
+ decimals: number;
792
+ name?: string | null | undefined;
793
+ preferred?: boolean | null | undefined;
794
+ recurring_eligible?: boolean | null | undefined;
795
+ }[], {
796
+ symbol: string;
797
+ mint: string;
798
+ decimals: number;
799
+ name?: string | null | undefined;
800
+ preferred?: boolean | null | undefined;
801
+ recurring_eligible?: boolean | null | undefined;
802
+ }[] | null | undefined>>;
803
+ }, z.core.$strip>>>;
688
804
  }, z.core.$strip>>>;
689
805
  }, z.core.$strip>;
690
- export type SolanaConfig = z.infer<typeof solanaConfigSchema>;
691
- export declare const solanaTierChangeTxSchema: z.ZodObject<{
692
- transaction: z.ZodString;
693
- kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
694
- new_subscription_pda: z.ZodOptional<z.ZodNullable<z.ZodString>>;
695
- }, z.core.$strip>;
696
- export type SolanaTierChangeTx = z.infer<typeof solanaTierChangeTxSchema>;
697
- export declare const solanaTierChangeSchema: z.ZodObject<{
698
- subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
699
- new_subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
700
- kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
701
- status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
702
- already_confirmed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
703
- }, z.core.$strip>;
704
- export type SolanaTierChange = z.infer<typeof solanaTierChangeSchema>;
806
+ export type PublicConfig = z.infer<typeof publicConfigSchema>;
705
807
  /** An in-page card setup; `payment_method_id` is set once the card is saved. */
706
808
  export declare const cardSetupSchema: z.ZodObject<{
707
809
  id: z.ZodString;
@@ -714,18 +816,21 @@ export declare const paymentAuthenticationSchema: z.ZodObject<{
714
816
  client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
715
817
  }, z.core.$strip>;
716
818
  export type PaymentAuthentication = z.infer<typeof paymentAuthenticationSchema>;
717
- /** What a card setup hands the server: tokenized data only, never a PAN. */
819
+ /**
820
+ * What a card setup hands the server: tokenized data only, never a PAN.
821
+ * OpenRails reads the saved card's brand, last four and expiry from the PSP.
822
+ */
718
823
  interface NewCardFields {
719
- /** OpenRails PSP key the card is saved with (e.g. "nmi"); required. */
720
- provider: string;
721
- name_on_card?: string;
722
- country?: string;
723
- zip?: string;
724
- email?: string;
725
- /** Collect.js display metadata: last four digits, brand, MM/YY. */
726
- last_four?: string;
727
- card_type?: string;
728
- expiry_date?: string;
824
+ /** The PSP the card is saved with (`psp_id` of a rail option); required. */
825
+ psp_id: string;
826
+ billing_details?: {
827
+ name?: string;
828
+ email?: string;
829
+ address?: {
830
+ postal_code?: string;
831
+ country?: string;
832
+ };
833
+ };
729
834
  }
730
835
  /**
731
836
  * A card to save: a token from the PSP's own fields (`payment_token`), or,
@@ -740,15 +845,15 @@ export type NewCard = NewCardFields & ({
740
845
  payment_token?: never;
741
846
  });
742
847
  /**
743
- * A minted hosted checkout session. `id` reads and pays it with no other
744
- * credential (`client.checkoutSource(id)`); hand it to this customer's
745
- * browser only. `url` is the shared payment page (`<CheckoutFrame url>`),
746
- * absent when the app renders `<Checkout>` itself.
848
+ * A minted checkout session. `id` reads and pays it with no other credential
849
+ * (`client.checkoutSource(id)`); hand it to this customer's browser only.
850
+ * `url` is the shared payment page (`<CheckoutFrame url>`), null when the app
851
+ * renders `<Checkout>` itself.
747
852
  */
748
- export declare const hostedCheckoutLinkSchema: z.ZodObject<{
853
+ export declare const checkoutSessionLinkSchema: z.ZodObject<{
749
854
  id: z.ZodString;
750
- url: z.ZodOptional<z.ZodString>;
855
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
751
856
  expires_at: z.ZodString;
752
857
  }, z.core.$strip>;
753
- export type HostedCheckoutLink = z.infer<typeof hostedCheckoutLinkSchema>;
858
+ export type CheckoutSessionLink = z.infer<typeof checkoutSessionLinkSchema>;
754
859
  export {};