@openrails/billing-ui 0.234.0 → 0.236.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 (63) hide show
  1. package/CHANGELOG.md +142 -2
  2. package/README.md +119 -85
  3. package/dist/account/account-billing.d.ts +6 -5
  4. package/dist/account/change-card-dialog.d.ts +5 -2
  5. package/dist/account/payment-methods-panel.d.ts +6 -5
  6. package/dist/buy-button.d.ts +35 -0
  7. package/dist/cart.d.ts +18 -0
  8. package/dist/checkout.d.ts +1 -3
  9. package/dist/client/checkout.d.ts +28 -0
  10. package/dist/client/client.d.ts +98 -63
  11. package/dist/client/errors.d.ts +5 -4
  12. package/dist/client/generated/error-codes.d.ts +1 -1
  13. package/dist/client/generated/routes.d.ts +142 -99
  14. package/dist/client/generated/wire.d.ts +185 -98
  15. package/dist/client/index.d.ts +2 -2
  16. package/dist/client/types.d.ts +272 -29
  17. package/dist/{client-CWX6QpLa.js → client-BuvolBPT.js} +498 -326
  18. package/dist/client-BuvolBPT.js.map +1 -0
  19. package/dist/client.js +2 -2
  20. package/dist/components/stripe-card.d.ts +8 -2
  21. package/dist/components/stripe-wallets.d.ts +12 -0
  22. package/dist/components/ui/badge.d.ts +1 -1
  23. package/dist/components/ui/button.d.ts +1 -1
  24. package/dist/frame.d.ts +5 -5
  25. package/dist/hooks-2d-XjpuI.js +526 -0
  26. package/dist/hooks-2d-XjpuI.js.map +1 -0
  27. package/dist/i18n/context.d.ts +1 -1
  28. package/dist/i18n/messages.d.ts +1 -1
  29. package/dist/index.d.ts +7 -5
  30. package/dist/index.js +1985 -1667
  31. package/dist/index.js.map +1 -1
  32. package/dist/lib/money.d.ts +1 -0
  33. package/dist/lib/offer-label.d.ts +4 -0
  34. package/dist/locales/de.js +25 -4
  35. package/dist/locales/de.js.map +1 -1
  36. package/dist/locales/en.d.ts +25 -4
  37. package/dist/locales/en.js +25 -4
  38. package/dist/locales/en.js.map +1 -1
  39. package/dist/locales/es.js +25 -4
  40. package/dist/locales/es.js.map +1 -1
  41. package/dist/locales/ja.js +16 -4
  42. package/dist/locales/ja.js.map +1 -1
  43. package/dist/locales/ko.js +16 -4
  44. package/dist/locales/ko.js.map +1 -1
  45. package/dist/locales/zh.js +16 -4
  46. package/dist/locales/zh.js.map +1 -1
  47. package/dist/offers.d.ts +33 -0
  48. package/dist/order-checkout.d.ts +30 -0
  49. package/dist/react/context.d.ts +6 -5
  50. package/dist/react/hooks.d.ts +17 -16
  51. package/dist/react/index.d.ts +1 -1
  52. package/dist/react/provider.d.ts +24 -2
  53. package/dist/react.js +2 -33
  54. package/dist/save-payment-method.d.ts +0 -6
  55. package/dist/styles.css +1 -1
  56. package/dist/types.d.ts +16 -16
  57. package/docs/payment-form-contract.md +6 -6
  58. package/package.json +2 -2
  59. package/dist/client-CWX6QpLa.js.map +0 -1
  60. package/dist/config-DZ97SQG2.js +0 -341
  61. package/dist/config-DZ97SQG2.js.map +0 -1
  62. package/dist/provider.d.ts +0 -18
  63. package/dist/react.js.map +0 -1
