@openrails/billing-ui 0.235.0 → 0.237.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 (74) hide show
  1. package/CHANGELOG.md +155 -0
  2. package/README.md +103 -103
  3. package/dist/account/account-billing.d.ts +2 -4
  4. package/dist/account/payment-methods-panel.d.ts +2 -4
  5. package/dist/buy-button.d.ts +40 -0
  6. package/dist/cart.d.ts +18 -0
  7. package/dist/client/client.d.ts +95 -59
  8. package/dist/client/errors.d.ts +4 -0
  9. package/dist/client/generated/error-codes.d.ts +1 -1
  10. package/dist/client/generated/routes.d.ts +103 -272
  11. package/dist/client/generated/wire.d.ts +117 -246
  12. package/dist/client/index.d.ts +2 -2
  13. package/dist/client/types.d.ts +286 -142
  14. package/dist/client-D9G1Tgox.js +888 -0
  15. package/dist/client-D9G1Tgox.js.map +1 -0
  16. package/dist/client.js +2 -2
  17. package/dist/components/eyebrow.d.ts +5 -0
  18. package/dist/components/stripe-card.d.ts +8 -2
  19. package/dist/components/stripe-wallets.d.ts +12 -0
  20. package/dist/components/ui/badge.d.ts +1 -1
  21. package/dist/components/ui/button.d.ts +1 -1
  22. package/dist/embedded-checkout.d.ts +22 -0
  23. package/dist/hooks-DYepYVMX.js +526 -0
  24. package/dist/hooks-DYepYVMX.js.map +1 -0
  25. package/dist/i18n/context.d.ts +1 -1
  26. package/dist/index.d.ts +9 -11
  27. package/dist/index.js +1470 -2178
  28. package/dist/index.js.map +1 -1
  29. package/dist/lib/money.d.ts +1 -0
  30. package/dist/lib/offer-label.d.ts +4 -0
  31. package/dist/locales/de.js +20 -0
  32. package/dist/locales/de.js.map +1 -1
  33. package/dist/locales/en.d.ts +20 -0
  34. package/dist/locales/en.js +20 -0
  35. package/dist/locales/en.js.map +1 -1
  36. package/dist/locales/es.js +20 -0
  37. package/dist/locales/es.js.map +1 -1
  38. package/dist/locales/ja.js +11 -0
  39. package/dist/locales/ja.js.map +1 -1
  40. package/dist/locales/ko.js +11 -0
  41. package/dist/locales/ko.js.map +1 -1
  42. package/dist/locales/zh.js +11 -0
  43. package/dist/locales/zh.js.map +1 -1
  44. package/dist/modal.d.ts +3 -9
  45. package/dist/offers.d.ts +32 -0
  46. package/dist/order-checkout.d.ts +30 -0
  47. package/dist/psp.d.ts +0 -8
  48. package/dist/react/hooks.d.ts +8 -7
  49. package/dist/react/index.d.ts +1 -1
  50. package/dist/react/provider.d.ts +24 -2
  51. package/dist/react.js +2 -33
  52. package/dist/save-payment-method.d.ts +0 -6
  53. package/dist/styles.css +1 -1
  54. package/dist/tokenized-card-form.d.ts +5 -1
  55. package/dist/types.d.ts +12 -250
  56. package/docs/payment-form-contract.md +31 -74
  57. package/package.json +1 -2
  58. package/dist/checkout-frame.d.ts +0 -17
  59. package/dist/checkout-page.d.ts +0 -21
  60. package/dist/checkout.d.ts +0 -24
  61. package/dist/client-BpzCZes3.js +0 -931
  62. package/dist/client-BpzCZes3.js.map +0 -1
  63. package/dist/components/ccbill-fields.d.ts +0 -8
  64. package/dist/components/methods.d.ts +0 -13
  65. package/dist/components/summary.d.ts +0 -12
  66. package/dist/config-qLcHvK0Q.js +0 -341
  67. package/dist/config-qLcHvK0Q.js.map +0 -1
  68. package/dist/fixtures.d.ts +0 -9
  69. package/dist/frame.d.ts +0 -47
  70. package/dist/lib/rail-meta.d.ts +0 -15
  71. package/dist/lib/redirect.d.ts +0 -2
  72. package/dist/provider.d.ts +0 -18
  73. package/dist/react.js.map +0 -1
  74. package/dist/source.d.ts +0 -5
