@openrails/billing-ui 0.252.1 → 0.254.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 (72) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +15 -4
  3. package/dist/admin/context.d.ts +4 -4
  4. package/dist/admin/lib/api/endpoints.d.ts +2 -2
  5. package/dist/admin/lib/api/index.d.ts +1 -1
  6. package/dist/admin/lib/api/types.d.ts +1 -1
  7. package/dist/admin/lib/mutations.d.ts +1 -1
  8. package/dist/admin/messages.d.ts +10 -0
  9. package/dist/{admin-catalog-Bsxo2gyS.js → admin-catalog-rrFZd5N8.js} +2 -2
  10. package/dist/{admin-catalog-Bsxo2gyS.js.map → admin-catalog-rrFZd5N8.js.map} +1 -1
  11. package/dist/{admin-detail-DG-YaHhS.js → admin-detail-DAOjLNL9.js} +2 -2
  12. package/dist/admin-detail-DAOjLNL9.js.map +1 -0
  13. package/dist/{admin-orders-8XzHf7b-.js → admin-orders-DMSOum9t.js} +2 -2
  14. package/dist/admin-orders-DMSOum9t.js.map +1 -0
  15. package/dist/{admin-price-detail-ByCmrx_W.js → admin-price-detail-Bwk9PXHP.js} +2 -2
  16. package/dist/{admin-price-detail-ByCmrx_W.js.map → admin-price-detail-Bwk9PXHP.js.map} +1 -1
  17. package/dist/{admin-price-wizard-m7Qjhq6W.js → admin-price-wizard-ByD7j8mB.js} +2 -2
  18. package/dist/admin-price-wizard-ByD7j8mB.js.map +1 -0
  19. package/dist/{admin-settings-BIUgvclv.js → admin-settings-D_8L1Hho.js} +101 -76
  20. package/dist/admin-settings-D_8L1Hho.js.map +1 -0
  21. package/dist/admin-utils-DnVY5fYd.js.map +1 -1
  22. package/dist/admin.js +17 -7
  23. package/dist/admin.js.map +1 -1
  24. package/dist/buy-button.d.ts +4 -1
  25. package/dist/cart.d.ts +4 -1
  26. package/dist/client/generated/error-codes.d.ts +1 -1
  27. package/dist/client/generated/routes.d.ts +4 -4
  28. package/dist/client/generated/wire.d.ts +59 -23
  29. package/dist/client/types.d.ts +13 -7
  30. package/dist/{client-imFR1UCe.js → client-B301IAQD.js} +6 -5
  31. package/dist/client-B301IAQD.js.map +1 -0
  32. package/dist/client.js +1 -1
  33. package/dist/components/platform-card-form.d.ts +10 -0
  34. package/dist/create-card-BEILS1VB-DeyyfyFD.js +140 -0
  35. package/dist/create-card-BEILS1VB-DeyyfyFD.js.map +1 -0
  36. package/dist/create-card-display-Dv5pcpzc-BWB6vzo2.js +166 -0
  37. package/dist/create-card-display-Dv5pcpzc-BWB6vzo2.js.map +1 -0
  38. package/dist/create-copy-button-CAYmfugS-qNapojfj.js +125 -0
  39. package/dist/create-copy-button-CAYmfugS-qNapojfj.js.map +1 -0
  40. package/dist/embedded-payment.d.ts +4 -1
  41. package/dist/fallbacks.d.ts +25 -0
  42. package/dist/{hooks-C9JkHcRt.js → hooks-DARbMTwv.js} +69 -59
  43. package/dist/hooks-DARbMTwv.js.map +1 -0
  44. package/dist/index-rGw83t5v-BE6naeQR.js +1801 -0
  45. package/dist/index-rGw83t5v-BE6naeQR.js.map +1 -0
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.js +1160 -975
  48. package/dist/index.js.map +1 -1
  49. package/dist/locales/de.js +1 -0
  50. package/dist/locales/de.js.map +1 -1
  51. package/dist/locales/en.d.ts +1 -0
  52. package/dist/locales/en.js +1 -0
  53. package/dist/locales/en.js.map +1 -1
  54. package/dist/locales/es.js +1 -0
  55. package/dist/locales/es.js.map +1 -1
  56. package/dist/locales/ja.js +1 -0
  57. package/dist/locales/ja.js.map +1 -1
  58. package/dist/locales/ko.js +1 -0
  59. package/dist/locales/ko.js.map +1 -1
  60. package/dist/locales/zh.js +1 -0
  61. package/dist/locales/zh.js.map +1 -1
  62. package/dist/order-payment.d.ts +8 -1
  63. package/dist/product-list.d.ts +4 -1
  64. package/dist/psp.d.ts +1 -1
  65. package/dist/react.js +1 -1
  66. package/package.json +2 -1
  67. package/dist/admin-detail-DG-YaHhS.js.map +0 -1
  68. package/dist/admin-orders-8XzHf7b-.js.map +0 -1
  69. package/dist/admin-price-wizard-m7Qjhq6W.js.map +0 -1
  70. package/dist/admin-settings-BIUgvclv.js.map +0 -1
  71. package/dist/client-imFR1UCe.js.map +0 -1
  72. package/dist/hooks-C9JkHcRt.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { BillingAppearance } from './appearance';