@@ -43,6 +43,7 @@ export declare const priceSchema: z.ZodObject<{
43
43
  id: z.ZodString;
44
44
  key: z.ZodString;
45
45
  revision: z.ZodOptional<z.ZodNumber>;
46
+ version: z.ZodOptional<z.ZodNumber>;
46
47
  product_id: z.ZodString;
47
48
  archived: z.ZodBoolean;
48
49
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -94,6 +95,7 @@ export declare const paymentRecoverySchema: z.ZodObject<{
94
95
  id: z.ZodString;
95
96
  status: z.ZodString;
96
97
  }, z.core.$strip>>>;
98
+ order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
99
  }, z.core.$strip>;
98
100
  export type PaymentRecovery = z.infer<typeof paymentRecoverySchema>;
99
101
  /**
@@ -130,7 +132,9 @@ export declare const subscriptionSchema: z.ZodObject<{
130
132
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
131
133
  product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
132
134
  price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
133
136
  psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ collection_policy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
138
  payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
139
  started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
140
  ended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -158,6 +162,7 @@ export declare const subscriptionSchema: z.ZodObject<{
158
162
  id: z.ZodString;
159
163
  key: z.ZodString;
160
164
  revision: z.ZodOptional<z.ZodNumber>;
165
+ version: z.ZodOptional<z.ZodNumber>;
161
166
  product_id: z.ZodString;
162
167
  archived: z.ZodBoolean;
163
168
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -196,6 +201,7 @@ export declare const subscriptionSchema: z.ZodObject<{
196
201
  id: z.ZodString;
197
202
  key: z.ZodString;
198
203
  revision: z.ZodOptional<z.ZodNumber>;
204
+ version: z.ZodOptional<z.ZodNumber>;
199
205
  product_id: z.ZodString;
200
206
  archived: z.ZodBoolean;
201
207
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -240,6 +246,7 @@ export declare const subscriptionSchema: z.ZodObject<{
240
246
  id: z.ZodString;
241
247
  status: z.ZodString;
242
248
  }, z.core.$strip>>>;
249
+ order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
243
250
  }, z.core.$strip>>>;
244
251
  next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
245
252
  type: z.ZodString;
@@ -270,6 +277,12 @@ export declare const billingDetailsSchema: z.ZodObject<{
270
277
  export type BillingDetails = z.infer<typeof billingDetailsSchema>;
271
278
  export declare const paymentMethodSchema: z.ZodObject<{
272
279
  id: z.ZodString;
280
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
281
+ next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
282
+ type: z.ZodString;
283
+ psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
285
+ }, z.core.$strip>>>;
273
286
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
287
  psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
288
  card: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -291,6 +304,7 @@ export declare const paymentMethodSchema: z.ZodObject<{
291
304
  country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
305
  }, z.core.$strip>>>;
293
306
  }, z.core.$strip>>>;
307
+ reusable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
294
308
  health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
295
309
  expiry_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
310
  last_charged_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -301,10 +315,209 @@ export declare const paymentMethodSchema: z.ZodObject<{
301
315
  id: z.ZodString;
302
316
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
303
317
  }, z.core.$strip>>>>;
304
- collection_currencies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
318
+ default_currencies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
305
319
  created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
320
  }, z.core.$strip>;
307
321
  export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
322
+ /** Why the latest payment attempt failed, in the customer's words. */
323
+ export declare const paymentFailureSchema: z.ZodObject<{
324
+ reason: z.ZodString;
325
+ message: z.ZodString;
326
+ field: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
+ }, z.core.$strip>;
328
+ export type PaymentFailure = z.infer<typeof paymentFailureSchema>;
329
+ /**
330
+ * What the customer completes before a payment can finish: `authenticate`
331
+ * runs the PSP's own script with `payload` (Stripe.js `handleNextAction`
332
+ * with `client_secret`); `redirect_to_url` leaves for `url`.
333
+ */
334
+ export declare const orderNextActionSchema: z.ZodObject<{
335
+ type: z.ZodString;
336
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
337
+ psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
339
+ payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
340
+ }, z.core.$strip>;
341
+ export type OrderNextAction = z.infer<typeof orderNextActionSchema>;
342
+ export declare const orderLineSchema: z.ZodObject<{
343
+ id: z.ZodString;
344
+ price_id: z.ZodString;
345
+ product_id: z.ZodString;
346
+ description: z.ZodString;
347
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
348
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
349
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
350
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
351
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
352
+ subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
353
+ product_access_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
354
+ }, z.core.$strip>;
355
+ export type OrderLine = z.infer<typeof orderLineSchema>;
356
+ /**
357
+ * A purchase, or a subscription's renewal (`origin: subscription`): frozen
358
+ * lines and total, read and paid by its own customer. `status` is the
359
+ * order's (`open | processing | complete | canceled | expired | void`);
360
+ * `payment.status` its payment's (`requires_payment_method |
361
+ * requires_action | processing | succeeded`).
362
+ */
363
+ export declare const orderSchema: z.ZodObject<{
364
+ id: z.ZodString;
365
+ customer_id: z.ZodString;
366
+ origin: z.ZodString;
367
+ status: z.ZodString;
368
+ number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
369
+ currency: z.ZodString;
370
+ total: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
371
+ lines: z.ZodArray<z.ZodObject<{
372
+ id: z.ZodString;
373
+ price_id: z.ZodString;
374
+ product_id: z.ZodString;
375
+ description: z.ZodString;
376
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
377
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
378
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
379
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
380
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
381
+ subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ product_access_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
+ }, z.core.$strip>>;
384
+ payment: z.ZodObject<{
385
+ status: z.ZodString;
386
+ next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
387
+ type: z.ZodString;
388
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
389
+ psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
390
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
391
+ payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
392
+ }, z.core.$strip>>>;
393
+ last_payment_error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
394
+ reason: z.ZodString;
395
+ message: z.ZodString;
396
+ field: z.ZodOptional<z.ZodNullable<z.ZodString>>;
397
+ }, z.core.$strip>>>;
398
+ payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
399
+ payment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
400
+ }, z.core.$strip>;
401
+ payment_options: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
402
+ psp_id: z.ZodString;
403
+ rail: z.ZodString;
404
+ accepts: z.ZodArray<z.ZodString>;
405
+ }, z.core.$strip>>>>, z.ZodTransform<{
406
+ psp_id: string;
407
+ rail: string;
408
+ accepts: string[];
409
+ }[], {
410
+ psp_id: string;
411
+ rail: string;
412
+ accepts: string[];
413
+ }[] | null | undefined>>;
414
+ checkout: z.ZodOptional<z.ZodNullable<z.ZodObject<{
415
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
416
+ success_url: z.ZodString;
417
+ cancel_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
418
+ saved_payment_methods: z.ZodBoolean;
419
+ }, z.core.$strip>>>;
420
+ renewal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
421
+ subscription_id: z.ZodString;
422
+ period_starts_at: z.ZodString;
423
+ period_ends_at: z.ZodString;
424
+ due_at: z.ZodString;
425
+ }, z.core.$strip>>>;
426
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
427
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
428
+ canceled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
429
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
430
+ voided_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
431
+ created_at: z.ZodString;
432
+ }, z.core.$strip>;
433
+ export type Order = z.infer<typeof orderSchema>;
434
+ /** Why a line cannot be bought: `already_owned`, `unavailable`, ... */
435
+ export declare const orderLineRefusalSchema: z.ZodObject<{
436
+ code: z.ZodString;
437
+ message: z.ZodString;
438
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
439
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
440
+ }, z.core.$strip>;
441
+ export type OrderLineRefusal = z.infer<typeof orderLineRefusalSchema>;
442
+ /** One line priced as an order would freeze it, or why it cannot be bought. */
443
+ export declare const orderPreviewLineSchema: z.ZodObject<{
444
+ price_id: z.ZodString;
445
+ product_id: z.ZodString;
446
+ description: z.ZodString;
447
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
448
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
449
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
450
+ ownership: z.ZodString;
451
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
452
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
453
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
454
+ code: z.ZodString;
455
+ message: z.ZodString;
456
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
457
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
+ }, z.core.$strip>>>;
459
+ }, z.core.$strip>;
460
+ export type OrderPreviewLine = z.infer<typeof orderPreviewLineSchema>;
461
+ /**
462
+ * The customer's cart, priced live: one per customer of a merchant, shared by
463
+ * the merchant's sites. `last_changed_at` and `expires_at` are null while it
464
+ * is empty.
465
+ */
466
+ export declare const cartSchema: z.ZodObject<{
467
+ currency: z.ZodString;
468
+ total: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
469
+ lines: z.ZodArray<z.ZodObject<{
470
+ price_id: z.ZodString;
471
+ product_id: z.ZodString;
472
+ description: z.ZodString;
473
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
474
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
475
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
476
+ ownership: z.ZodString;
477
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
478
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
479
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
480
+ code: z.ZodString;
481
+ message: z.ZodString;
482
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
483
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
484
+ }, z.core.$strip>>>;
485
+ }, z.core.$strip>>;
486
+ payment_options: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
487
+ psp_id: z.ZodString;
488
+ rail: z.ZodString;
489
+ accepts: z.ZodArray<z.ZodString>;
490
+ }, z.core.$strip>>>>, z.ZodTransform<{
491
+ psp_id: string;
492
+ rail: string;
493
+ accepts: string[];
494
+ }[], {
495
+ psp_id: string;
496
+ rail: string;
497
+ accepts: string[];
498
+ }[] | null | undefined>>;
499
+ last_changed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
500
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
501
+ }, z.core.$strip>;
502
+ export type Cart = z.infer<typeof cartSchema>;
503
+ /**
504
+ * How to pay an order: a saved card, a card just entered (the token of the
505
+ * PSP's own fields, its `psp_id`), a Solana wallet (`token_symbol`, the
506
+ * token it pays in) or the PSP's hosted page (`return_url`).
507
+ */
508
+ export type OrderPaymentInput = {
509
+ payment_method_id: string;
510
+ } | {
511
+ token: string;
512
+ psp_id?: string;
513
+ billing_details?: NewCard["billing_details"];
514
+ } | {
515
+ token_symbol: string;
516
+ psp_id?: string;
517
+ } | {
518
+ return_url: string;
519
+ psp_id?: string;
520
+ };
308
521
  /** A price's state on one PSP; public routes carry the status only. */