@@ -95,6 +95,7 @@ export declare const paymentRecoverySchema: z.ZodObject<{
95
95
  id: z.ZodString;
96
96
  status: z.ZodString;
97
97
  }, z.core.$strip>>>;
98
+ order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
99
  }, z.core.$strip>;
99
100
  export type PaymentRecovery = z.infer<typeof paymentRecoverySchema>;
100
101
  /**
@@ -245,6 +246,7 @@ export declare const subscriptionSchema: z.ZodObject<{
245
246
  id: z.ZodString;
246
247
  status: z.ZodString;
247
248
  }, z.core.$strip>>>;
249
+ order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
248
250
  }, z.core.$strip>>>;
249
251
  next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
250
252
  type: z.ZodString;
@@ -275,6 +277,12 @@ export declare const billingDetailsSchema: z.ZodObject<{
275
277
  export type BillingDetails = z.infer<typeof billingDetailsSchema>;
276
278
  export declare const paymentMethodSchema: z.ZodObject<{
277
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>>>;
278
286
  rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
287
  psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
280
288
  card: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -296,6 +304,7 @@ export declare const paymentMethodSchema: z.ZodObject<{
296
304
  country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
305
  }, z.core.$strip>>>;
298
306
  }, z.core.$strip>>>;
307
+ reusable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
299
308
  health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
300
309
  expiry_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
301
310
  last_charged_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -310,6 +319,230 @@ export declare const paymentMethodSchema: z.ZodObject<{
310
319
  created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
320
  }, z.core.$strip>;
312
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
+ /**
343
+ * One line of an order. A purchased line names its price and product; a
344
+ * usage order's line names its accrual source (`metered:<meter>`) instead.
345
+ */
346
+ export declare const orderLineSchema: z.ZodObject<{
347
+ id: z.ZodString;
348
+ price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
349
+ product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
350
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
+ description: z.ZodString;
352
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
353
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
354
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
355
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
356
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
357
+ subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
358
+ product_access_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ }, z.core.$strip>;
360
+ export type OrderLine = z.infer<typeof orderLineSchema>;
361
+ /**
362
+ * A purchase, a subscription's renewal (`origin: subscription`) or usage
363
+ * billed in arrears (`origin: usage`): frozen lines and total, read and paid
364
+ * by its own customer. `status` is the order's (`open | processing |
365
+ * complete | canceled | expired | void | uncollectible`); `payment.status`
366
+ * its payment's (`requires_payment_method | requires_action | processing |
367
+ * succeeded`).
368
+ */
369
+ export declare const orderSchema: z.ZodObject<{
370
+ id: z.ZodString;
371
+ customer_id: z.ZodString;
372
+ origin: z.ZodString;
373
+ status: z.ZodString;
374
+ number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
375
+ currency: z.ZodString;
376
+ total: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
377
+ lines: z.ZodArray<z.ZodObject<{
378
+ id: z.ZodString;
379
+ price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
+ product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
+ source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ description: z.ZodString;
383
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
384
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
385
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
386
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
387
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
388
+ subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
389
+ product_access_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
390
+ }, z.core.$strip>>;
391
+ payment: z.ZodObject<{
392
+ status: z.ZodString;
393
+ next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
394
+ type: z.ZodString;
395
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
396
+ psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
397
+ transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
398
+ payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
399
+ }, z.core.$strip>>>;
400
+ last_payment_error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
401
+ reason: z.ZodString;
402
+ message: z.ZodString;
403
+ field: z.ZodOptional<z.ZodNullable<z.ZodString>>;
404
+ }, z.core.$strip>>>;
405
+ payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
406
+ payment_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
407
+ }, z.core.$strip>;
408
+ payment_options: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
409
+ psp_id: z.ZodString;
410
+ rail: z.ZodString;
411
+ accepts: z.ZodArray<z.ZodString>;
412
+ }, z.core.$strip>>>>, z.ZodTransform<{
413
+ psp_id: string;
414
+ rail: string;
415
+ accepts: string[];
416
+ }[], {
417
+ psp_id: string;
418
+ rail: string;
419
+ accepts: string[];
420
+ }[] | null | undefined>>;
421
+ checkout: z.ZodOptional<z.ZodNullable<z.ZodObject<{
422
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
423
+ ui_mode: z.ZodCatch<z.ZodEnum<{
424
+ embedded: "embedded";
425
+ hosted: "hosted";
426
+ }>>;
427
+ expires_at: z.ZodString;
428
+ success_url: z.ZodString;
429
+ cancel_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
430
+ saved_payment_methods: z.ZodBoolean;
431
+ }, z.core.$strip>>>;
432
+ renewal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
433
+ subscription_id: z.ZodString;
434
+ period_starts_at: z.ZodString;
435
+ period_ends_at: z.ZodString;
436
+ due_at: z.ZodString;
437
+ }, z.core.$strip>>>;
438
+ usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
439
+ period_starts_at: z.ZodString;
440
+ period_ends_at: z.ZodString;
441
+ due_at: z.ZodString;
442
+ amount_paid: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
443
+ amount_due: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
444
+ collection_method: z.ZodString;
445
+ next_collection_attempt_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
446
+ po_number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
447
+ memo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
448
+ delinquent: z.ZodBoolean;
449
+ }, z.core.$strip>>>;
450
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
451
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
452
+ canceled_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
453
+ expired_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
454
+ voided_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
455
+ uncollectible_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
+ created_at: z.ZodString;
457
+ }, z.core.$strip>;
458
+ export type Order = z.infer<typeof orderSchema>;
459
+ /** Why a line cannot be bought: `already_owned`, `unavailable`, ... */
460
+ export declare const orderLineRefusalSchema: z.ZodObject<{
461
+ code: z.ZodString;
462
+ message: z.ZodString;
463
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
464
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
465
+ }, z.core.$strip>;
466
+ export type OrderLineRefusal = z.infer<typeof orderLineRefusalSchema>;
467
+ /** One line priced as an order would freeze it, or why it cannot be bought. */
468
+ export declare const orderPreviewLineSchema: z.ZodObject<{
469
+ price_id: z.ZodString;
470
+ product_id: z.ZodString;
471
+ description: z.ZodString;
472
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
473
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
474
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
475
+ ownership: z.ZodString;
476
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
477
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
478
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
479
+ code: z.ZodString;
480
+ message: z.ZodString;
481
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
482
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
483
+ }, z.core.$strip>>>;
484
+ }, z.core.$strip>;
485
+ export type OrderPreviewLine = z.infer<typeof orderPreviewLineSchema>;
486
+ /**
487
+ * The customer's cart, priced live: one per customer of a merchant, shared by
488
+ * the merchant's sites. `last_changed_at` and `expires_at` are null while it
489
+ * is empty.
490
+ */
491
+ export declare const cartSchema: z.ZodObject<{
492
+ currency: z.ZodString;
493
+ total: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
494
+ lines: z.ZodArray<z.ZodObject<{
495
+ price_id: z.ZodString;
496
+ product_id: z.ZodString;
497
+ description: z.ZodString;
498
+ quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
499
+ unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
500
+ amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
501
+ ownership: z.ZodString;
502
+ billing_interval_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
503
+ access_duration_hours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
504
+ refusal: z.ZodOptional<z.ZodNullable<z.ZodObject<{
505
+ code: z.ZodString;
506
+ message: z.ZodString;
507
+ owned_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
+ hint: z.ZodOptional<z.ZodNullable<z.ZodString>>;
509
+ }, z.core.$strip>>>;
510
+ }, z.core.$strip>>;
511
+ payment_options: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
512
+ psp_id: z.ZodString;
513
+ rail: z.ZodString;
514
+ accepts: z.ZodArray<z.ZodString>;
515
+ }, z.core.$strip>>>>, z.ZodTransform<{
516
+ psp_id: string;
517
+ rail: string;
518
+ accepts: string[];
519
+ }[], {
520
+ psp_id: string;
521
+ rail: string;
522
+ accepts: string[];
523
+ }[] | null | undefined>>;
524
+ last_changed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
525
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
526
+ }, z.core.$strip>;
527
+ export type Cart = z.infer<typeof cartSchema>;
528
+ /**
529
+ * How to pay an order: a saved card, a card just entered (the token of the
530
+ * PSP's own fields, its `psp_id`), a Solana wallet (`token_symbol`, the
531
+ * token it pays in) or the PSP's hosted page (`return_url`).
532
+ */
533
+ export type OrderPaymentInput = {
534
+ payment_method_id: string;
535
+ } | {
536
+ token: string;
537
+ psp_id?: string;
538
+ billing_details?: NewCard["billing_details"];
539
+ } | {
540
+ token_symbol: string;
541
+ psp_id?: string;
542
+ } | {
543
+ return_url: string;
544
+ psp_id?: string;
545
+ };
313
546
  /** A price's state on one PSP; public routes carry the status only. */
