@openrails/billing-ui 0.237.0 → 0.239.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 +57 -9
- package/README.md +48 -19
- package/dist/account/payment-methods-panel.d.ts +1 -1
- package/dist/authenticate.d.ts +5 -4
- package/dist/buy-button.d.ts +4 -2
- package/dist/client/client.d.ts +47 -13
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +64 -32
- package/dist/client/generated/wire.d.ts +29 -15
- package/dist/client/index.d.ts +3 -2
- package/dist/client/token-source.d.ts +60 -0
- package/dist/client/types.d.ts +75 -66
- package/dist/{client-D9G1Tgox.js → client-DgIsTx7x.js} +215 -145
- package/dist/client-DgIsTx7x.js.map +1 -0
- package/dist/client.js +2 -2
- package/dist/{hooks-DYepYVMX.js → hooks-DivfikJv.js} +99 -90
- package/dist/hooks-DivfikJv.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +989 -984
- package/dist/index.js.map +1 -1
- package/dist/offers.d.ts +6 -4
- package/dist/react/config.d.ts +17 -12
- package/dist/react/context.d.ts +3 -1
- package/dist/react/hooks.d.ts +5 -5
- package/dist/react/index.d.ts +1 -1
- package/dist/react.js +2 -2
- package/docs/payment-form-contract.md +1 -1
- package/package.json +1 -1
- package/dist/client-D9G1Tgox.js.map +0 -1
- package/dist/hooks-DYepYVMX.js.map +0 -1
|
@@ -2,6 +2,29 @@ export type ListPage<T> = {
|
|
|
2
2
|
data: T[];
|
|
3
3
|
next_cursor: string | null;
|
|
4
4
|
};
|
|
5
|
+
export type Agreement = {
|
|
6
|
+
id: string;
|
|
7
|
+
kind: "card_on_file" | "recurring" | "unscheduled";
|
|
8
|
+
status: "active" | "ended" | "requires_reconsent" | "revoked";
|
|
9
|
+
currency: string;
|
|
10
|
+
payment_method_id: string | null;
|
|
11
|
+
card: CardDetails | null;
|
|
12
|
+
subscription: AgreementSubscription | null;
|
|
13
|
+
accepted_at: string;
|
|
14
|
+
ended_at: string | null;
|
|
15
|
+
};
|
|
16
|
+
export type AgreementRevocation = {
|
|
17
|
+
agreement: Agreement;
|
|
18
|
+
subscription: Subscription | null;
|
|
19
|
+
usage_order: Order | null;
|
|
20
|
+
};
|
|
21
|
+
export type AgreementSubscription = {
|
|
22
|
+
id: string;
|
|
23
|
+
product: string;
|
|
24
|
+
amount: string;
|
|
25
|
+
billing_interval_hours: number | null;
|
|
26
|
+
next_charge_at: string | null;
|
|
27
|
+
};
|
|
5
28
|
export type Balance = {
|
|
6
29
|
customer_id: string;
|
|
7
30
|
currency: string;
|
|
@@ -120,6 +143,10 @@ export type CustomerChangeSubscriptionParams = {
|
|
|
120
143
|
quantity?: number | null;
|
|
121
144
|
signature?: string;
|
|
122
145
|
};
|
|
146
|
+
export type CustomerConfig = {
|
|
147
|
+
payment: PaymentConfig;
|
|
148
|
+
merchant: PublicMerchant;
|
|
149
|
+
};
|
|
123
150
|
export type CustomerEntitlement = {
|
|
124
151
|
customer_id: string;
|
|
125
152
|
entitlement: string;
|
|
@@ -442,15 +469,10 @@ export type PaymentMethodSubscription = {
|
|
|
442
469
|
display_name: string;
|
|
443
470
|
created_at: string;
|
|
444
471
|
};
|
|
445
|
-
export type PaymentOperation = {
|
|
446
|
-
id: string;
|
|
447
|
-
status: string;
|
|
448
|
-
};
|
|
449
472
|
export type PaymentRecovery = {
|
|
450
473
|
last_failure_reason?: string;
|
|
451
474
|
retryable: boolean;
|
|
452
475
|
blocked_reason?: string;
|
|
453
|
-
operation?: PaymentOperation;
|
|
454
476
|
order_id?: string;
|
|
455
477
|
};
|
|
456
478
|
export type PendingAction = {
|
|
@@ -516,8 +538,6 @@ export type PublicConfig = {
|
|
|
516
538
|
capabilities: Capabilities;
|
|
517
539
|
currencies: CurrencyUnits[];
|
|
518
540
|
rails: RailDefinition[];
|
|
519
|
-
payment: PaymentConfig | null;
|
|
520
|
-
merchant: PublicMerchant | null;
|
|
521
541
|
captcha: CaptchaConfig | null;
|
|
522
542
|
network: PublicNetwork | null;
|
|
523
543
|
};
|
|
@@ -589,12 +609,6 @@ export type SolanaPaymentToken = {
|
|
|
589
609
|
preferred: boolean;
|
|
590
610
|
recurring_eligible: boolean;
|
|
591
611
|
};
|
|
592
|
-
export type StripeEngineAuthentication = {
|
|
593
|
-
operation: PaymentOperation;
|
|
594
|
-
payment_intent_id?: string;
|
|
595
|
-
client_secret?: string;
|
|
596
|
-
provider_payment_method_id?: string;
|
|
597
|
-
};
|
|
598
612
|
export type StripePortalSession = {
|
|
599
613
|
url: string;
|
|
600
614
|
};
|
|
@@ -659,7 +673,6 @@ export type SubscriptionChange = {
|
|
|
659
673
|
amount_due_now: string;
|
|
660
674
|
next_charge_amount: string;
|
|
661
675
|
next_charge_date?: string;
|
|
662
|
-
operation_id?: string;
|
|
663
676
|
};
|
|
664
677
|
export type SubscriptionChangePreview = {
|
|
665
678
|
effective: string;
|
|
@@ -683,7 +696,7 @@ export type SubscriptionDunning = {
|
|
|
683
696
|
};
|
|
684
697
|
export type SubscriptionRetryNowResult = {
|
|
685
698
|
subscription: Subscription;
|
|
686
|
-
|
|
699
|
+
status: string;
|
|
687
700
|
replayed: boolean;
|
|
688
701
|
};
|
|
689
702
|
export type UpdatePaymentMethodParams = {
|
|
@@ -699,6 +712,7 @@ export type Usage = {
|
|
|
699
712
|
to: string;
|
|
700
713
|
group_by: "event_type" | "invoker" | "resource";
|
|
701
714
|
rows: UsageRow[];
|
|
715
|
+
next_cursor: string | null;
|
|
702
716
|
};
|
|
703
717
|
export type UsageRow = {
|
|
704
718
|
key: string;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type ProductListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, } from './client';
|
|
1
|
+
export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type ProductListOptions, type SendSolanaTransaction, type SubscriptionChangeInput, type UsageOptions, } from './client';
|
|
2
|
+
export { redeemAssertion, tokenSource, type RedeemAssertionOptions, type TokenResponse, type TokenSource, type TokenSourceOptions, } from './token-source';
|
|
2
3
|
export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, type BillingErrorBody, } from './errors';
|
|
3
|
-
export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, NetworkLinkChallenge, NewCard, NextAction, Order, OrderLine, OrderLineRefusal,
|
|
4
|
+
export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerLink, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, NetworkLinkChallenge, NewCard, NextAction, Order, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangePreview, Usage, UsageRow, } from './types';
|
|
4
5
|
export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** A token endpoint's answer (RFC 6749 §5.1). */
|
|
2
|
+
export interface TokenResponse {
|
|
3
|
+
access_token: string;
|
|
4
|
+
/** Seconds until the token expires. */
|
|
5
|
+
expires_in: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TokenSourceOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Asks the host for the customer's access token: one bound to the
|
|
10
|
+
* merchant, from the host's own backend or `redeemAssertion`.
|
|
11
|
+
*/
|
|
12
|
+
fetchToken: () => Promise<TokenResponse>;
|
|
13
|
+
/** Seconds before its expiry at which a token is replaced. Default 60. */
|
|
14
|
+
skew?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A `getToken` for `createBillingClient`: the current token, fetched when
|
|
18
|
+
* there is none or the cached one is about to expire.
|
|
19
|
+
*/
|
|
20
|
+
export interface TokenSource {
|
|
21
|
+
(): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Drops the cached token, so the next call fetches a new one. With
|
|
24
|
+
* `token`, only when that is the one cached.
|
|
25
|
+
*/
|
|
26
|
+
invalidate(token?: string): void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Keeps the customer's access token for a billing client: it caches the
|
|
30
|
+
* token until `skew` seconds before it expires and fetches the next one with
|
|
31
|
+
* a single request, however many calls are waiting. A failed fetch is not
|
|
32
|
+
* cached. Tokens stay in memory, never in browser storage, so a reload
|
|
33
|
+
* fetches again. The client retries a call answered 401 `credential_expired`
|
|
34
|
+
* once with a new token.
|
|
35
|
+
*/
|
|
36
|
+
export declare function tokenSource({ fetchToken, skew, }: TokenSourceOptions): TokenSource;
|
|
37
|
+
/** Whether `getToken` is a `tokenSource`, whose token the client can replace. */
|
|
38
|
+
export declare const isTokenSource: (getToken: unknown) => getToken is TokenSource;
|
|
39
|
+
export interface RedeemAssertionOptions {
|
|
40
|
+
/** The authorization server's token endpoint, such as `https://billing.example/oauth2/token`. */
|
|
41
|
+
tokenEndpoint: string;
|
|
42
|
+
/**
|
|
43
|
+
* The assertion the merchant's backend signed for this customer (RFC
|
|
44
|
+
* 7523): single use and minutes long, so redeem each one once.
|
|
45
|
+
*/
|
|
46
|
+
assertion: string;
|
|
47
|
+
/**
|
|
48
|
+
* Transport. Pass a fetch that adds a DPoP proof (auth-ui's `dpopFetch`)
|
|
49
|
+
* to bind the token to the browser's key.
|
|
50
|
+
*/
|
|
51
|
+
fetch?: (input: string, init: RequestInit) => Promise<Response>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Redeems a customer assertion for an access token to OpenRails
|
|
55
|
+
* (`scope=openrails:self`): a `fetchToken` for `tokenSource`, after the
|
|
56
|
+
* host's backend signed the assertion.
|
|
57
|
+
*/
|
|
58
|
+
export declare function redeemAssertion(options: RedeemAssertionOptions): Promise<TokenResponse & {
|
|
59
|
+
token_type: string;
|
|
60
|
+
}>;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare const pspLinkStateSchema: z.ZodObject<{
|
|
|
35
35
|
sync_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
/**
|
|
38
|
-
* A catalog price, embedded in a product (`GET /
|
|
38
|
+
* A catalog price, embedded in a product (`GET /products`): `unit_amount` of
|
|
39
39
|
* `currency` for `access_duration_hours` of access (null: for good),
|
|
40
40
|
* charging every `billing_interval_hours` (null: one-time).
|
|
41
41
|
*/
|
|
@@ -82,33 +82,27 @@ export declare const cardSummarySchema: z.ZodObject<{
|
|
|
82
82
|
exp_year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
84
|
export type CardSummary = z.infer<typeof cardSummarySchema>;
|
|
85
|
-
export declare const paymentOperationSchema: z.ZodObject<{
|
|
86
|
-
id: z.ZodString;
|
|
87
|
-
status: z.ZodString;
|
|
88
|
-
}, z.core.$strip>;
|
|
89
|
-
export type PaymentOperation = z.infer<typeof paymentOperationSchema>;
|
|
90
85
|
export declare const paymentRecoverySchema: z.ZodObject<{
|
|
91
86
|
last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
92
87
|
retryable: z.ZodBoolean;
|
|
93
88
|
blocked_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
94
|
-
operation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
95
|
-
id: z.ZodString;
|
|
96
|
-
status: z.ZodString;
|
|
97
|
-
}, z.core.$strip>>>;
|
|
98
89
|
order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
90
|
}, z.core.$strip>;
|
|
100
91
|
export type PaymentRecovery = z.infer<typeof paymentRecoverySchema>;
|
|
101
92
|
/**
|
|
102
|
-
*
|
|
103
|
-
* `
|
|
104
|
-
*
|
|
93
|
+
* What the customer completes before an action or payment can finish:
|
|
94
|
+
* `authenticate` runs the PSP's own script with `payload` (Stripe.js
|
|
95
|
+
* `handleNextAction` with `client_secret`), then the payable is confirmed;
|
|
96
|
+
* `redirect_to_url` leaves for `url`; with `solana_sign_transactions` the
|
|
97
|
+
* wallet signs and sends `transactions` in order and the action is repeated
|
|
98
|
+
* with the last signature.
|
|
105
99
|
*/
|
|
106
100
|
export declare const nextActionSchema: z.ZodObject<{
|
|
107
101
|
type: z.ZodString;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, z.core.$strip>>>;
|
|
102
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
104
|
transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
105
|
+
payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
112
106
|
}, z.core.$strip>;
|
|
113
107
|
export type NextAction = z.infer<typeof nextActionSchema>;
|
|
114
108
|
/**
|
|
@@ -242,18 +236,14 @@ export declare const subscriptionSchema: z.ZodObject<{
|
|
|
242
236
|
last_failure_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
237
|
retryable: z.ZodBoolean;
|
|
244
238
|
blocked_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
-
operation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
246
|
-
id: z.ZodString;
|
|
247
|
-
status: z.ZodString;
|
|
248
|
-
}, z.core.$strip>>>;
|
|
249
239
|
order_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
240
|
}, z.core.$strip>>>;
|
|
251
241
|
next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
252
242
|
type: z.ZodString;
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}, z.core.$strip>>>;
|
|
243
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
244
|
+
psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
245
|
transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
246
|
+
payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
257
247
|
}, z.core.$strip>>>;
|
|
258
248
|
created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
259
249
|
updated_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -326,19 +316,6 @@ export declare const paymentFailureSchema: z.ZodObject<{
|
|
|
326
316
|
field: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
327
317
|
}, z.core.$strip>;
|
|
328
318
|
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
319
|
/**
|
|
343
320
|
* One line of an order. A purchased line names its price and product; a
|
|
344
321
|
* usage order's line names its accrual source (`metered:<meter>`) instead.
|
|
@@ -740,6 +717,37 @@ export declare const accountSchema: z.ZodObject<{
|
|
|
740
717
|
unread_notifications: z.ZodNumber;
|
|
741
718
|
}, z.core.$strip>;
|
|
742
719
|
export type Account = z.infer<typeof accountSchema>;
|
|
720
|
+
/**
|
|
721
|
+
* One group of a usage report: its events and their total `amount`.
|
|
722
|
+
* `dimensions` are the summed event dimensions when grouped by event type.
|
|
723
|
+
*/
|
|
724
|
+
export declare const usageRowSchema: z.ZodObject<{
|
|
725
|
+
key: z.ZodString;
|
|
726
|
+
event_count: z.ZodNumber;
|
|
727
|
+
amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
728
|
+
dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
729
|
+
}, z.core.$strip>;
|
|
730
|
+
export type UsageRow = z.infer<typeof usageRowSchema>;
|
|
731
|
+
/**
|
|
732
|
+
* One page of the customer's usage in `currency` over [`from`, `to`): its
|
|
733
|
+
* groups by total amount, largest first, then by key. `next_cursor` reads the
|
|
734
|
+
* next page; null on the last.
|
|
735
|
+
*/
|
|
736
|
+
export declare const usageSchema: z.ZodObject<{
|
|
737
|
+
customer_id: z.ZodString;
|
|
738
|
+
currency: z.ZodString;
|
|
739
|
+
from: z.ZodString;
|
|
740
|
+
to: z.ZodString;
|
|
741
|
+
group_by: z.ZodString;
|
|
742
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
743
|
+
key: z.ZodString;
|
|
744
|
+
event_count: z.ZodNumber;
|
|
745
|
+
amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
746
|
+
dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
747
|
+
}, z.core.$strip>>;
|
|
748
|
+
next_cursor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
|
|
749
|
+
}, z.core.$strip>;
|
|
750
|
+
export type Usage = z.infer<typeof usageSchema>;
|
|
743
751
|
/** Currency code (upper case) to its native-unit scale. */
|
|
744
752
|
export type CurrencyScales = Readonly<Record<string, number>>;
|
|
745
753
|
export declare const currencySchema: z.ZodObject<{
|
|
@@ -769,10 +777,10 @@ export declare const subscriptionChangeSchema: z.ZodObject<{
|
|
|
769
777
|
subscription_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
770
778
|
next_action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
771
779
|
type: z.ZodString;
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
}, z.core.$strip>>>;
|
|
780
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
781
|
+
psp_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
775
782
|
transactions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
783
|
+
payload: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
776
784
|
}, z.core.$strip>>>;
|
|
777
785
|
delayed_start: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
778
786
|
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -780,7 +788,6 @@ export declare const subscriptionChangeSchema: z.ZodObject<{
|
|
|
780
788
|
next_charge_amount: z.ZodOptional<z.ZodNullable<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>>>;
|
|
781
789
|
next_charge_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
782
790
|
message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
783
|
-
operation_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
784
791
|
}, z.core.$strip>;
|
|
785
792
|
export type SubscriptionChange = z.infer<typeof subscriptionChangeSchema>;
|
|
786
793
|
/**
|
|
@@ -865,12 +872,6 @@ export declare const captchaConfigSchema: z.ZodObject<{
|
|
|
865
872
|
token_header: z.ZodString;
|
|
866
873
|
}, z.core.$strip>;
|
|
867
874
|
export type CaptchaConfig = z.infer<typeof captchaConfigSchema>;
|
|
868
|
-
/**
|
|
869
|
-
* What a browser needs to know about the deployment and its merchant
|
|
870
|
-
* (`GET /config`): the mount's capabilities, the currency registry, the
|
|
871
|
-
* merchant's payment setup (null when the request resolves no merchant) and
|
|
872
|
-
* the captcha (null when the deployment challenges nobody).
|
|
873
|
-
*/
|
|
874
875
|
/** The merchant as its customers see it; logo and support are https. */
|
|
875
876
|
export declare const publicMerchantSchema: z.ZodObject<{
|
|
876
877
|
display_name: z.ZodString;
|
|
@@ -879,6 +880,11 @@ export declare const publicMerchantSchema: z.ZodObject<{
|
|
|
879
880
|
embed_origins: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
880
881
|
}, z.core.$strip>;
|
|
881
882
|
export type PublicMerchant = z.infer<typeof publicMerchantSchema>;
|
|
883
|
+
/**
|
|
884
|
+
* What any browser needs to know about the deployment (`GET /config`, no
|
|
885
|
+
* credential): the mount's capabilities, the currency registry and the
|
|
886
|
+
* captcha (null when the deployment challenges nobody).
|
|
887
|
+
*/
|
|
882
888
|
export declare const publicConfigSchema: z.ZodObject<{
|
|
883
889
|
capabilities: z.ZodObject<{
|
|
884
890
|
route_groups: z.ZodRecord<z.ZodString, z.ZodBoolean>;
|
|
@@ -897,7 +903,25 @@ export declare const publicConfigSchema: z.ZodObject<{
|
|
|
897
903
|
decimals: number;
|
|
898
904
|
minor_decimals?: number | null | undefined;
|
|
899
905
|
}[] | null | undefined>>;
|
|
900
|
-
|
|
906
|
+
captcha: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
907
|
+
provider: z.ZodString;
|
|
908
|
+
site_key: z.ZodString;
|
|
909
|
+
script_url: z.ZodString;
|
|
910
|
+
action: z.ZodString;
|
|
911
|
+
token_header: z.ZodString;
|
|
912
|
+
}, z.core.$strip>>>;
|
|
913
|
+
network: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
914
|
+
issuer: z.ZodString;
|
|
915
|
+
client_id: z.ZodString;
|
|
916
|
+
}, z.core.$strip>>>;
|
|
917
|
+
}, z.core.$strip>;
|
|
918
|
+
export type PublicConfig = z.infer<typeof publicConfigSchema>;
|
|
919
|
+
/**
|
|
920
|
+
* What a customer's browser needs to know about the merchant it pays
|
|
921
|
+
* (`GET /me/config`): its payment setup and how it presents itself.
|
|
922
|
+
*/
|
|
923
|
+
export declare const customerConfigSchema: z.ZodObject<{
|
|
924
|
+
payment: z.ZodObject<{
|
|
901
925
|
psps: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
902
926
|
psp_id: z.ZodString;
|
|
903
927
|
key: z.ZodString;
|
|
@@ -959,26 +983,15 @@ export declare const publicConfigSchema: z.ZodObject<{
|
|
|
959
983
|
recurring_eligible?: boolean | null | undefined;
|
|
960
984
|
}[] | null | undefined>>;
|
|
961
985
|
}, z.core.$strip>>>;
|
|
962
|
-
}, z.core.$strip
|
|
963
|
-
merchant: z.
|
|
986
|
+
}, z.core.$strip>;
|
|
987
|
+
merchant: z.ZodObject<{
|
|
964
988
|
display_name: z.ZodString;
|
|
965
989
|
logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
966
990
|
support_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
967
991
|
embed_origins: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
|
|
968
|
-
}, z.core.$strip
|
|
969
|
-
captcha: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
970
|
-
provider: z.ZodString;
|
|
971
|
-
site_key: z.ZodString;
|
|
972
|
-
script_url: z.ZodString;
|
|
973
|
-
action: z.ZodString;
|
|
974
|
-
token_header: z.ZodString;
|
|
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>>>;
|
|
992
|
+
}, z.core.$strip>;
|
|
980
993
|
}, z.core.$strip>;
|
|
981
|
-
export type
|
|
994
|
+
export type CustomerConfig = z.infer<typeof customerConfigSchema>;
|
|
982
995
|
export declare const networkLinkChallengeSchema: z.ZodObject<{
|
|
983
996
|
id: z.ZodString;
|
|
984
997
|
nonce: z.ZodString;
|
|
@@ -997,10 +1010,6 @@ export declare const customerLinkSchema: z.ZodObject<{
|
|
|
997
1010
|
revoked_by: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
998
1011
|
}, z.core.$strip>;
|
|
999
1012
|
export type CustomerLink = z.infer<typeof customerLinkSchema>;
|
|
1000
|
-
export declare const paymentAuthenticationSchema: z.ZodObject<{
|
|
1001
|
-
client_secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1002
|
-
}, z.core.$strip>;
|
|
1003
|
-
export type PaymentAuthentication = z.infer<typeof paymentAuthenticationSchema>;
|
|
1004
1013
|
/**
|
|
1005
1014
|
* What a card setup hands the server: tokenized data only, never a PAN.
|
|
1006
1015
|
* OpenRails reads the saved card's brand, last four and expiry from the PSP.
|