2
2
  import { Order, Price } from './client/types';
3
+ import { PaymentFallbacks } from './fallbacks';
3
4
  import * as React from "react";
4
5
  export interface BuyButtonProps {
5
6
  /**
@@ -17,6 +18,8 @@ export interface BuyButtonProps {
17
18
  amount?: string;
18
19
  /** Where a redirect PSP (Stripe's hosted page) returns the buyer: one of the app's return origins. */
19
20
  returnUrl?: string;
21
+ /** PSPs kept back until others fail on the order; see OrderPayment. */
22
+ fallbacks?: PaymentFallbacks;
20
23
  /**
21
24
  * The order is paid. A hint: the host's own gate decides access, so send
22
25
  * the buyer to the content it guards.
@@ -33,4 +36,4 @@ export interface BuyButtonProps {
33
36
  className?: string;
34
37
  }
35
38
  /** One price's button and its order. Requires `BillingProvider`. */
36
- export declare function BuyButton({ price, label, amount, returnUrl, onPaid, onSignInRequired, signedIn, appearance, className, }: BuyButtonProps): React.JSX.Element;
39
+ export declare function BuyButton({ price, label, amount, returnUrl, fallbacks, onPaid, onSignInRequired, signedIn, appearance, className, }: BuyButtonProps): React.JSX.Element;
package/dist/cart.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BillingAppearance } from './appearance';
2
2
  import { BillingClient } from './client/client';
3
3
  import { Order } from './client/types';
4
+ import { PaymentFallbacks } from './fallbacks';
4
5
  import * as React from "react";