314
547
  export declare const productSchema: z.ZodObject<{
315
548
  id: z.ZodString;
@@ -463,14 +696,23 @@ export declare const paymentSchema: z.ZodObject<{
463
696
  }, z.core.$strip>>>;
464
697
  }, z.core.$strip>;
465
698
  export type Payment = z.infer<typeof paymentSchema>;
466
- /** A customer's money in one currency. */
699
+ /**
700
+ * A customer's money in one currency, as of `as_of`. `accrued_amount` is what
701
+ * its running charges have charged and the ledger does not hold yet, already
702
+ * taken off `available_amount`; until `depletes_at` (null with no running
703
+ * charge) show `available_amount - accrual_rate_per_hour x hours since as_of`.
704
+ */
467
705
  export declare const balanceSchema: z.ZodObject<{
468
706
  currency: z.ZodString;
469
707
  billing_mode: z.ZodString;
470
708
  balance_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
471
709
  held_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
710
+ accrued_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
472
711
  available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
473
712
  owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
713
+ accrual_rate_per_hour: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
714
+ as_of: z.ZodString;
715
+ depletes_at: z.ZodNullable<z.ZodString>;
474
716
  }, z.core.$strip>;
475
717
  export type Balance = z.infer<typeof balanceSchema>;
476
718
  /**
@@ -484,8 +726,12 @@ export declare const accountSchema: z.ZodObject<{
484
726
  billing_mode: z.ZodString;
485
727
  balance_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
486
728
  held_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
729
+ accrued_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
487
730
  available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
488
731
  owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
732
+ accrual_rate_per_hour: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
733
+ as_of: z.ZodString;
734
+ depletes_at: z.ZodNullable<z.ZodString>;
489
735
  }, z.core.$strip>>;
490
736
  default_payment_methods: z.ZodArray<z.ZodObject<{
491
737
  currency: z.ZodString;
@@ -494,32 +740,6 @@ export declare const accountSchema: z.ZodObject<{
494
740
  unread_notifications: z.ZodNumber;
495
741
  }, z.core.$strip>;
496
742
  export type Account = z.infer<typeof accountSchema>;
497
- export declare const invoiceSchema: z.ZodObject<{
498
- id: z.ZodString;
499
- currency: z.ZodString;
500
- invoice_number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
501
- period_starts_at: z.ZodString;
502
- period_ends_at: z.ZodString;
503
- total_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
504
- amount_paid: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
505
- amount_due: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
506
- status: z.ZodString;
507
- issued_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
508
- due_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
509
- delinquent: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
510
- paid_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
511
- recovery: z.ZodOptional<z.ZodNullable<z.ZodObject<{
512
- last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
513
- retryable: z.ZodBoolean;
514
- blocked_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
515
- operation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
516
- id: z.ZodString;
517
- status: z.ZodString;
518
- }, z.core.$strip>>>;
519
- }, z.core.$strip>>>;
520
- created_at: z.ZodString;
521
- }, z.core.$strip>;
522
- export type Invoice = z.infer<typeof invoiceSchema>;
523
743
  /** Currency code (upper case) to its native-unit scale. */