309
522
  export declare const productSchema: z.ZodObject<{
310
523
  id: z.ZodString;
@@ -326,6 +539,7 @@ export declare const productSchema: z.ZodObject<{
326
539
  id: z.ZodString;
327
540
  key: z.ZodString;
328
541
  revision: z.ZodOptional<z.ZodNumber>;
542
+ version: z.ZodOptional<z.ZodNumber>;
329
543
  product_id: z.ZodString;
330
544
  archived: z.ZodBoolean;
331
545
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -359,6 +573,7 @@ export declare const productSchema: z.ZodObject<{
359
573
  created_at: string;
360
574
  updated_at: string;
361
575
  revision?: number | undefined;
576
+ version?: number | undefined;
362
577
  customer_amount?: {
363
578
  min_amount: string;
364
579
  max_amount: string;
@@ -382,6 +597,7 @@ export declare const productSchema: z.ZodObject<{
382
597
  created_at: string;
383
598
  updated_at: string;
384
599
  revision?: number | undefined;
600
+ version?: number | undefined;
385
601
  customer_amount?: {
386
602
  min_amount: string;
387
603
  max_amount: string;
@@ -412,6 +628,7 @@ export declare const paymentSchema: z.ZodObject<{
412
628
  id: z.ZodString;
413
629
  key: z.ZodString;
414
630
  revision: z.ZodOptional<z.ZodNumber>;
631
+ version: z.ZodOptional<z.ZodNumber>;
415
632
  product_id: z.ZodString;
416
633
  archived: z.ZodBoolean;
417
634
  unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -465,8 +682,8 @@ export declare const balanceSchema: z.ZodObject<{
465
682
  }, z.core.$strip>;
466
683
  export type Balance = z.infer<typeof balanceSchema>;
467
684
  /**
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.
685
+ * The signed-in customer's summary (`GET /me`): money per currency, the
686
+ * default card of each currency, and how many notices are unread.
470
687
  */
471
688
  export declare const accountSchema: z.ZodObject<{
472
689
  id: z.ZodString;
@@ -478,7 +695,7 @@ export declare const accountSchema: z.ZodObject<{
478
695
  available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
479
696
  owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
480
697
  }, z.core.$strip>>;
481
- collection_payment_methods: z.ZodArray<z.ZodObject<{
698
+ default_payment_methods: z.ZodArray<z.ZodObject<{
482
699
  currency: z.ZodString;
483
700
  payment_method_id: z.ZodString;
484
701
  }, z.core.$strip>>;
@@ -507,6 +724,7 @@ export declare const invoiceSchema: z.ZodObject<{
507
724
  id: z.ZodString;
508
725
  status: z.ZodString;
509
726
  }, z.core.$strip>>>;
727
+ order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
510
728
  }, z.core.$strip>>>;
511
729
  created_at: z.ZodString;
512
730
  }, z.core.$strip>;
@@ -519,9 +737,9 @@ export declare const currencySchema: z.ZodObject<{
519
737
  minor_decimals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
520
738
  }, z.core.$strip>;
521
739
  export type Currency = z.infer<typeof currencySchema>;
522
- export declare const tierChangePreviewSchema: z.ZodObject<{
523
- action: z.ZodString;
740
+ export declare const subscriptionChangePreviewSchema: z.ZodObject<{
524
741
  price_id: z.ZodString;
742
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
525
743
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
526
744
  currency: z.ZodString;
527
745
  amount_due_now: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
@@ -531,12 +749,12 @@ export declare const tierChangePreviewSchema: z.ZodObject<{
531
749
  is_estimate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
532
750
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
533
751
  }, z.core.$strip>;
534
- export type TierChangePreview = z.infer<typeof tierChangePreviewSchema>;
535
- export declare const tierChangeSchema: z.ZodObject<{
752
+ export type SubscriptionChangePreview = z.infer<typeof subscriptionChangePreviewSchema>;
753
+ export declare const subscriptionChangeSchema: z.ZodObject<{
536
754
  status: z.ZodString;
537
- action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
538
755
  effective: z.ZodOptional<z.ZodNullable<z.ZodString>>;
539
756
  price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
757
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
540
758
  subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
541
759
  next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
542
760
  type: z.ZodString;
@@ -553,7 +771,7 @@ export declare const tierChangeSchema: z.ZodObject<{
553
771
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
554
772
  operation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
555
773
  }, z.core.$strip>;
556
- export type TierChange = z.infer<typeof tierChangeSchema>;
774
+ export type SubscriptionChange = z.infer<typeof subscriptionChangeSchema>;
557
775
  export declare const solanaTokenSchema: z.ZodObject<{
558
776
  symbol: z.ZodString;
559
777
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -716,11 +934,32 @@ export declare const paymentConfigSchema: z.ZodObject<{
716
934
  }, z.core.$strip>>>;
717
935
  }, z.core.$strip>;
718
936
  export type PaymentConfig = z.infer<typeof paymentConfigSchema>;
937
+ /**
938
+ * The challenge to solve when a request answers 403 `captcha_required`: load
939
+ * `script_url`, solve with `site_key` and `action`, and resend the request
940
+ * with the token in the `token_header` header.
941
+ */
942
+ export declare const captchaConfigSchema: z.ZodObject<{
943
+ provider: z.ZodString;
944
+ site_key: z.ZodString;
945
+ script_url: z.ZodString;
946
+ action: z.ZodString;
947
+ token_header: z.ZodString;
948
+ }, z.core.$strip>;
949
+ export type CaptchaConfig = z.infer<typeof captchaConfigSchema>;
719
950
  /**
720
951
  * 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).
952
+ * (`GET /config`): the mount's capabilities, the currency registry, the
953
+ * merchant's payment setup (null when the request resolves no merchant) and
954
+ * the captcha (null when the deployment challenges nobody).
723
955
  */
956
+ /** The merchant as its customers see it; logo and support are https. */
957
+ export declare const publicMerchantSchema: z.ZodObject<{
958
+ display_name: z.ZodString;
959
+ logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
960
+ support_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
961
+ }, z.core.$strip>;
962
+ export type PublicMerchant = z.infer<typeof publicMerchantSchema>;
724
963
  export declare const publicConfigSchema: z.ZodObject<{
725
964
  capabilities: z.ZodObject<{
726
965
  route_groups: z.ZodRecord<z.ZodString, z.ZodBoolean>;
@@ -802,16 +1041,20 @@ export declare const publicConfigSchema: z.ZodObject<{
802
1041
  }[] | null | undefined>>;
803
1042
  }, z.core.$strip>>>;
804
1043
  }, z.core.$strip>>>;
1044
+ merchant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1045
+ display_name: z.ZodString;
1046
+ logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1047
+ support_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1048
+ }, z.core.$strip>>>;
1049
+ captcha: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1050
+ provider: z.ZodString;
1051
+ site_key: z.ZodString;
1052
+ script_url: z.ZodString;
1053
+ action: z.ZodString;
1054
+ token_header: z.ZodString;
1055
+ }, z.core.$strip>>>;
805
1056
  }, z.core.$strip>;
806
1057
  export type PublicConfig = z.infer<typeof publicConfigSchema>;
807
- /** An in-page card setup; `payment_method_id` is set once the card is saved. */
808
- export declare const cardSetupSchema: z.ZodObject<{
809
- id: z.ZodString;
810
- status: z.ZodString;
811
- client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
812
- payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
813
- }, z.core.$strip>;
814
- export type CardSetup = z.infer<typeof cardSetupSchema>;
815
1058
  export declare const paymentAuthenticationSchema: z.ZodObject<{
816
1059
  client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
817
1060
  }, z.core.$strip>;
@@ -833,22 +1076,22 @@ interface NewCardFields {
833
1076
  };
834
1077
  }
835
1078
  /**
836
- * A card to save: a token from the PSP's own fields (`payment_token`), or,
837
- * for a PSP whose card_entry is server (`cardSetupDriver` "card"), the card
838
- * itself, posted to OpenRails and never kept by this package.
1079
+ * A card to save: the single-use token of the PSP's own fields (a Collect.js
1080
+ * token, a Stripe `pm_`), or, for a PSP whose card_entry is server
1081
+ * (`cardSetupDriver` "card"), the card itself, posted to OpenRails and never
1082
+ * kept by this package.
839
1083
  */
840
1084
  export type NewCard = NewCardFields & ({
841
- payment_token: string;
1085
+ token: string;
842
1086
  card?: never;
843
1087
  } | {
844
1088
  card: CardEntry;
845
- payment_token?: never;
1089
+ token?: never;
846
1090
  });
847
1091
  /**
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.
1092
+ * A minted checkout session. `id` reads and pays it with no other credential;
1093
+ * hand it to this customer's browser only. `url` is the shared payment page
1094
+ * (`<CheckoutFrame url>`), null when BuyButton renders the checkout itself.
852
1095
  */
853
1096
  export declare const checkoutSessionLinkSchema: z.ZodObject<{
854
1097
  id: z.ZodString;