@openrails/billing-ui 0.0.0-stage → 0.233.2
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 +351 -0
- package/LICENSE +21 -0
- package/README.md +260 -2
- package/dist/account/account-billing.d.ts +19 -0
- package/dist/account/cancel-dialog.d.ts +18 -0
- package/dist/account/change-card-dialog.d.ts +14 -0
- package/dist/account/format.d.ts +25 -0
- package/dist/account/notice.d.ts +3 -0
- package/dist/account/payment-history.d.ts +8 -0
- package/dist/account/payment-methods-panel.d.ts +17 -0
- package/dist/account/section.d.ts +27 -0
- package/dist/account/status-badge.d.ts +8 -0
- package/dist/account/subscriptions-panel.d.ts +19 -0
- package/dist/appearance.d.ts +23 -0
- package/dist/authenticate.d.ts +8 -0
- package/dist/checkout-frame.d.ts +17 -0
- package/dist/checkout-page.d.ts +21 -0
- package/dist/checkout.d.ts +24 -0
- package/dist/client/client.d.ts +181 -0
- package/dist/client/errors.d.ts +26 -0
- package/dist/client/generated/currencies.d.ts +1 -0
- package/dist/client/generated/error-codes.d.ts +7 -0
- package/dist/client/generated/routes.d.ts +775 -0
- package/dist/client/generated/wire.d.ts +682 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/types.d.ts +800 -0
- package/dist/client-DXUPzA8C.js +889 -0
- package/dist/client-DXUPzA8C.js.map +1 -0
- package/dist/client.js +2 -0
- package/dist/components/billing-fields.d.ts +39 -0
- package/dist/components/card-brands.d.ts +6 -0
- package/dist/components/card-fields.d.ts +29 -0
- package/dist/components/ccbill-fields.d.ts +8 -0
- package/dist/components/methods.d.ts +13 -0
- package/dist/components/pay-button.d.ts +6 -0
- package/dist/components/qr.d.ts +6 -0
- package/dist/components/saved-methods.d.ts +9 -0
- package/dist/components/states.d.ts +10 -0
- package/dist/components/stripe-card.d.ts +17 -0
- package/dist/components/summary.d.ts +12 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/button.d.ts +8 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/config-BQELtBh4.js +341 -0
- package/dist/config-BQELtBh4.js.map +1 -0
- package/dist/dist-CslWupfi.js +3311 -0
- package/dist/dist-CslWupfi.js.map +1 -0
- package/dist/fixtures.d.ts +9 -0
- package/dist/frame.d.ts +47 -0
- package/dist/i18n/context.d.ts +4 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/messages.d.ts +58 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +4090 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/billing.d.ts +39 -0
- package/dist/lib/card-brands.d.ts +2 -0
- package/dist/lib/card-entry.d.ts +46 -0
- package/dist/lib/ccbill.d.ts +8 -0
- package/dist/lib/collect.d.ts +51 -0
- package/dist/lib/money.d.ts +10 -0
- package/dist/lib/period.d.ts +13 -0
- package/dist/lib/rail-meta.d.ts +15 -0
- package/dist/lib/redirect.d.ts +2 -0
- package/dist/lib/stripe-appearance.d.ts +2 -0
- package/dist/lib/stripe.d.ts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.js +207 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.d.ts +204 -0
- package/dist/locales/en.js +207 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/es.js +207 -0
- package/dist/locales/es.js.map +1 -0
- package/dist/locales/ja.d.ts +2 -0
- package/dist/locales/ja.js +198 -0
- package/dist/locales/ja.js.map +1 -0
- package/dist/locales/ko.d.ts +2 -0
- package/dist/locales/ko.js +198 -0
- package/dist/locales/ko.js.map +1 -0
- package/dist/locales/zh.d.ts +2 -0
- package/dist/locales/zh.js +198 -0
- package/dist/locales/zh.js.map +1 -0
- package/dist/modal.d.ts +12 -0
- package/dist/provider.d.ts +18 -0
- package/dist/psp.d.ts +35 -0
- package/dist/react/config.d.ts +34 -0
- package/dist/react/context.d.ts +35 -0
- package/dist/react/hooks.d.ts +82 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/provider.d.ts +10 -0
- package/dist/react/remote.d.ts +10 -0
- package/dist/react.js +33 -0
- package/dist/react.js.map +1 -0
- package/dist/save-payment-method.d.ts +26 -0
- package/dist/scope-context.d.ts +17 -0
- package/dist/scope.d.ts +6 -0
- package/dist/source.d.ts +5 -0
- package/dist/styles.css +3 -0
- package/dist/tokenized-card-form.d.ts +24 -0
- package/dist/types.d.ts +250 -0
- package/docs/payment-form-contract.md +136 -0
- package/package.json +112 -3
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
export type ListPage<T> = {
|
|
2
|
+
data: T[];
|
|
3
|
+
next_cursor: string | null;
|
|
4
|
+
};
|
|
5
|
+
export type Balance = {
|
|
6
|
+
customer_id: string;
|
|
7
|
+
currency: string;
|
|
8
|
+
billing_mode: "arrears" | "prepaid";
|
|
9
|
+
balance_amount: string;
|
|
10
|
+
held_amount: string;
|
|
11
|
+
available_amount: string;
|
|
12
|
+
owed_amount: string;
|
|
13
|
+
};
|
|
14
|
+
export type BalanceTransaction = {
|
|
15
|
+
id: string;
|
|
16
|
+
customer_id: string;
|
|
17
|
+
currency: string;
|
|
18
|
+
type: "deposit" | "expire" | "owed_accrual" | "owed_payment" | "owed_repayment" | "owed_writeoff" | "reinstate" | "revoke" | "spend";
|
|
19
|
+
amount: string;
|
|
20
|
+
credit_grant_id: string | null;
|
|
21
|
+
invoker: string | null;
|
|
22
|
+
resource: string | null;
|
|
23
|
+
source: string;
|
|
24
|
+
source_id: string;
|
|
25
|
+
created_at: string;
|
|
26
|
+
};
|
|
27
|
+
export type BillingAddress = {
|
|
28
|
+
line1: string | null;
|
|
29
|
+
line2: string | null;
|
|
30
|
+
city: string | null;
|
|
31
|
+
state: string | null;
|
|
32
|
+
postal_code: string | null;
|
|
33
|
+
country: string | null;
|
|
34
|
+
};
|
|
35
|
+
export type BillingDetails = {
|
|
36
|
+
name: string | null;
|
|
37
|
+
email: string | null;
|
|
38
|
+
phone: string | null;
|
|
39
|
+
address: BillingAddress | null;
|
|
40
|
+
};
|
|
41
|
+
export type Capabilities = {
|
|
42
|
+
route_groups: Record<string, boolean> | null;
|
|
43
|
+
features: Record<string, boolean> | null;
|
|
44
|
+
};
|
|
45
|
+
export type CaptchaStatus = {
|
|
46
|
+
enabled: boolean;
|
|
47
|
+
required: boolean;
|
|
48
|
+
provider: string | null;
|
|
49
|
+
token_header: string;
|
|
50
|
+
client_script_url: string;
|
|
51
|
+
};
|
|
52
|
+
export type CardDetails = {
|
|
53
|
+
brand: string | null;
|
|
54
|
+
last4: string | null;
|
|
55
|
+
exp_month: number | null;
|
|
56
|
+
exp_year: number | null;
|
|
57
|
+
};
|
|
58
|
+
export type CardEntry = {
|
|
59
|
+
number?: string;
|
|
60
|
+
exp_month?: number;
|
|
61
|
+
exp_year?: number;
|
|
62
|
+
cvc?: string;
|
|
63
|
+
};
|
|
64
|
+
export type ChangeTierParams = {
|
|
65
|
+
price_id?: string;
|
|
66
|
+
};
|
|
67
|
+
export type CheckoutSession = {
|
|
68
|
+
id: string;
|
|
69
|
+
status: string;
|
|
70
|
+
merchant: CheckoutSessionMerchant;
|
|
71
|
+
plan: CheckoutSessionPlan;
|
|
72
|
+
line_items: CheckoutSessionLineItem[];
|
|
73
|
+
tax: string | null;
|
|
74
|
+
due_today: string | null;
|
|
75
|
+
options: CheckoutSessionOption[];
|
|
76
|
+
saved_methods: CheckoutSessionSavedMethod[];
|
|
77
|
+
next_action: NextAction | null;
|
|
78
|
+
operation: PaymentOperation | null;
|
|
79
|
+
payment_id: string | null;
|
|
80
|
+
subscription_id: string | null;
|
|
81
|
+
failure_message: string | null;
|
|
82
|
+
failure: PaymentFailure | null;
|
|
83
|
+
success_url: string | null;
|
|
84
|
+
embed_origin: string | null;
|
|
85
|
+
expires_at: string;
|
|
86
|
+
};
|
|
87
|
+
export type CheckoutSessionLineItem = {
|
|
88
|
+
label: string;
|
|
89
|
+
sublabel: string | null;
|
|
90
|
+
amount: string;
|
|
91
|
+
};
|
|
92
|
+
export type CheckoutSessionLink = {
|
|
93
|
+
id: string;
|
|
94
|
+
url: string | null;
|
|
95
|
+
expires_at: string;
|
|
96
|
+
};
|
|
97
|
+
export type CheckoutSessionMerchant = {
|
|
98
|
+
display_name: string;
|
|
99
|
+
};
|
|
100
|
+
export type CheckoutSessionOption = {
|
|
101
|
+
id: string;
|
|
102
|
+
psp_id: string;
|
|
103
|
+
rail: string;
|
|
104
|
+
mode: string;
|
|
105
|
+
driver: string;
|
|
106
|
+
public_config: Record<string, string> | null;
|
|
107
|
+
};
|
|
108
|
+
export type CheckoutSessionPayResult = {
|
|
109
|
+
status: string;
|
|
110
|
+
next_action: NextAction | null;
|
|
111
|
+
operation: PaymentOperation | null;
|
|
112
|
+
payment_id: string | null;
|
|
113
|
+
subscription_id: string | null;
|
|
114
|
+
failure_message: string | null;
|
|
115
|
+
failure: PaymentFailure | null;
|
|
116
|
+
};
|
|
117
|
+
export type CheckoutSessionPlan = {
|
|
118
|
+
auto_renew: boolean;
|
|
119
|
+
display_name: string;
|
|
120
|
+
unit_amount: string;
|
|
121
|
+
currency: string;
|
|
122
|
+
unit_decimals: number;
|
|
123
|
+
billing_interval_hours: number | null;
|
|
124
|
+
access_duration_hours: number | null;
|
|
125
|
+
};
|
|
126
|
+
export type CheckoutSessionSavedMethod = {
|
|
127
|
+
id: string;
|
|
128
|
+
option_id: string;
|
|
129
|
+
rail: string;
|
|
130
|
+
card: CardDetails | null;
|
|
131
|
+
};
|
|
132
|
+
export type CollectionPaymentMethod = {
|
|
133
|
+
currency: string;
|
|
134
|
+
payment_method_id: string;
|
|
135
|
+
};
|
|
136
|
+
export type CreatePaymentMethodParams = {
|
|
137
|
+
psp_id?: string;
|
|
138
|
+
payment_token?: string;
|
|
139
|
+
card?: CardEntry;
|
|
140
|
+
billing_details?: BillingDetails;
|
|
141
|
+
};
|
|
142
|
+
export type CreditGrantSpec = {
|
|
143
|
+
currency: string;
|
|
144
|
+
amount?: string;
|
|
145
|
+
from_payment?: boolean;
|
|
146
|
+
expires_after_days?: number;
|
|
147
|
+
};
|
|
148
|
+
export type CurrencyUnits = {
|
|
149
|
+
code: string;
|
|
150
|
+
decimals: number;
|
|
151
|
+
minor_decimals: number;
|
|
152
|
+
};
|
|
153
|
+
export type CustomerAmount = {
|
|
154
|
+
min_amount: string;
|
|
155
|
+
max_amount: string;
|
|
156
|
+
};
|
|
157
|
+
export type CustomerCancelSubscriptionParams = {
|
|
158
|
+
reason?: string;
|
|
159
|
+
signature?: string;
|
|
160
|
+
};
|
|
161
|
+
export type CustomerChangeTierParams = {
|
|
162
|
+
price_id?: string;
|
|
163
|
+
signature?: string;
|
|
164
|
+
};
|
|
165
|
+
export type CustomerEntitlement = {
|
|
166
|
+
entitlement: string;
|
|
167
|
+
};
|
|
168
|
+
export type CustomerNotificationLookup = {
|
|
169
|
+
notifications: Record<string, Notification | null> | null;
|
|
170
|
+
};
|
|
171
|
+
export type DriftField = {
|
|
172
|
+
field: string;
|
|
173
|
+
openrails_value: string;
|
|
174
|
+
remote_value: string;
|
|
175
|
+
};
|
|
176
|
+
export type Health = {
|
|
177
|
+
status: "ok" | "ready";
|
|
178
|
+
};
|
|
179
|
+
export type Invoice = {
|
|
180
|
+
id: string;
|
|
181
|
+
customer_id: string;
|
|
182
|
+
currency: string;
|
|
183
|
+
invoice_number: string | null;
|
|
184
|
+
period_starts_at: string;
|
|
185
|
+
period_ends_at: string;
|
|
186
|
+
usage_total: string;
|
|
187
|
+
deposits_total: string;
|
|
188
|
+
owed_accrued: string;
|
|
189
|
+
owed_paid: string;
|
|
190
|
+
closing_balance: string;
|
|
191
|
+
subtotal_amount: string;
|
|
192
|
+
total_amount: string;
|
|
193
|
+
amount_paid: string;
|
|
194
|
+
amount_due: string;
|
|
195
|
+
line_items: InvoiceLineItem[];
|
|
196
|
+
money_movements: Record<string, string> | null;
|
|
197
|
+
po_number: string | null;
|
|
198
|
+
tax: Record<string, unknown> | null;
|
|
199
|
+
billing_contacts: InvoiceContact[];
|
|
200
|
+
memo: string | null;
|
|
201
|
+
status: "draft" | "open" | "paid" | "past_due" | "uncollectible" | "voided";
|
|
202
|
+
collection_method: "charge_automatically" | "send_invoice";
|
|
203
|
+
issued_at: string | null;
|
|
204
|
+
due_at: string | null;
|
|
205
|
+
paid_at: string | null;
|
|
206
|
+
voided_at: string | null;
|
|
207
|
+
uncollectible_at: string | null;
|
|
208
|
+
finalized_at: string | null;
|
|
209
|
+
external_invoice_id: string | null;
|
|
210
|
+
collection_failure_count: number;
|
|
211
|
+
collection_failed_at: string | null;
|
|
212
|
+
next_collection_attempt_at: string | null;
|
|
213
|
+
last_collection_failure_code: string | null;
|
|
214
|
+
recovery: PaymentRecovery | null;
|
|
215
|
+
available_actions: ("mark_uncollectible" | "record_payment" | "retry_collection" | "void")[];
|
|
216
|
+
created_at: string;
|
|
217
|
+
};
|
|
218
|
+
export type InvoiceContact = {
|
|
219
|
+
name: string;
|
|
220
|
+
email: string;
|
|
221
|
+
};
|
|
222
|
+
export type InvoiceLineItem = {
|
|
223
|
+
event_type: string;
|
|
224
|
+
amount: string;
|
|
225
|
+
count: number;
|
|
226
|
+
dimensions: Record<string, number> | null;
|
|
227
|
+
};
|
|
228
|
+
export type InvoicePayNow = {
|
|
229
|
+
invoice: Invoice;
|
|
230
|
+
payment: InvoicePayment;
|
|
231
|
+
operation: PaymentOperation;
|
|
232
|
+
replayed: boolean;
|
|
233
|
+
};
|
|
234
|
+
export type InvoicePayment = {
|
|
235
|
+
id: string;
|
|
236
|
+
invoice_id: string;
|
|
237
|
+
currency: string;
|
|
238
|
+
amount: string;
|
|
239
|
+
status: "attempted" | "failed" | "settled";
|
|
240
|
+
payment_method_id: string | null;
|
|
241
|
+
rail: string | null;
|
|
242
|
+
transaction_id: string | null;
|
|
243
|
+
failure_code: string | null;
|
|
244
|
+
failure_reason: string | null;
|
|
245
|
+
attempted_at: string;
|
|
246
|
+
settled_at: string | null;
|
|
247
|
+
};
|
|
248
|
+
export type MarkNotificationsReadParams = {
|
|
249
|
+
notification_ids?: string[];
|
|
250
|
+
};
|
|
251
|
+
export type MintCheckoutSessionParams = {
|
|
252
|
+
price_id?: string;
|
|
253
|
+
price_key?: string;
|
|
254
|
+
product_key?: string;
|
|
255
|
+
amount?: string;
|
|
256
|
+
auto_renew?: boolean;
|
|
257
|
+
success_url?: string;
|
|
258
|
+
};
|
|
259
|
+
export type NextAction = {
|
|
260
|
+
type: string;
|
|
261
|
+
url: string | null;
|
|
262
|
+
transactions: string[];
|
|
263
|
+
};
|
|
264
|
+
export type Notification = {
|
|
265
|
+
id: string;
|
|
266
|
+
customer_id: string;
|
|
267
|
+
event_type: string;
|
|
268
|
+
data: NotificationData;
|
|
269
|
+
seen: boolean;
|
|
270
|
+
created_at: string;
|
|
271
|
+
};
|
|
272
|
+
export type NotificationData = {
|
|
273
|
+
reason?: string;
|
|
274
|
+
message?: string;
|
|
275
|
+
source?: string;
|
|
276
|
+
product_id?: string;
|
|
277
|
+
ended_at?: string;
|
|
278
|
+
currency?: string;
|
|
279
|
+
subscription_id?: string;
|
|
280
|
+
from_price_id?: string;
|
|
281
|
+
to_price_id?: string;
|
|
282
|
+
to_product_id?: string;
|
|
283
|
+
to_product_name?: string;
|
|
284
|
+
old_amount?: string;
|
|
285
|
+
new_amount?: string;
|
|
286
|
+
effective_at?: string;
|
|
287
|
+
period_starts_at?: string;
|
|
288
|
+
period_ends_at?: string;
|
|
289
|
+
downgrade_applied?: boolean;
|
|
290
|
+
new_product?: string;
|
|
291
|
+
overdue_amount?: string;
|
|
292
|
+
overdue_invoices?: number;
|
|
293
|
+
overdue_started_at?: string;
|
|
294
|
+
from_state?: string;
|
|
295
|
+
to_state?: string;
|
|
296
|
+
invoice_id?: string;
|
|
297
|
+
invoice_number?: string;
|
|
298
|
+
amount_due?: string;
|
|
299
|
+
due_at?: string;
|
|
300
|
+
failure_code?: string;
|
|
301
|
+
failure_reason?: string;
|
|
302
|
+
decline_outcome?: string;
|
|
303
|
+
next_attempt_at?: string;
|
|
304
|
+
rail?: string;
|
|
305
|
+
rail_subscription_id?: string;
|
|
306
|
+
transaction_id?: string;
|
|
307
|
+
amount?: string;
|
|
308
|
+
product_name?: string;
|
|
309
|
+
payment_method?: string;
|
|
310
|
+
user_email?: string;
|
|
311
|
+
};
|
|
312
|
+
export type PSPLinkState = {
|
|
313
|
+
status: "error" | "linked" | "pending_manual_link" | "sync_disabled";
|
|
314
|
+
ids: Record<string, string> | null;
|
|
315
|
+
lookup_key: string;
|
|
316
|
+
sync_status: "drifted" | "in_sync" | "missing" | "never_synced" | "sync_disabled" | "unknown";
|
|
317
|
+
drift: DriftField[];
|
|
318
|
+
message: string;
|
|
319
|
+
};
|
|
320
|
+
export type PSPPaymentConfig = {
|
|
321
|
+
psp_id: string;
|
|
322
|
+
key: string;
|
|
323
|
+
rail: string;
|
|
324
|
+
custodian: string;
|
|
325
|
+
display_name: string;
|
|
326
|
+
flow: string;
|
|
327
|
+
checkout: boolean;
|
|
328
|
+
config?: Record<string, string>;
|
|
329
|
+
status?: string;
|
|
330
|
+
retry_after?: number;
|
|
331
|
+
};
|
|
332
|
+
export type PayCheckoutSessionParams = {
|
|
333
|
+
option_id?: string;
|
|
334
|
+
payment_method_id?: string;
|
|
335
|
+
payment_token?: string;
|
|
336
|
+
card?: CardEntry;
|
|
337
|
+
billing_details?: BillingDetails;
|
|
338
|
+
token_symbol?: string;
|
|
339
|
+
};
|
|
340
|
+
export type PayInvoiceParams = {
|
|
341
|
+
payment_method_id?: string;
|
|
342
|
+
};
|
|
343
|
+
export type Payment = {
|
|
344
|
+
id: string;
|
|
345
|
+
kind: "charge" | "chargeback" | "dispute_reversal" | "refund";
|
|
346
|
+
status: "failed" | "partially_refunded" | "pending" | "refunded" | "succeeded";
|
|
347
|
+
amount: string;
|
|
348
|
+
amount_refunded: string;
|
|
349
|
+
currency: string;
|
|
350
|
+
customer_id: string;
|
|
351
|
+
subscription_id: string | null;
|
|
352
|
+
price_id: string;
|
|
353
|
+
price: Price | null;
|
|
354
|
+
product: ProductSummary | null;
|
|
355
|
+
channel: "manual" | "rail";
|
|
356
|
+
rail: string | null;
|
|
357
|
+
psp_id: string | null;
|
|
358
|
+
transaction_id: string;
|
|
359
|
+
card: CardDetails | null;
|
|
360
|
+
failure: PaymentFailure | null;
|
|
361
|
+
refunded_payment_id: string | null;
|
|
362
|
+
reason: string | null;
|
|
363
|
+
refunds: Payment[];
|
|
364
|
+
created_at: string;
|
|
365
|
+
};
|
|
366
|
+
export type PaymentConfig = {
|
|
367
|
+
psps: PSPPaymentConfig[];
|
|
368
|
+
solana: SolanaPaymentConfig | null;
|
|
369
|
+
};
|
|
370
|
+
export type PaymentFailure = {
|
|
371
|
+
reason: string;
|
|
372
|
+
message: string;
|
|
373
|
+
field?: string;
|
|
374
|
+
};
|
|
375
|
+
export type PaymentMethod = {
|
|
376
|
+
id: string;
|
|
377
|
+
customer_id: string;
|
|
378
|
+
rail: string;
|
|
379
|
+
psp_id: string | null;
|
|
380
|
+
card: CardDetails | null;
|
|
381
|
+
billing_details: BillingDetails | null;
|
|
382
|
+
health: PaymentMethodHealth;
|
|
383
|
+
subscriptions: PaymentMethodSubscription[];
|
|
384
|
+
collection_currencies: string[];
|
|
385
|
+
created_at: string;
|
|
386
|
+
};
|
|
387
|
+
export type PaymentMethodHealth = {
|
|
388
|
+
expiry_status: "expired" | "expiring_soon" | "valid" | null;
|
|
389
|
+
last_charged_at: string | null;
|
|
390
|
+
last_charge_outcome: "failed" | "succeeded" | null;
|
|
391
|
+
active: boolean;
|
|
392
|
+
};
|
|
393
|
+
export type PaymentMethodSetup = {
|
|
394
|
+
id: string;
|
|
395
|
+
status: string;
|
|
396
|
+
setup_intent_id?: string;
|
|
397
|
+
client_secret?: string;
|
|
398
|
+
payment_method_id?: string;
|
|
399
|
+
};
|
|
400
|
+
export type PaymentMethodSetupParams = {
|
|
401
|
+
psp_id?: string;
|
|
402
|
+
consent?: boolean;
|
|
403
|
+
};
|
|
404
|
+
export type PaymentMethodSubscription = {
|
|
405
|
+
id: string;
|
|
406
|
+
display_name: string;
|
|
407
|
+
created_at: string;
|
|
408
|
+
};
|
|
409
|
+
export type PaymentOperation = {
|
|
410
|
+
id: string;
|
|
411
|
+
status: string;
|
|
412
|
+
};
|
|
413
|
+
export type PaymentRecovery = {
|
|
414
|
+
last_failure_reason?: string;
|
|
415
|
+
retryable: boolean;
|
|
416
|
+
blocked_reason?: string;
|
|
417
|
+
operation?: PaymentOperation;
|
|
418
|
+
};
|
|
419
|
+
export type PendingAction = {
|
|
420
|
+
psp: string;
|
|
421
|
+
action: string;
|
|
422
|
+
hint: string;
|
|
423
|
+
patch_required: Record<string, Record<string, Record<string, string>>> | null;
|
|
424
|
+
};
|
|
425
|
+
export type PortalResponse = {
|
|
426
|
+
url: string;
|
|
427
|
+
};
|
|
428
|
+
export type Price = {
|
|
429
|
+
customer_amount?: CustomerAmount;
|
|
430
|
+
revision: number;
|
|
431
|
+
id: string;
|
|
432
|
+
key: string;
|
|
433
|
+
product_id: string;
|
|
434
|
+
archived: boolean;
|
|
435
|
+
unit_amount: string;
|
|
436
|
+
currency: string;
|
|
437
|
+
access_duration_hours: number | null;
|
|
438
|
+
billing_interval_hours: number | null;
|
|
439
|
+
trial_unit_amount: string | null;
|
|
440
|
+
trial_duration_hours: number | null;
|
|
441
|
+
psps: Record<string, PSPLinkState> | null;
|
|
442
|
+
pending_manual_actions: PendingAction[];
|
|
443
|
+
created_at: string;
|
|
444
|
+
updated_at: string;
|
|
445
|
+
};
|
|
446
|
+
export type Product = {
|
|
447
|
+
revision: number;
|
|
448
|
+
id: string;
|
|
449
|
+
key: string;
|
|
450
|
+
display_name: string;
|
|
451
|
+
description: string;
|
|
452
|
+
entitlements: string[];
|
|
453
|
+
credit_grant?: CreditGrantSpec;
|
|
454
|
+
tier_group: string | null;
|
|
455
|
+
tier_rank: number;
|
|
456
|
+
archived: boolean;
|
|
457
|
+
prices: Price[];
|
|
458
|
+
created_at: string;
|
|
459
|
+
updated_at: string;
|
|
460
|
+
};
|
|
461
|
+
export type ProductAccessGrant = {
|
|
462
|
+
id: string;
|
|
463
|
+
customer_id: string;
|
|
464
|
+
product_id: string;
|
|
465
|
+
product_key: string;
|
|
466
|
+
product_name: string;
|
|
467
|
+
source_type: "grace" | "grant" | "purchase" | "subscription";
|
|
468
|
+
source_id: string;
|
|
469
|
+
payment_id: string | null;
|
|
470
|
+
grant_reason: "comp" | "import" | "migration" | "staff" | null;
|
|
471
|
+
granted_by: string | null;
|
|
472
|
+
note: string | null;
|
|
473
|
+
status: string;
|
|
474
|
+
starts_at: string;
|
|
475
|
+
ends_at: string | null;
|
|
476
|
+
revoked_at: string | null;
|
|
477
|
+
revoke_reason: string | null;
|
|
478
|
+
created_at: string;
|
|
479
|
+
updated_at: string;
|
|
480
|
+
};
|
|
481
|
+
export type ProductSummary = {
|
|
482
|
+
id: string;
|
|
483
|
+
key: string;
|
|
484
|
+
display_name: string;
|
|
485
|
+
description: string;
|
|
486
|
+
tier_group: string | null;
|
|
487
|
+
tier_rank: number;
|
|
488
|
+
archived: boolean;
|
|
489
|
+
};
|
|
490
|
+
export type PublicConfig = {
|
|
491
|
+
capabilities: Capabilities;
|
|
492
|
+
currencies: CurrencyUnits[];
|
|
493
|
+
payment: PaymentConfig | null;
|
|
494
|
+
};
|
|
495
|
+
export type ReplacePaymentMethodCardParams = {
|
|
496
|
+
payment_token?: string;
|
|
497
|
+
card?: CardEntry;
|
|
498
|
+
billing_details?: BillingDetails;
|
|
499
|
+
};
|
|
500
|
+
export type RetrySubscriptionNowParams = {
|
|
501
|
+
payment_method_id?: string;
|
|
502
|
+
};
|
|
503
|
+
export type SetSubscriptionPaymentMethodParams = {
|
|
504
|
+
payment_method_id?: string;
|
|
505
|
+
};
|
|
506
|
+
export type SolanaPayGetResponse = {
|
|
507
|
+
label: string;
|
|
508
|
+
icon: string;
|
|
509
|
+
};
|
|
510
|
+
export type SolanaPayPostRequest = {
|
|
511
|
+
account?: string;
|
|
512
|
+
};
|
|
513
|
+
export type SolanaPayPostResponse = {
|
|
514
|
+
transaction: string;
|
|
515
|
+
message?: string;
|
|
516
|
+
};
|
|
517
|
+
export type SolanaPaymentConfig = {
|
|
518
|
+
network: string;
|
|
519
|
+
chain: string;
|
|
520
|
+
preferred_token: string;
|
|
521
|
+
tokens: SolanaPaymentToken[];
|
|
522
|
+
};
|
|
523
|
+
export type SolanaPaymentToken = {
|
|
524
|
+
symbol: string;
|
|
525
|
+
name: string;
|
|
526
|
+
mint: string;
|
|
527
|
+
decimals: number;
|
|
528
|
+
preferred: boolean;
|
|
529
|
+
recurring_eligible: boolean;
|
|
530
|
+
};
|
|
531
|
+
export type SpendLimits = {
|
|
532
|
+
currency: string;
|
|
533
|
+
invoker: string;
|
|
534
|
+
windows: SpendWindow[];
|
|
535
|
+
};
|
|
536
|
+
export type SpendWindow = {
|
|
537
|
+
scope: "invoker" | "invoker_tier" | "role";
|
|
538
|
+
key: string;
|
|
539
|
+
window_seconds: number;
|
|
540
|
+
limit: string;
|
|
541
|
+
currency: string;
|
|
542
|
+
used: string;
|
|
543
|
+
reserved: string;
|
|
544
|
+
remaining: string;
|
|
545
|
+
resets_at: string;
|
|
546
|
+
};
|
|
547
|
+
export type StripeEngineAuthentication = {
|
|
548
|
+
operation: PaymentOperation;
|
|
549
|
+
payment_intent_id?: string;
|
|
550
|
+
client_secret?: string;
|
|
551
|
+
provider_payment_method_id?: string;
|
|
552
|
+
};
|
|
553
|
+
export type Subscription = {
|
|
554
|
+
collection_policy: string;
|
|
555
|
+
recovery?: PaymentRecovery;
|
|
556
|
+
last_retry_at: string | null;
|
|
557
|
+
retry_attempts: number | null;
|
|
558
|
+
next_retry_at: string | null;
|
|
559
|
+
grace_ends_at: string | null;
|
|
560
|
+
deletion_scheduled_at?: string;
|
|
561
|
+
payments?: Payment[];
|
|
562
|
+
id: string;
|
|
563
|
+
customer_id: string;
|
|
564
|
+
product_id: string;
|
|
565
|
+
price_id: string;
|
|
566
|
+
quantity: number;
|
|
567
|
+
psp_id: string;
|
|
568
|
+
rail: string;
|
|
569
|
+
rail_subscription_id: string | null;
|
|
570
|
+
status: "active" | "awaiting_method" | "canceled" | "past_due" | "pending" | "unverified";
|
|
571
|
+
scheduled_price_id?: string;
|
|
572
|
+
payment_method_id: string | null;
|
|
573
|
+
started_at: string;
|
|
574
|
+
ended_at: string | null;
|
|
575
|
+
current_period_starts_at: string | null;
|
|
576
|
+
current_period_ends_at: string | null;
|
|
577
|
+
canceled_at: string | null;
|
|
578
|
+
cancel_type: string | null;
|
|
579
|
+
cancel_feedback: string | null;
|
|
580
|
+
resumable: boolean;
|
|
581
|
+
cancel_scheduled: boolean;
|
|
582
|
+
cancel_mode: string;
|
|
583
|
+
price?: Price;
|
|
584
|
+
product?: ProductSummary;
|
|
585
|
+
scheduled_price?: Price;
|
|
586
|
+
scheduled_product?: ProductSummary;
|
|
587
|
+
card?: CardDetails;
|
|
588
|
+
cancel_portal_url?: string;
|
|
589
|
+
access?: SubscriptionAccess;
|
|
590
|
+
next_action: NextAction | null;
|
|
591
|
+
created_at: string;
|
|
592
|
+
updated_at: string;
|
|
593
|
+
};
|
|
594
|
+
export type SubscriptionAccess = {
|
|
595
|
+
kind: string;
|
|
596
|
+
product_id: string;
|
|
597
|
+
source_type?: string;
|
|
598
|
+
source_id?: string;
|
|
599
|
+
subscription_id?: string;
|
|
600
|
+
rail?: string;
|
|
601
|
+
starts_at: string;
|
|
602
|
+
ends_at?: string;
|
|
603
|
+
};
|
|
604
|
+
export type SubscriptionRetryNowResult = {
|
|
605
|
+
subscription: Subscription;
|
|
606
|
+
operation: PaymentOperation;
|
|
607
|
+
replayed: boolean;
|
|
608
|
+
};
|
|
609
|
+
export type SupportedTokensResponse = {
|
|
610
|
+
tokens: TokenInfo[];
|
|
611
|
+
};
|
|
612
|
+
export type TierChange = {
|
|
613
|
+
status: string;
|
|
614
|
+
action?: string;
|
|
615
|
+
effective?: string;
|
|
616
|
+
price_id: string;
|
|
617
|
+
rail: string;
|
|
618
|
+
subscription_id?: string;
|
|
619
|
+
next_action?: NextAction;
|
|
620
|
+
transaction_id: string | null;
|
|
621
|
+
message?: string;
|
|
622
|
+
delayed_start?: string;
|
|
623
|
+
currency?: string;
|
|
624
|
+
amount_due_now: string;
|
|
625
|
+
next_charge_amount: string;
|
|
626
|
+
next_charge_date?: string;
|
|
627
|
+
operation_id?: string;
|
|
628
|
+
};
|
|
629
|
+
export type TierChangePreview = {
|
|
630
|
+
action: string;
|
|
631
|
+
price_id: string;
|
|
632
|
+
rail: string;
|
|
633
|
+
currency: string;
|
|
634
|
+
amount_due_now: string;
|
|
635
|
+
next_charge_amount: string;
|
|
636
|
+
next_charge_date?: string;
|
|
637
|
+
effective: string;
|
|
638
|
+
is_estimate: boolean;
|
|
639
|
+
message?: string;
|
|
640
|
+
};
|
|
641
|
+
export type TokenBalance = {
|
|
642
|
+
amount: string;
|
|
643
|
+
units: string;
|
|
644
|
+
sufficient: boolean;
|
|
645
|
+
};
|
|
646
|
+
export type TokenInfo = {
|
|
647
|
+
symbol: string;
|
|
648
|
+
name: string;
|
|
649
|
+
mint: string;
|
|
650
|
+
decimals: number;
|
|
651
|
+
price?: string;
|
|
652
|
+
preferred: boolean;
|
|
653
|
+
recurring_eligible: boolean;
|
|
654
|
+
quote?: TokenQuote;
|
|
655
|
+
balance?: TokenBalance;
|
|
656
|
+
};
|
|
657
|
+
export type TokenQuote = {
|
|
658
|
+
amount: string;
|
|
659
|
+
units: string;
|
|
660
|
+
token_price_usd: string;
|
|
661
|
+
fx_rate: string;
|
|
662
|
+
fx_currency: string;
|
|
663
|
+
quoted_at: string;
|
|
664
|
+
expires_at: string;
|
|
665
|
+
};
|
|
666
|
+
export type UnreadCount = {
|
|
667
|
+
unread_count: number;
|
|
668
|
+
};
|
|
669
|
+
export type Usage = {
|
|
670
|
+
customer_id: string;
|
|
671
|
+
currency: string;
|
|
672
|
+
from: string;
|
|
673
|
+
to: string;
|
|
674
|
+
group_by: "event_type" | "function" | "invoker" | "resource" | "tier";
|
|
675
|
+
rows: UsageRow[];
|
|
676
|
+
};
|
|
677
|
+
export type UsageRow = {
|
|
678
|
+
key: string;
|
|
679
|
+
event_count: number;
|
|
680
|
+
amount: string;
|
|
681
|
+
dimensions: Record<string, number> | null;
|
|
682
|
+
};
|
|
@@ -0,0 +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';
|
|
2
|
+
export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, type BillingErrorBody, } from './errors';
|
|
3
|
+
export type { CardSetup, CardSummary, Currency, CurrencyScales, PaymentConfig, PublicConfig, CheckoutSessionLink, Invoice, ListPage, NewCard, NextAction, Page, Payment, PaymentAuthentication, PaymentMethod, PaymentOperation, PaymentRecovery, Price, Product, SolanaToken, Subscription, SubscriptionProduct, SubscriptionStatus, TierChange, TierChangePreview, } from './types';
|
|
4
|
+
export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
|