524
744
  export type CurrencyScales = Readonly<Record<string, number>>;
525
745
  export declare const currencySchema: z.ZodObject<{
@@ -563,99 +783,6 @@ export declare const subscriptionChangeSchema: z.ZodObject<{
563
783
  operation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
564
784
  }, z.core.$strip>;
565
785
  export type SubscriptionChange = z.infer<typeof subscriptionChangeSchema>;
566
- export declare const solanaTokenSchema: z.ZodObject<{
567
- symbol: z.ZodString;
568
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
569
- mint: z.ZodString;
570
- decimals: z.ZodNumber;
571
- price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
572
- preferred: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
573
- recurring_eligible: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
574
- quote: z.ZodOptional<z.ZodNullable<z.ZodObject<{
575
- amount: z.ZodString;
576
- units: z.ZodString;
577
- token_price_usd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
578
- fx_rate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
579
- fx_currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
580
- quoted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
581
- expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
582
- }, z.core.$strip>>>;
583
- balance: z.ZodOptional<z.ZodNullable<z.ZodObject<{
584
- amount: z.ZodString;
585
- units: z.ZodString;
586
- sufficient: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
587
- }, z.core.$strip>>>;
588
- }, z.core.$strip>;
589
- export type SolanaToken = z.infer<typeof solanaTokenSchema>;
590
- export declare const solanaTokensSchema: z.ZodObject<{
591
- tokens: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
592
- symbol: z.ZodString;
593
- name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
594
- mint: z.ZodString;
595
- decimals: z.ZodNumber;
596
- price: z.ZodOptional<z.ZodNullable<z.ZodString>>;
597
- preferred: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
598
- recurring_eligible: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
599
- quote: z.ZodOptional<z.ZodNullable<z.ZodObject<{
600
- amount: z.ZodString;
601
- units: z.ZodString;
602
- token_price_usd: z.ZodOptional<z.ZodNullable<z.ZodString>>;
603
- fx_rate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
604
- fx_currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
605
- quoted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
606
- expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
607
- }, z.core.$strip>>>;
608
- balance: z.ZodOptional<z.ZodNullable<z.ZodObject<{
609
- amount: z.ZodString;
610
- units: z.ZodString;
611
- sufficient: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
612
- }, z.core.$strip>>>;
613
- }, z.core.$strip>>>>, z.ZodTransform<{
614
- symbol: string;
615
- mint: string;
616
- decimals: number;
617
- name?: string | null | undefined;
618
- price?: string | null | undefined;
619
- preferred?: boolean | null | undefined;
620
- recurring_eligible?: boolean | null | undefined;
621
- quote?: {
622
- amount: string;
623
- units: string;
624
- token_price_usd?: string | null | undefined;
625
- fx_rate?: string | null | undefined;
626
- fx_currency?: string | null | undefined;
627
- quoted_at?: string | null | undefined;
628
- expires_at?: string | null | undefined;
629
- } | null | undefined;
630
- balance?: {
631
- amount: string;
632
- units: string;
633
- sufficient?: boolean | null | undefined;
634
- } | null | undefined;
635
- }[], {
636
- symbol: string;
637
- mint: string;
638
- decimals: number;
639
- name?: string | null | undefined;
640
- price?: string | null | undefined;
641
- preferred?: boolean | null | undefined;
642
- recurring_eligible?: boolean | null | undefined;
643
- quote?: {
644
- amount: string;
645
- units: string;
646
- token_price_usd?: string | null | undefined;
647
- fx_rate?: string | null | undefined;
648
- fx_currency?: string | null | undefined;
649
- quoted_at?: string | null | undefined;
650
- expires_at?: string | null | undefined;
651
- } | null | undefined;
652
- balance?: {
653
- amount: string;
654
- units: string;
655
- sufficient?: boolean | null | undefined;
656
- } | null | undefined;
657
- }[] | null | undefined>>;
658
- }, z.core.$strip>;
659
786
  /**
660
787
  * The merchant's browser payment setup: its armed PSPs with their public
661
788
  * values and, with a Solana PSP, the network and accepted tokens a wallet
@@ -744,6 +871,14 @@ export type CaptchaConfig = z.infer<typeof captchaConfigSchema>;
744
871
  * merchant's payment setup (null when the request resolves no merchant) and
745
872
  * the captcha (null when the deployment challenges nobody).
746
873
  */