5
6
  export interface CartProps {
6
7
  /** The client to read and buy through; default: the provider's. */
@@ -11,8 +12,10 @@ export interface CartProps {
11
12
  onOrder?: (order: Order) => void;
12
13
  /** Passed to OrderPayment: the order is complete, or processing. */
13
14
  onSettled?: (order: Order) => void;
15
+ /** Passed to OrderPayment: PSPs kept back until others fail on the order. */
16
+ fallbacks?: PaymentFallbacks;
14
17
  appearance?: BillingAppearance;
15
18
  className?: string;
16
19
  }
17
20
  /** The customer's cart. Requires `BillingProvider`. */
18
- export declare function Cart({ client: given, onOrder, onSettled, appearance, className, }: CartProps): React.JSX.Element;
21
+ export declare function Cart({ client: given, onOrder, onSettled, fallbacks, appearance, className, }: CartProps): React.JSX.Element;
@@ -1,4 +1,4 @@
1
- export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_platform_cards" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_custody_reserved" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_issuer_mismatch" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "destructive_actions_held" | "embed_origins_required" | "entitlement_required" | "finding_action_failed" | "finding_not_actionable" | "finding_requires_merchant_config" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_config_read_only" | "merchant_mismatch" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_attempt_closed" | "order_attempt_expired" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "pay_url_attempts_exhausted" | "pay_url_expired" | "pay_url_not_found" | "pay_url_unavailable" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_option_withheld" | "payment_provider_rejected" | "permission_required" | "platform_vault_unavailable" | "platform_vault_unreachable" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_in_use" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_cancel_held" | "provider_outcome_unknown" | "provider_writes_held" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_environment_mixed" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_not_priced" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid";
1
+ export type OpenRailsErrorCode = "admission_captured" | "admission_not_found" | "already_owned" | "application_required" | "as_of_required" | "authentication_required" | "authentication_unavailable" | "authorization_unavailable" | "billing_archive_integrity" | "billing_archive_invalid_artifact" | "billing_archive_merchant_mismatch" | "billing_archive_not_empty" | "billing_archive_platform_cards" | "billing_archive_unavailable" | "billing_archive_unsupported_state" | "billing_policy_not_found" | "cancel_unsupported_on_rail" | "captcha_invalid" | "captcha_required" | "card_attempts_blocked" | "card_custody_reserved" | "card_declined" | "card_not_saved" | "card_requires_https" | "catalog_benefit_overlap" | "catalog_revision_conflict" | "credential_expired" | "credential_revoked" | "credit_grant_held" | "credit_grant_not_found" | "credit_grant_unavailable" | "csrf_origin_denied" | "currency_unsupported" | "custodian_capture_unavailable" | "customer_action_required" | "customer_email_required" | "customer_issuer_mismatch" | "customer_not_found" | "customer_payment_unsupported" | "customer_session_required" | "dashboard_invalid" | "database_busy" | "default_payment_method_invalid" | "default_payment_method_required" | "default_rate_card_not_found" | "destructive_actions_held" | "embed_origins_required" | "entitlement_required" | "finding_action_failed" | "finding_not_actionable" | "finding_requires_merchant_config" | "hold_not_found" | "host_event_not_found" | "host_principal_invalid" | "idempotency_key_in_use" | "idempotency_key_required" | "idempotency_key_reused" | "insufficient_credits" | "insufficient_funds" | "internal_error" | "invalid_cursor" | "invalid_customer_id" | "invalid_host_event_request" | "invalid_param" | "invalid_payment_method" | "invalid_psp_reference" | "invalid_query" | "invalid_request_body" | "invalid_settlement_status_request" | "invoker_scoped_principal" | "merchant_config_read_only" | "merchant_mismatch" | "merchant_unresolved" | "meter_in_use" | "meter_rate_card_conflict" | "method_not_allowed" | "metrics_query_invalid" | "model_unavailable" | "network_account_linked" | "network_link_challenge_invalid" | "network_link_conflict" | "network_link_in_use" | "network_terms_required" | "order_action_not_allowed" | "order_attempt_closed" | "order_attempt_expired" | "order_has_recurring_line" | "order_line_unavailable" | "order_not_cancelable" | "order_not_payable" | "order_payment_in_progress" | "order_total_changed" | "pay_url_attempts_exhausted" | "pay_url_expired" | "pay_url_not_found" | "pay_url_unavailable" | "payment_duplicate_refused" | "payment_exceeds_due" | "payment_failed" | "payment_idempotency_conflict" | "payment_in_progress" | "payment_method_delete_failed" | "payment_method_delete_unsupported" | "payment_method_not_psp_vaulted" | "payment_method_not_usable" | "payment_method_psp_mismatch" | "payment_method_required" | "payment_method_same_vault" | "payment_method_stale" | "payment_method_update_failed" | "payment_method_update_unsupported" | "payment_not_found" | "payment_not_refundable" | "payment_not_retryable" | "payment_option_unavailable" | "payment_provider_rejected" | "permission_required" | "platform_vault_unavailable" | "platform_vault_unreachable" | "price_change_currency_mismatch" | "price_change_target_archived" | "price_increase_notice_too_short" | "price_key_cadence_conflict" | "price_key_not_found" | "price_migration_not_found" | "price_not_found" | "price_not_sellable" | "product_in_use" | "product_not_found" | "product_tier_group_conflict" | "product_tier_group_in_use" | "provider_cancel_held" | "provider_outcome_unknown" | "provider_writes_disabled" | "provider_writes_held" | "psp_claim_requires_proof" | "psp_credentials_rejected" | "psp_environment_mixed" | "psp_exists" | "psp_key_taken" | "psp_last_active" | "psp_not_found" | "purchase_review_resolved" | "quantity_not_allowed" | "rate_card_product_not_found" | "rate_limit_exceeded" | "rebill_terms_committed" | "refund_failed" | "refund_rail_unavailable" | "refund_unsupported" | "request_body_too_large" | "resource_access_denied" | "resource_conflict" | "resource_not_found" | "revision_mismatch" | "route_not_found" | "running_charge_not_found" | "scheduled_change_exists" | "service_credential_customer_scope_denied" | "service_unavailable" | "solana_rpc_unavailable" | "solana_transaction_refused" | "step_up_required" | "step_up_unavailable" | "stored_credential_required" | "subscription_change_already_scheduled" | "subscription_change_cadence_unsupported" | "subscription_change_credit_exceeds_price" | "subscription_change_cycle_unknown" | "subscription_change_idempotency_conflict" | "subscription_change_idempotency_key_required" | "subscription_change_in_flight" | "subscription_change_period_unknown" | "subscription_change_provider_conflict" | "subscription_change_refused" | "subscription_change_renewal_due" | "subscription_change_requires_linked_plan" | "subscription_change_target_inactive" | "subscription_change_unsupported_on_rail" | "subscription_not_active" | "subscription_not_found" | "subscription_paid_through" | "subscription_resumable" | "trial_unsupported_on_rail" | "unknown_field" | "unsupported_media_type" | "usage_meter_invalid" | "usage_meter_not_found" | "usage_not_priced" | "usage_rate_card_invalid" | "webhook_account_mismatch" | "webhook_invalid";
2
2
  export type OpenRailsErrorType = "api_error" | "authentication_error" | "authorization_error" | "card_error" | "invalid_request_error" | "rate_limit_error";
3
3
  export declare const OPENRAILS_ERROR_CODES: Readonly<Record<OpenRailsErrorCode, {
4
4
  status: number;
@@ -98,7 +98,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
98
98
  readonly 200: "Order";
99
99
  readonly 201: "Order";
100
100
  };
101
- readonly errors: readonly ["already_owned", "card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "customer_session_required", "embed_origins_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "order_not_payable", "order_payment_in_progress", "order_total_changed", "pay_url_unavailable", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_option_withheld", "payment_provider_rejected", "quantity_not_allowed", "resource_conflict", "resource_not_found", "service_unavailable"];
101
+ readonly errors: readonly ["already_owned", "card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "customer_session_required", "embed_origins_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_line_unavailable", "order_not_payable", "order_payment_in_progress", "order_total_changed", "pay_url_unavailable", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "quantity_not_allowed", "resource_conflict", "resource_not_found", "service_unavailable"];
102
102
  readonly errorSets: readonly ["tier:customer", "request"];
103
103
  }, {
104
104
  readonly method: "GET";
@@ -140,7 +140,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
140
140
  readonly responses: {
141
141
  readonly 200: "Order";
142
142
  };
143
- readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_option_withheld", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
143
+ readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
144
144
  readonly errorSets: readonly ["tier:customer", "request"];
145
145
  }, {
146
146
  readonly method: "POST";
@@ -1096,7 +1096,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
1096
1096
  readonly mountedWhen: null;
1097
1097
  readonly request: "UpdateCustomerParams";
1098
1098
  readonly responses: {
1099
- readonly 200: "Customer";
1099
+ readonly 200: "CustomerSettingsResult";
1100
1100
  };
1101
1101
  readonly errors: readonly ["billing_policy_not_found", "currency_unsupported", "invalid_customer_id", "invalid_param", "service_credential_customer_scope_denied", "service_unavailable"];
1102
1102
  readonly errorSets: readonly ["tier:merchant", "request"];
@@ -2593,7 +2593,7 @@ export declare const OPENRAILS_ROUTES: readonly [{
2593
2593
  readonly responses: {
2594
2594
  readonly 200: "Order";
2595
2595
  };
2596
- readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_option_withheld", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
2596
+ readonly errors: readonly ["card_attempts_blocked", "card_declined", "customer_action_required", "customer_email_required", "entitlement_required", "idempotency_key_in_use", "idempotency_key_required", "idempotency_key_reused", "invalid_param", "order_not_payable", "order_payment_in_progress", "order_total_changed", "payment_failed", "payment_method_stale", "payment_option_unavailable", "payment_provider_rejected", "resource_conflict", "resource_not_found", "service_unavailable"];
2597
2597
  readonly errorSets: readonly ["tier:network", "request"];
2598
2598
  }, {
2599
2599
  readonly method: "POST";
@@ -460,8 +460,13 @@ export type CreatePSPParams = {
460
460
  key?: string;
461
461
  rail?: "ccbill" | "nmi" | "solana" | "stripe";
462
462
  environment?: string;
463
+ gateway_id?: string;
463
464
  account_id?: string;
464
- settings?: Record<string, unknown> | null;
465
+ client_accnum?: string;
466
+ client_subacc?: string;
467
+ treasury?: string;
468
+ tokenization_key?: string;
469
+ publishable_key?: string;
465
470
  credentials?: Record<string, string> | null;
466
471
  };
467
472
  export type CreatePaymentMethodParams = {
@@ -653,6 +658,10 @@ export type CustomerSettings = {
653
658
  billing_policy: string | null;
654
659
  invoice_profile: InvoiceProfile | null;
655
660
  };
661
+ export type CustomerSettingsResult = {
662
+ id: string;
663
+ settings: CustomerSettings;
664
+ };
656
665
  export type Dashboard = {
657
666
  widgets: DashboardWidget[];
658
667
  is_default: boolean;
@@ -1020,20 +1029,7 @@ export type MatrixCell = {
1020
1029
  export type MerchantConfigurationState = {
1021
1030
  revision: number;
1022
1031
  display_name: string;
1023
- settings: MerchantSettings;
1024
- platform_vault: PlatformVaultState;
1025
- };
1026
- export type MerchantPaymentPageSettings = {
1027
- embed_origins?: string[];
1028
- };
1029
- export type MerchantProfile = {
1030
- logo_url?: string;
1031
- from_email?: string;
1032
- support_url?: string;
1033
- subscribe_url?: string;
1034
- billing_url?: string;
1035
- };
1036
- export type MerchantSettings = {
1032
+ sandbox: boolean;
1037
1033
  profile?: MerchantProfile;
1038
1034
  collection_threshold?: string;
1039
1035
  monthly_floor?: string;
@@ -1051,6 +1047,17 @@ export type MerchantSettings = {
1051
1047
  billing_policies?: BillingPolicy[];
1052
1048
  billing_policy_bindings?: BillingPolicyBinding[];
1053
1049
  delegated_invoker_wasted_spend_limits?: BudgetWindow[];
1050
+ platform_vault: PlatformVaultState;
1051
+ };
1052
+ export type MerchantPaymentPageSettings = {
1053
+ embed_origins?: string[];
1054
+ };
1055
+ export type MerchantProfile = {
1056
+ logo_url?: string;
1057
+ from_email?: string;
1058
+ support_url?: string;
1059
+ subscribe_url?: string;
1060
+ billing_url?: string;
1054
1061
  };
1055
1062
  export type Meter = {
1056
1063
  key: string;
@@ -1206,7 +1213,7 @@ export type Order = {
1206
1213
  collection_owner: "engine" | "nmi_schedule" | "provider";
1207
1214
  collection_psp_id: string | null;
1208
1215
  provider_bills: OrderProviderBill[];
1209
- number: string | null;
1216
+ number: number | null;
1210
1217
  currency: string;
1211
1218
  total: string;
1212
1219
  lines: OrderLine[];
@@ -1235,7 +1242,7 @@ export type OrderHostEvent = {
1235
1242
  payment_status: "processing" | "requires_action" | "requires_payment_method" | "succeeded";
1236
1243
  total: string;
1237
1244
  currency: string;
1238
- number: string | null;
1245
+ number: number | null;
1239
1246
  payment_id: string | null;
1240
1247
  };
1241
1248
  export type OrderLine = {
@@ -1280,10 +1287,11 @@ export type OrderPayment = {
1280
1287
  payment_id: string | null;
1281
1288
  };
1282
1289
  export type OrderPaymentOption = {
1290
+ saved_payment_method_ids?: string[];
1283
1291
  psp_id: string;
1284
1292
  rail: string;
1285
1293
  accepts: string[];
1286
- fallback: boolean;
1294
+ failed_attempts: number;
1287
1295
  };
1288
1296
  export type OrderPaymentParams = {
1289
1297
  payment_method_id?: string;
@@ -1344,10 +1352,19 @@ export type PSP = {
1344
1352
  key: string;
1345
1353
  rail: "ccbill" | "nmi" | "solana" | "stripe";
1346
1354
  environment: string;
1347
- account_id: string;
1348
1355
  archived: boolean;
1349
1356
  open_obligations: number;
1350
- settings: Record<string, unknown> | null;
1357
+ gateway_id?: string;
1358
+ account_id?: string;
1359
+ client_accnum?: string;
1360
+ client_subacc?: string;
1361
+ treasury?: string;
1362
+ custodian?: string;
1363
+ tokenization_key?: string;
1364
+ tokenization_url?: string;
1365
+ card_entry?: string;
1366
+ publishable_key?: string;
1367
+ webhook_overlap_expires_at?: string;
1351
1368
  credentials: Record<string, PSPCredential> | null;
1352
1369
  revision: number;
1353
1370
  created_at: string;
@@ -1730,8 +1747,9 @@ export type Quantity = {
1730
1747
  export type RailDefinition = {
1731
1748
  rail: "ccbill" | "nmi" | "solana" | "stripe";
1732
1749
  display_name: string;
1750
+ account_fields: string[];
1751
+ fields: string[];
1733
1752
  credential_keys: string[];
1734
- setting_keys: string[];
1735
1753
  environments: string[];
1736
1754
  };
1737
1755
  export type RateCard = {
@@ -2028,12 +2046,30 @@ export type UpdateCustomerParams = {
2028
2046
  };
2029
2047
  export type UpdateMerchantConfigurationParams = {
2030
2048
  expected_revision?: number | null;
2031
- settings?: MerchantSettings;
2032
2049
  display_name?: string;
2050
+ sandbox?: boolean;
2051
+ profile?: MerchantProfile;
2052
+ collection_threshold?: string;
2053
+ monthly_floor?: string;
2054
+ billing_period_boundary?: string;
2055
+ alert_email?: string;
2056
+ reprice_notice_window_days?: number;
2057
+ provider_refund_access?: string;
2058
+ arrears_grace_days?: number;
2059
+ arrears_delinquency_floor?: string;
2060
+ psp_routing?: PSPRoutingRule[];
2061
+ dunning_policy?: DunningPolicy;
2062
+ payment_page?: MerchantPaymentPageSettings;
2063
+ balance_notices?: BalanceNoticeSettings;
2064
+ card_custody?: "hosted" | "merchant" | "platform";
2065
+ billing_policies?: BillingPolicy[];
2066
+ billing_policy_bindings?: BillingPolicyBinding[];
2067
+ delegated_invoker_wasted_spend_limits?: BudgetWindow[];
2033
2068
  };
2034
2069
  export type UpdatePSPParams = {
2035
2070
  expected_revision?: number | null;
2036
- settings?: Record<string, unknown> | null;
2071
+ tokenization_key?: string;
2072
+ publishable_key?: string;
2037
2073
  credentials?: Record<string, string> | null;
2038
2074
  retire_webhook_overlap?: boolean;
2039
2075
  archived?: boolean;
@@ -375,7 +375,7 @@ export declare const orderSchema: z.ZodObject<{
375
375
  settled_at?: string | null | undefined;
376
376
  }[] | null | undefined>>;
377
377
  status: z.ZodString;
378
- number: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
+ number: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
379
379
  currency: z.ZodString;
380
380
  total: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
381
381
  lines: z.ZodArray<z.ZodObject<{
@@ -413,17 +413,20 @@ export declare const orderSchema: z.ZodObject<{
413
413
  psp_id: z.ZodString;
414
414
  rail: z.ZodString;
415
415
  accepts: z.ZodArray<z.ZodString>;
416
- fallback: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
416
+ saved_payment_method_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
417
+ failed_attempts: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number, number | null | undefined>>;
417
418
  }, z.core.$strip>>>>, z.ZodTransform<{
418
419
  psp_id: string;
419
420
  rail: string;
420
421
  accepts: string[];
421
- fallback: boolean;
422
+ failed_attempts: number;
423
+ saved_payment_method_ids?: string[] | undefined;
422
424
  }[], {
423
425
  psp_id: string;
424
426
  rail: string;
425
427
  accepts: string[];
426
- fallback: boolean;
428
+ failed_attempts: number;
429
+ saved_payment_method_ids?: string[] | undefined;
427
430
  }[] | null | undefined>>;
428
431
  pay_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
429
432
  pay_url_expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -517,17 +520,20 @@ export declare const cartSchema: z.ZodObject<{
517
520
  psp_id: z.ZodString;
518
521
  rail: z.ZodString;
519
522
  accepts: z.ZodArray<z.ZodString>;
520
- fallback: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
523
+ saved_payment_method_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
524
+ failed_attempts: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number, number | null | undefined>>;
521
525
  }, z.core.$strip>>>>, z.ZodTransform<{
522
526
  psp_id: string;
523
527
  rail: string;
524
528
  accepts: string[];
525
- fallback: boolean;
529
+ failed_attempts: number;
530
+ saved_payment_method_ids?: string[] | undefined;
526
531
  }[], {
527
532
  psp_id: string;
528
533
  rail: string;
529
534
  accepts: string[];
530
- fallback: boolean;
535
+ failed_attempts: number;
536
+ saved_payment_method_ids?: string[] | undefined;
531
537
  }[] | null | undefined>>;
532
538
  last_changed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
533
539
  expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -147,12 +147,12 @@ var d = e.object({
147
147
  "elements"
148
148
  ]);
149
149
  function m(e) {
150
- let t = e.filter((e) => !!e.status && e.custodian === "psp" && p.has(e.flow)).map((e) => e.retry_after ?? 30);
150
+ let t = e.filter((e) => !!e.status && (e.custodian === "psp" || e.custodian === "platform" && e.rail === "nmi") && p.has(e.flow)).map((e) => e.retry_after ?? 30);
151
151
  return t.length > 0 ? Math.min(...t) : null;
152
152
  }
153
153
  var h = (e) => !!e && !e.startsWith("preview_"), g = (e) => e.rail === "stripe" && !!e.config?.publishable_key?.startsWith("pk_");
154
154
  function _(e) {
155
- return e.custodian !== "psp" || e.status ? null : e.flow === "card" && e.rail === "nmi" ? "card" : e.flow === "tokenize" && h(e.config?.tokenization_key) && e.config?.tokenization_url ? "collect_js" : g(e) ? "stripe_elements" : null;
155
+ return e.status ? null : e.custodian === "platform" ? e.rail === "nmi" && e.flow === "tokenize" && h(e.config?.public_api_key) ? "platform" : null : e.custodian === "psp" ? e.flow === "card" && e.rail === "nmi" ? "card" : e.flow === "tokenize" && h(e.config?.tokenization_key) && e.config?.tokenization_url ? "collect_js" : g(e) ? "stripe_elements" : null : null;
156
156
  }
157
157
  var v = (e) => _(e) !== null, y = (e) => _(e) === "stripe_elements", b = -(1n << 63n), x = (1n << 63n) - 1n;
158
158
  function S(e) {
@@ -391,7 +391,7 @@ var k = e.string().refine(C, "amount must be an int64 string"), A = e.string(),
391
391
  settled_at: A.nullish()
392
392
  })).nullish().transform((e) => e ?? []),
393
393
  status: e.string(),
394
- number: e.string().nullish(),
394
+ number: e.number().int().nullish(),
395
395
  currency: e.string(),
396
396
  total: k,
397
397
  lines: e.array(z),
@@ -406,7 +406,8 @@ var k = e.string().refine(C, "amount must be an int64 string"), A = e.string(),
406
406
  psp_id: e.string(),
407
407
  rail: e.string(),
408
408
  accepts: e.array(e.string()),
409
- fallback: e.boolean().nullish().transform((e) => e ?? !1)
409
+ saved_payment_method_ids: e.array(e.string()).optional(),
410
+ failed_attempts: e.number().nullish().transform((e) => e ?? 0)
410
411
  })).nullish().transform((e) => e ?? []),
411
412
  pay_url: e.string().nullish(),
412
413
  pay_url_expires_at: A.nullish(),
@@ -985,4 +986,4 @@ var $ = (e) => e instanceof X || e instanceof Error && e.name === "WalletRejecte
985
986
  //#endregion
986
987
  export { o as A, u as C, r as D, n as E, i as O, f as S, t as T, y as _, De as a, _ as b, Ce as c, T as d, te as f, C as g, O as h, X as i, a as k, Y as l, re as m, be as n, Se as o, ne as p, we as r, $ as s, xe as t, J as u, v, c as w, d as x, m as y };
987
988
 
988
- //# sourceMappingURL=client-imFR1UCe.js.map
989
+ //# sourceMappingURL=client-B301IAQD.js.map