@openrails/billing-ui 0.234.0 → 0.235.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -2
- package/README.md +18 -14
- package/dist/account/account-billing.d.ts +6 -3
- package/dist/account/change-card-dialog.d.ts +5 -2
- package/dist/account/payment-methods-panel.d.ts +6 -3
- package/dist/client/client.d.ts +28 -17
- package/dist/client/errors.d.ts +1 -4
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +42 -28
- package/dist/client/generated/wire.d.ts +100 -35
- package/dist/client/index.d.ts +2 -2
- package/dist/client/types.d.ts +42 -12
- package/dist/{client-CWX6QpLa.js → client-BpzCZes3.js} +45 -34
- package/dist/client-BpzCZes3.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{config-DZ97SQG2.js → config-qLcHvK0Q.js} +13 -13
- package/dist/config-qLcHvK0Q.js.map +1 -0
- package/dist/i18n/context.d.ts +1 -1
- package/dist/i18n/messages.d.ts +1 -1
- package/dist/index.js +184 -177
- package/dist/index.js.map +1 -1
- package/dist/locales/de.js +5 -4
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +5 -4
- package/dist/locales/en.js +5 -4
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +5 -4
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +5 -4
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +5 -4
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +5 -4
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/context.d.ts +6 -5
- package/dist/react/hooks.d.ts +10 -10
- package/dist/react.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/dist/client-CWX6QpLa.js.map +0 -1
- package/dist/config-DZ97SQG2.js.map +0 -1
|
@@ -42,6 +42,13 @@ export type Capabilities = {
|
|
|
42
42
|
route_groups: Record<string, boolean> | null;
|
|
43
43
|
features: Record<string, boolean> | null;
|
|
44
44
|
};
|
|
45
|
+
export type CaptchaConfig = {
|
|
46
|
+
provider: string;
|
|
47
|
+
site_key: string;
|
|
48
|
+
script_url: string;
|
|
49
|
+
action: string;
|
|
50
|
+
token_header: string;
|
|
51
|
+
};
|
|
45
52
|
export type CaptchaStatus = {
|
|
46
53
|
enabled: boolean;
|
|
47
54
|
required: boolean;
|
|
@@ -61,9 +68,6 @@ export type CardEntry = {
|
|
|
61
68
|
exp_year?: number;
|
|
62
69
|
cvc?: string;
|
|
63
70
|
};
|
|
64
|
-
export type ChangeTierParams = {
|
|
65
|
-
price_id?: string;
|
|
66
|
-
};
|
|
67
71
|
export type CheckoutSession = {
|
|
68
72
|
id: string;
|
|
69
73
|
status: string;
|
|
@@ -129,10 +133,6 @@ export type CheckoutSessionSavedMethod = {
|
|
|
129
133
|
rail: string;
|
|
130
134
|
card: CardDetails | null;
|
|
131
135
|
};
|
|
132
|
-
export type CollectionPaymentMethod = {
|
|
133
|
-
currency: string;
|
|
134
|
-
payment_method_id: string;
|
|
135
|
-
};
|
|
136
136
|
export type CreateOrderParams = {
|
|
137
137
|
lines?: OrderLineParams[];
|
|
138
138
|
expected_total?: string;
|
|
@@ -158,7 +158,7 @@ export type CurrencyUnits = {
|
|
|
158
158
|
export type CustomerAccount = {
|
|
159
159
|
id: string;
|
|
160
160
|
balances: Balance[];
|
|
161
|
-
|
|
161
|
+
default_payment_methods: DefaultPaymentMethod[];
|
|
162
162
|
unread_notifications: number;
|
|
163
163
|
};
|
|
164
164
|
export type CustomerAmount = {
|
|
@@ -169,16 +169,23 @@ export type CustomerCancelSubscriptionParams = {
|
|
|
169
169
|
reason?: string;
|
|
170
170
|
signature?: string;
|
|
171
171
|
};
|
|
172
|
-
export type
|
|
173
|
-
price_id?: string;
|
|
172
|
+
export type CustomerChangeSubscriptionParams = {
|
|
173
|
+
price_id?: string | null;
|
|
174
|
+
quantity?: number | null;
|
|
174
175
|
signature?: string;
|
|
175
176
|
};
|
|
176
177
|
export type CustomerEntitlement = {
|
|
178
|
+
customer_id: string;
|
|
177
179
|
entitlement: string;
|
|
180
|
+
quantity: number | null;
|
|
178
181
|
};
|
|
179
182
|
export type CustomerNotificationLookup = {
|
|
180
183
|
notifications: Record<string, Notification | null> | null;
|
|
181
184
|
};
|
|
185
|
+
export type DefaultPaymentMethod = {
|
|
186
|
+
currency: string;
|
|
187
|
+
payment_method_id: string;
|
|
188
|
+
};
|
|
182
189
|
export type DriftField = {
|
|
183
190
|
field: string;
|
|
184
191
|
openrails_value: string;
|
|
@@ -243,8 +250,28 @@ export type InvoicePayNow = {
|
|
|
243
250
|
operation: PaymentOperation;
|
|
244
251
|
replayed: boolean;
|
|
245
252
|
};
|
|
253
|
+
export type Mandate = {
|
|
254
|
+
id: string;
|
|
255
|
+
customer_id: string;
|
|
256
|
+
payment_method_id: string | null;
|
|
257
|
+
psp_id: string;
|
|
258
|
+
kind: "card_on_file" | "recurring" | "unscheduled";
|
|
259
|
+
subscription_id: string | null;
|
|
260
|
+
currency: string | null;
|
|
261
|
+
status: "active" | "ended" | "requires_reconsent" | "revoked";
|
|
262
|
+
end_reason: "brand_changed" | "closed" | "customer_revoked" | "payment_method_removed" | "replaced" | "subscription_ended" | null;
|
|
263
|
+
ended_at: string | null;
|
|
264
|
+
card_brand: string | null;
|
|
265
|
+
initial_transaction_id: string | null;
|
|
266
|
+
network_transaction_id: string | null;
|
|
267
|
+
transaction_link_id: string | null;
|
|
268
|
+
storing_attempt_id: string | null;
|
|
269
|
+
accepted_at: string;
|
|
270
|
+
created_at: string;
|
|
271
|
+
};
|
|
246
272
|
export type MarkNotificationsReadParams = {
|
|
247
273
|
notification_ids?: string[];
|
|
274
|
+
all?: boolean;
|
|
248
275
|
};
|
|
249
276
|
export type MintCheckoutSessionParams = {
|
|
250
277
|
price_id?: string;
|
|
@@ -304,10 +331,14 @@ export type NotificationData = {
|
|
|
304
331
|
rail?: string;
|
|
305
332
|
rail_subscription_id?: string;
|
|
306
333
|
transaction_id?: string;
|
|
334
|
+
quantity?: number;
|
|
307
335
|
amount?: string;
|
|
308
336
|
product_name?: string;
|
|
309
337
|
payment_method?: string;
|
|
310
338
|
user_email?: string;
|
|
339
|
+
payment_id?: string;
|
|
340
|
+
order_id?: string;
|
|
341
|
+
order_number?: string;
|
|
311
342
|
};
|
|
312
343
|
export type Order = {
|
|
313
344
|
id: string;
|
|
@@ -425,6 +456,7 @@ export type Payment = {
|
|
|
425
456
|
subscription_id: string | null;
|
|
426
457
|
order_id: string | null;
|
|
427
458
|
invoice_id: string | null;
|
|
459
|
+
quantity: number | null;
|
|
428
460
|
price_id: string | null;
|
|
429
461
|
price: Price | null;
|
|
430
462
|
product: ProductSummary | null;
|
|
@@ -453,11 +485,16 @@ export type PaymentMethod = {
|
|
|
453
485
|
customer_id: string;
|
|
454
486
|
rail: string;
|
|
455
487
|
psp_id: string | null;
|
|
488
|
+
status: "active" | "closed" | "removed" | "replaced";
|
|
489
|
+
replaced_by: string | null;
|
|
456
490
|
card: CardDetails | null;
|
|
457
491
|
billing_details: BillingDetails | null;
|
|
458
492
|
health: PaymentMethodHealth;
|
|
493
|
+
contact_cardholder_at: string | null;
|
|
494
|
+
reusable: boolean;
|
|
495
|
+
mandates: Mandate[];
|
|
459
496
|
subscriptions: PaymentMethodSubscription[];
|
|
460
|
-
|
|
497
|
+
default_currencies: string[];
|
|
461
498
|
created_at: string;
|
|
462
499
|
};
|
|
463
500
|
export type PaymentMethodHealth = {
|
|
@@ -504,9 +541,15 @@ export type PortalResponse = {
|
|
|
504
541
|
export type PreviewOrderParams = {
|
|
505
542
|
lines?: OrderLineParams[];
|
|
506
543
|
};
|
|
544
|
+
export type PreviewSubscriptionChangeParams = {
|
|
545
|
+
price_id?: string | null;
|
|
546
|
+
quantity?: number | null;
|
|
547
|
+
};
|
|
507
548
|
export type Price = {
|
|
508
549
|
customer_amount?: CustomerAmount;
|
|
550
|
+
quantity: Quantity | null;
|
|
509
551
|
revision: number;
|
|
552
|
+
version: number;
|
|
510
553
|
id: string;
|
|
511
554
|
key: string;
|
|
512
555
|
product_id: string;
|
|
@@ -547,6 +590,7 @@ export type ProductAccessGrant = {
|
|
|
547
590
|
source_type: "grace" | "grant" | "purchase" | "subscription";
|
|
548
591
|
source_id: string;
|
|
549
592
|
payment_id: string | null;
|
|
593
|
+
quantity: number | null;
|
|
550
594
|
grant_reason: "comp" | "import" | "migration" | "staff" | null;
|
|
551
595
|
granted_by: string | null;
|
|
552
596
|
note: string | null;
|
|
@@ -570,7 +614,19 @@ export type ProductSummary = {
|
|
|
570
614
|
export type PublicConfig = {
|
|
571
615
|
capabilities: Capabilities;
|
|
572
616
|
currencies: CurrencyUnits[];
|
|
617
|
+
rails: RailDefinition[];
|
|
573
618
|
payment: PaymentConfig | null;
|
|
619
|
+
captcha: CaptchaConfig | null;
|
|
620
|
+
};
|
|
621
|
+
export type Quantity = {
|
|
622
|
+
min: number;
|
|
623
|
+
max: number;
|
|
624
|
+
};
|
|
625
|
+
export type RailDefinition = {
|
|
626
|
+
rail: "ccbill" | "nmi" | "solana" | "stripe";
|
|
627
|
+
display_name: string;
|
|
628
|
+
credential_keys: string[];
|
|
629
|
+
setting_keys: string[];
|
|
574
630
|
};
|
|
575
631
|
export type ReplacePaymentMethodCardParams = {
|
|
576
632
|
payment_token?: string;
|
|
@@ -590,9 +646,12 @@ export type ScheduledChange = {
|
|
|
590
646
|
price?: Price;
|
|
591
647
|
product?: ProductSummary;
|
|
592
648
|
};
|
|
593
|
-
export type
|
|
649
|
+
export type SetDefaultPaymentMethodParams = {
|
|
594
650
|
payment_method_id?: string;
|
|
595
651
|
};
|
|
652
|
+
export type SetSubscriptionPaymentMethodParams = {
|
|
653
|
+
payment_method_id?: string | null;
|
|
654
|
+
};
|
|
596
655
|
export type SolanaPayGetResponse = {
|
|
597
656
|
label: string;
|
|
598
657
|
icon: string;
|
|
@@ -645,18 +704,18 @@ export type Subscription = {
|
|
|
645
704
|
recovery?: PaymentRecovery;
|
|
646
705
|
dunning: SubscriptionDunning | null;
|
|
647
706
|
deletion_scheduled_at?: string;
|
|
648
|
-
payments?: Payment[];
|
|
649
707
|
id: string;
|
|
650
708
|
customer_id: string;
|
|
651
709
|
product_id: string;
|
|
652
710
|
price_id: string;
|
|
653
|
-
quantity: number;
|
|
711
|
+
quantity: number | null;
|
|
654
712
|
psp_id: string;
|
|
655
713
|
rail: string;
|
|
656
714
|
rail_subscription_id: string | null;
|
|
657
715
|
status: "active" | "awaiting_method" | "canceled" | "past_due" | "pending" | "unverified";
|
|
658
716
|
scheduled_change: ScheduledChange | null;
|
|
659
717
|
payment_method_id: string | null;
|
|
718
|
+
mandate_id: string | null;
|
|
660
719
|
started_at: string;
|
|
661
720
|
ended_at: string | null;
|
|
662
721
|
current_period_starts_at: string | null;
|
|
@@ -686,27 +745,11 @@ export type SubscriptionAccess = {
|
|
|
686
745
|
starts_at: string;
|
|
687
746
|
ends_at?: string;
|
|
688
747
|
};
|
|
689
|
-
export type
|
|
690
|
-
attempts: number;
|
|
691
|
-
retries_left: number | null;
|
|
692
|
-
next_retry_at: string | null;
|
|
693
|
-
final_retry_at: string | null;
|
|
694
|
-
waiting_for_new_card: boolean;
|
|
695
|
-
last_failure_reason: "authentication_required" | "blocked_by_psp" | "call_issuer" | "card_not_supported" | "communication_error" | "currency_not_supported" | "do_not_honor" | "duplicate_transaction" | "expired_card" | "fraudulent" | "gateway_rejected" | "generic_decline" | "incorrect_address" | "incorrect_cvc" | "incorrect_number" | "incorrect_zip" | "insufficient_funds" | "invalid_account" | "invalid_expiry" | "invalid_pin" | "invalid_request" | "issuer_unavailable" | "lost_card" | "merchant_config" | "no_such_issuer" | "over_limit" | "pickup_card" | "processing_error" | "restricted_card" | "retry_later" | "security_violation" | "stolen_card" | "stop_recurring" | "transaction_not_allowed" | "try_again_later" | "unknown" | "update_cardholder_data" | null;
|
|
696
|
-
};
|
|
697
|
-
export type SubscriptionRetryNowResult = {
|
|
698
|
-
subscription: Subscription;
|
|
699
|
-
operation: PaymentOperation;
|
|
700
|
-
replayed: boolean;
|
|
701
|
-
};
|
|
702
|
-
export type SupportedTokensResponse = {
|
|
703
|
-
tokens: TokenInfo[];
|
|
704
|
-
};
|
|
705
|
-
export type TierChange = {
|
|
748
|
+
export type SubscriptionChange = {
|
|
706
749
|
status: string;
|
|
707
|
-
action?: string;
|
|
708
750
|
effective?: string;
|
|
709
751
|
price_id: string;
|
|
752
|
+
quantity: number | null;
|
|
710
753
|
rail: string;
|
|
711
754
|
subscription_id?: string;
|
|
712
755
|
next_action?: NextAction;
|
|
@@ -719,18 +762,34 @@ export type TierChange = {
|
|
|
719
762
|
next_charge_date?: string;
|
|
720
763
|
operation_id?: string;
|
|
721
764
|
};
|
|
722
|
-
export type
|
|
723
|
-
|
|
765
|
+
export type SubscriptionChangePreview = {
|
|
766
|
+
effective: string;
|
|
724
767
|
price_id: string;
|
|
768
|
+
quantity: number | null;
|
|
725
769
|
rail: string;
|
|
726
770
|
currency: string;
|
|
727
771
|
amount_due_now: string;
|
|
728
772
|
next_charge_amount: string;
|
|
729
773
|
next_charge_date?: string;
|
|
730
|
-
effective: string;
|
|
731
774
|
is_estimate: boolean;
|
|
732
775
|
message?: string;
|
|
733
776
|
};
|
|
777
|
+
export type SubscriptionDunning = {
|
|
778
|
+
attempts: number;
|
|
779
|
+
retries_left: number | null;
|
|
780
|
+
next_retry_at: string | null;
|
|
781
|
+
final_retry_at: string | null;
|
|
782
|
+
waiting_for_new_card: boolean;
|
|
783
|
+
last_failure_reason: "authentication_required" | "blocked_by_psp" | "call_issuer" | "card_not_supported" | "communication_error" | "currency_not_supported" | "do_not_honor" | "duplicate_transaction" | "expired_card" | "fraudulent" | "gateway_rejected" | "generic_decline" | "incorrect_address" | "incorrect_cvc" | "incorrect_number" | "incorrect_zip" | "insufficient_funds" | "invalid_account" | "invalid_expiry" | "invalid_pin" | "invalid_request" | "issuer_unavailable" | "lost_card" | "merchant_config" | "no_such_issuer" | "over_limit" | "pickup_card" | "processing_error" | "restricted_card" | "retry_later" | "security_violation" | "stolen_card" | "stop_recurring" | "transaction_not_allowed" | "try_again_later" | "unknown" | "update_cardholder_data" | null;
|
|
784
|
+
};
|
|
785
|
+
export type SubscriptionRetryNowResult = {
|
|
786
|
+
subscription: Subscription;
|
|
787
|
+
operation: PaymentOperation;
|
|
788
|
+
replayed: boolean;
|
|
789
|
+
};
|
|
790
|
+
export type SupportedTokensResponse = {
|
|
791
|
+
tokens: TokenInfo[];
|
|
792
|
+
};
|
|
734
793
|
export type TokenBalance = {
|
|
735
794
|
amount: string;
|
|
736
795
|
units: string;
|
|
@@ -756,6 +815,12 @@ export type TokenQuote = {
|
|
|
756
815
|
quoted_at: string;
|
|
757
816
|
expires_at: string;
|
|
758
817
|
};
|
|
818
|
+
export type UpdatePaymentMethodParams = {
|
|
819
|
+
exp_month?: number;
|
|
820
|
+
exp_year?: number;
|
|
821
|
+
billing_details?: BillingDetails;
|
|
822
|
+
reusable?: boolean;
|
|
823
|
+
};
|
|
759
824
|
export type Usage = {
|
|
760
825
|
customer_id: string;
|
|
761
826
|
currency: string;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type CheckoutSourceOptions, type ListOptions, type SendSolanaTransaction, } from './client';
|
|
1
|
+
export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type CheckoutSourceOptions, type ListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, } from './client';
|
|
2
2
|
export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, type BillingErrorBody, } from './errors';
|
|
3
|
-
export type { Account, Balance, CardSetup, CardSummary, Currency, CurrencyScales, PaymentConfig, PublicConfig, CheckoutSessionLink, Invoice, ListPage, NewCard, NextAction, Page, Payment, PaymentAuthentication, PaymentMethod, PaymentOperation, PaymentRecovery, Price, Product, SolanaToken, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus,
|
|
3
|
+
export type { Account, Balance, CaptchaConfig, CardSetup, CardSummary, Currency, CurrencyScales, PaymentConfig, PublicConfig, CheckoutSessionLink, Invoice, ListPage, NewCard, NextAction, Page, Payment, PaymentAuthentication, PaymentMethod, PaymentOperation, PaymentRecovery, Price, Product, SolanaToken, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangePreview, } from './types';
|
|
4
4
|
export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
|
package/dist/client/types.d.ts
CHANGED
|
@@ -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>>;
|
|
@@ -130,7 +131,9 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
130
131
|
rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
132
|
product_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
133
|
price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
|
+
quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
133
135
|
psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
collection_policy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
134
137
|
payment_method_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
138
|
started_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
139
|
ended_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -158,6 +161,7 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
158
161
|
id: z.ZodString;
|
|
159
162
|
key: z.ZodString;
|
|
160
163
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
161
165
|
product_id: z.ZodString;
|
|
162
166
|
archived: z.ZodBoolean;
|
|
163
167
|
unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -196,6 +200,7 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
196
200
|
id: z.ZodString;
|
|
197
201
|
key: z.ZodString;
|
|
198
202
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
199
204
|
product_id: z.ZodString;
|
|
200
205
|
archived: z.ZodBoolean;
|
|
201
206
|
unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -301,7 +306,7 @@ export declare const paymentMethodSchema: z.ZodObject<{
|
|
|
301
306
|
id: z.ZodString;
|
|
302
307
|
display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
303
308
|
}, z.core.$strip>>>>;
|
|
304
|
-
|
|
309
|
+
default_currencies: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
305
310
|
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
311
|
}, z.core.$strip>;
|
|
307
312
|
export type PaymentMethod = z.infer<typeof paymentMethodSchema>;
|
|
@@ -326,6 +331,7 @@ export declare const productSchema: z.ZodObject<{
|
|
|
326
331
|
id: z.ZodString;
|
|
327
332
|
key: z.ZodString;
|
|
328
333
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
329
335
|
product_id: z.ZodString;
|
|
330
336
|
archived: z.ZodBoolean;
|
|
331
337
|
unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -359,6 +365,7 @@ export declare const productSchema: z.ZodObject<{
|
|
|
359
365
|
created_at: string;
|
|
360
366
|
updated_at: string;
|
|
361
367
|
revision?: number | undefined;
|
|
368
|
+
version?: number | undefined;
|
|
362
369
|
customer_amount?: {
|
|
363
370
|
min_amount: string;
|
|
364
371
|
max_amount: string;
|
|
@@ -382,6 +389,7 @@ export declare const productSchema: z.ZodObject<{
|
|
|
382
389
|
created_at: string;
|
|
383
390
|
updated_at: string;
|
|
384
391
|
revision?: number | undefined;
|
|
392
|
+
version?: number | undefined;
|
|
385
393
|
customer_amount?: {
|
|
386
394
|
min_amount: string;
|
|
387
395
|
max_amount: string;
|
|
@@ -412,6 +420,7 @@ export declare const paymentSchema: z.ZodObject<{
|
|
|
412
420
|
id: z.ZodString;
|
|
413
421
|
key: z.ZodString;
|
|
414
422
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
423
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
415
424
|
product_id: z.ZodString;
|
|
416
425
|
archived: z.ZodBoolean;
|
|
417
426
|
unit_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -465,8 +474,8 @@ export declare const balanceSchema: z.ZodObject<{
|
|
|
465
474
|
}, z.core.$strip>;
|
|
466
475
|
export type Balance = z.infer<typeof balanceSchema>;
|
|
467
476
|
/**
|
|
468
|
-
* The signed-in customer's summary (`GET /me`): money per currency, the
|
|
469
|
-
*
|
|
477
|
+
* The signed-in customer's summary (`GET /me`): money per currency, the
|
|
478
|
+
* default card of each currency, and how many notices are unread.
|
|
470
479
|
*/
|
|
471
480
|
export declare const accountSchema: z.ZodObject<{
|
|
472
481
|
id: z.ZodString;
|
|
@@ -478,7 +487,7 @@ export declare const accountSchema: z.ZodObject<{
|
|
|
478
487
|
available_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
479
488
|
owed_amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
480
489
|
}, z.core.$strip>>;
|
|
481
|
-
|
|
490
|
+
default_payment_methods: z.ZodArray<z.ZodObject<{
|
|
482
491
|
currency: z.ZodString;
|
|
483
492
|
payment_method_id: z.ZodString;
|
|
484
493
|
}, z.core.$strip>>;
|
|
@@ -519,9 +528,9 @@ export declare const currencySchema: z.ZodObject<{
|
|
|
519
528
|
minor_decimals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
520
529
|
}, z.core.$strip>;
|
|
521
530
|
export type Currency = z.infer<typeof currencySchema>;
|
|
522
|
-
export declare const
|
|
523
|
-
action: z.ZodString;
|
|
531
|
+
export declare const subscriptionChangePreviewSchema: z.ZodObject<{
|
|
524
532
|
price_id: z.ZodString;
|
|
533
|
+
quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
525
534
|
rail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
526
535
|
currency: z.ZodString;
|
|
527
536
|
amount_due_now: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -531,12 +540,12 @@ export declare const tierChangePreviewSchema: z.ZodObject<{
|
|
|
531
540
|
is_estimate: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
532
541
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
533
542
|
}, z.core.$strip>;
|
|
534
|
-
export type
|
|
535
|
-
export declare const
|
|
543
|
+
export type SubscriptionChangePreview = z.infer<typeof subscriptionChangePreviewSchema>;
|
|
544
|
+
export declare const subscriptionChangeSchema: z.ZodObject<{
|
|
536
545
|
status: z.ZodString;
|
|
537
|
-
action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
538
546
|
effective: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
539
547
|
price_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
548
|
+
quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
540
549
|
subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
541
550
|
next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
542
551
|
type: z.ZodString;
|
|
@@ -553,7 +562,7 @@ export declare const tierChangeSchema: z.ZodObject<{
|
|
|
553
562
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
554
563
|
operation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
555
564
|
}, z.core.$strip>;
|
|
556
|
-
export type
|
|
565
|
+
export type SubscriptionChange = z.infer<typeof subscriptionChangeSchema>;
|
|
557
566
|
export declare const solanaTokenSchema: z.ZodObject<{
|
|
558
567
|
symbol: z.ZodString;
|
|
559
568
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -716,10 +725,24 @@ export declare const paymentConfigSchema: z.ZodObject<{
|
|
|
716
725
|
}, z.core.$strip>>>;
|
|
717
726
|
}, z.core.$strip>;
|
|
718
727
|
export type PaymentConfig = z.infer<typeof paymentConfigSchema>;
|
|
728
|
+
/**
|
|
729
|
+
* The challenge to solve when a request answers 403 `captcha_required`: load
|
|
730
|
+
* `script_url`, solve with `site_key` and `action`, and resend the request
|
|
731
|
+
* with the token in the `token_header` header.
|
|
732
|
+
*/
|
|
733
|
+
export declare const captchaConfigSchema: z.ZodObject<{
|
|
734
|
+
provider: z.ZodString;
|
|
735
|
+
site_key: z.ZodString;
|
|
736
|
+
script_url: z.ZodString;
|
|
737
|
+
action: z.ZodString;
|
|
738
|
+
token_header: z.ZodString;
|
|
739
|
+
}, z.core.$strip>;
|
|
740
|
+
export type CaptchaConfig = z.infer<typeof captchaConfigSchema>;
|
|
719
741
|
/**
|
|
720
742
|
* What a browser needs to know about the deployment and its merchant
|
|
721
|
-
* (`GET /config`): the mount's capabilities, the currency registry
|
|
722
|
-
* merchant's payment setup (null when the request resolves no merchant)
|
|
743
|
+
* (`GET /config`): the mount's capabilities, the currency registry, the
|
|
744
|
+
* merchant's payment setup (null when the request resolves no merchant) and
|
|
745
|
+
* the captcha (null when the deployment challenges nobody).
|
|
723
746
|
*/
|
|
724
747
|
export declare const publicConfigSchema: z.ZodObject<{
|
|
725
748
|
capabilities: z.ZodObject<{
|
|
@@ -802,6 +825,13 @@ export declare const publicConfigSchema: z.ZodObject<{
|
|
|
802
825
|
}[] | null | undefined>>;
|
|
803
826
|
}, z.core.$strip>>>;
|
|
804
827
|
}, z.core.$strip>>>;
|
|
828
|
+
captcha: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
829
|
+
provider: z.ZodString;
|
|
830
|
+
site_key: z.ZodString;
|
|
831
|
+
script_url: z.ZodString;
|
|
832
|
+
action: z.ZodString;
|
|
833
|
+
token_header: z.ZodString;
|
|
834
|
+
}, z.core.$strip>>>;
|
|
805
835
|
}, z.core.$strip>;
|
|
806
836
|
export type PublicConfig = z.infer<typeof publicConfigSchema>;
|
|
807
837
|
/** An in-page card setup; `payment_method_id` is set once the card is saved. */
|