874
+ /** The merchant as its customers see it; logo and support are https. */
875
+ export declare const publicMerchantSchema: z.ZodObject<{
876
+ display_name: z.ZodString;
877
+ logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
878
+ support_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
879
+ embed_origins: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
880
+ }, z.core.$strip>;
881
+ export type PublicMerchant = z.infer<typeof publicMerchantSchema>;
747
882
  export declare const publicConfigSchema: z.ZodObject<{
748
883
  capabilities: z.ZodObject<{
749
884
  route_groups: z.ZodRecord<z.ZodString, z.ZodBoolean>;
@@ -825,6 +960,12 @@ export declare const publicConfigSchema: z.ZodObject<{
825
960
  }[] | null | undefined>>;
826
961
  }, z.core.$strip>>>;
827
962
  }, z.core.$strip>>>;
963
+ merchant: z.ZodOptional<z.ZodNullable<z.ZodObject<{
964
+ display_name: z.ZodString;
965
+ logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
966
+ support_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
967
+ embed_origins: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
968
+ }, z.core.$strip>>>;
828
969
  captcha: z.ZodOptional<z.ZodNullable<z.ZodObject<{
829
970
  provider: z.ZodString;
830
971
  site_key: z.ZodString;
@@ -832,16 +973,30 @@ export declare const publicConfigSchema: z.ZodObject<{
832
973
  action: z.ZodString;
833
974
  token_header: z.ZodString;
834
975
  }, z.core.$strip>>>;
976
+ network: z.ZodOptional<z.ZodNullable<z.ZodObject<{
977
+ issuer: z.ZodString;
978
+ client_id: z.ZodString;
979
+ }, z.core.$strip>>>;
835
980
  }, z.core.$strip>;
836
981
  export type PublicConfig = z.infer<typeof publicConfigSchema>;
837
- /** An in-page card setup; `payment_method_id` is set once the card is saved. */
838
- export declare const cardSetupSchema: z.ZodObject<{
982
+ export declare const networkLinkChallengeSchema: z.ZodObject<{
983
+ id: z.ZodString;
984
+ nonce: z.ZodString;
985
+ expires_at: z.ZodString;
986
+ }, z.core.$strip>;
987
+ export type NetworkLinkChallenge = z.infer<typeof networkLinkChallengeSchema>;
988
+ export declare const customerLinkSchema: z.ZodObject<{
839
989
  id: z.ZodString;
990
+ merchant_id: z.ZodString;
991
+ customer_id: z.ZodString;
992
+ account_id: z.ZodString;
993
+ method: z.ZodString;
840
994
  status: z.ZodString;
841
- client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
842
- payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
995
+ linked_at: z.ZodString;
996
+ revoked_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
997
+ revoked_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
843
998
  }, z.core.$strip>;
844
- export type CardSetup = z.infer<typeof cardSetupSchema>;
999
+ export type CustomerLink = z.infer<typeof customerLinkSchema>;
845
1000
  export declare const paymentAuthenticationSchema: z.ZodObject<{
846
1001
  client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
847
1002
  }, z.core.$strip>;
@@ -863,27 +1018,16 @@ interface NewCardFields {
863
1018
  };
864
1019
  }
865
1020
  /**
866
- * A card to save: a token from the PSP's own fields (`payment_token`), or,
867
- * for a PSP whose card_entry is server (`cardSetupDriver` "card"), the card
868
- * itself, posted to OpenRails and never kept by this package.
1021
+ * A card to save: the single-use token of the PSP's own fields (a Collect.js
1022
+ * token, a Stripe `pm_`), or, for a PSP whose card_entry is server
1023
+ * (`cardSetupDriver` "card"), the card itself, posted to OpenRails and never
1024
+ * kept by this package.
869
1025
  */
870
1026
  export type NewCard = NewCardFields & ({
871
- payment_token: string;
1027
+ token: string;
872
1028
  card?: never;
873
1029
  } | {
874
1030
  card: CardEntry;
875
- payment_token?: never;
1031
+ token?: never;
876
1032
  });
877
- /**
878
- * A minted checkout session. `id` reads and pays it with no other credential
879
- * (`client.checkoutSource(id)`); hand it to this customer's browser only.
880
- * `url` is the shared payment page (`<CheckoutFrame url>`), null when the app
881
- * renders `<Checkout>` itself.
882
- */
883
- export declare const checkoutSessionLinkSchema: z.ZodObject<{
884
- id: z.ZodString;
885
- url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
886
- expires_at: z.ZodString;
887
- }, z.core.$strip>;
888
- export type CheckoutSessionLink = z.infer<typeof checkoutSessionLinkSchema>;
889
1033
  export {};