@solvapay/react 1.0.9-preview.1 → 1.0.9
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 +209 -0
- package/CONTRIBUTING.md +117 -0
- package/README.md +426 -24
- package/dist/adapters/auth.d.cts +13 -0
- package/dist/adapters/auth.d.ts +13 -0
- package/dist/adapters/auth.js +1 -0
- package/dist/chunk-37R5NZGF.js +4824 -0
- package/dist/chunk-HWVJL5X6.js +429 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-R2ZPZ7VM.js +597 -0
- package/dist/chunk-ZAV7CQ4G.js +361 -0
- package/dist/index-WBjulQHf.d.cts +3656 -0
- package/dist/index-onWNU7iT.d.ts +3656 -0
- package/dist/index.cjs +5556 -1143
- package/dist/index.d.cts +618 -708
- package/dist/index.d.ts +618 -708
- package/dist/index.js +597 -1664
- package/dist/mcp/index.cjs +8096 -0
- package/dist/mcp/index.d.cts +1013 -0
- package/dist/mcp/index.d.ts +1013 -0
- package/dist/mcp/index.js +2724 -0
- package/dist/mcp/styles.css +1020 -0
- package/dist/primitives/index.cjs +5316 -0
- package/dist/primitives/index.d.cts +721 -0
- package/dist/primitives/index.d.ts +721 -0
- package/dist/primitives/index.js +232 -0
- package/dist/styles.css +1115 -0
- package/dist/useUsage-BmOYXxgG.d.cts +413 -0
- package/dist/useUsage-nD7zwSbG.d.ts +413 -0
- package/dist/webapi-K5XBCEO6.js +3775 -0
- package/package.json +37 -6
|
@@ -0,0 +1,3656 @@
|
|
|
1
|
+
import * as _stripe_stripe_js from '@stripe/stripe-js';
|
|
2
|
+
import { PaymentIntent } from '@stripe/stripe-js';
|
|
3
|
+
import { AuthAdapter } from './adapters/auth.cjs';
|
|
4
|
+
|
|
5
|
+
interface components {
|
|
6
|
+
schemas: {
|
|
7
|
+
SdkMerchantResponseDto: {
|
|
8
|
+
/**
|
|
9
|
+
* Brand name shown in UI
|
|
10
|
+
* @example Acme
|
|
11
|
+
*/
|
|
12
|
+
displayName: string;
|
|
13
|
+
/**
|
|
14
|
+
* Legal entity name used in SCA mandate copy
|
|
15
|
+
* @example Acme Inc.
|
|
16
|
+
*/
|
|
17
|
+
legalName: string;
|
|
18
|
+
/** @example support@acme.com */
|
|
19
|
+
supportEmail?: string;
|
|
20
|
+
/** @example https://acme.com/support */
|
|
21
|
+
supportUrl?: string;
|
|
22
|
+
/** @example https://acme.com/terms */
|
|
23
|
+
termsUrl?: string;
|
|
24
|
+
/** @example https://acme.com/privacy */
|
|
25
|
+
privacyUrl?: string;
|
|
26
|
+
/**
|
|
27
|
+
* ISO-3166 alpha-2 country code of the merchant
|
|
28
|
+
* @example US
|
|
29
|
+
*/
|
|
30
|
+
country?: string;
|
|
31
|
+
/**
|
|
32
|
+
* ISO-4217 default settlement currency
|
|
33
|
+
* @example usd
|
|
34
|
+
*/
|
|
35
|
+
defaultCurrency?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Descriptor appearing on the customer card statement
|
|
38
|
+
* @example ACME INC
|
|
39
|
+
*/
|
|
40
|
+
statementDescriptor?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Absolute URL to the merchant logo
|
|
43
|
+
* @example https://cdn.acme.com/logo.png
|
|
44
|
+
*/
|
|
45
|
+
logoUrl?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Absolute URL to the square app icon / logomark. Consumed by MCP host chromes, mobile avatar slots, and any surface where the landscape `logoUrl` would need letterboxing.
|
|
48
|
+
* @example https://cdn.acme.com/icon.png
|
|
49
|
+
*/
|
|
50
|
+
iconUrl?: string;
|
|
51
|
+
};
|
|
52
|
+
SdkPlatformConfigResponseDto: {
|
|
53
|
+
/**
|
|
54
|
+
* SolvaPay's platform Stripe publishable key for the authenticated provider's environment. Safe to expose browser-side; paired with the connected `accountId` returned from `create-payment-intent` for Stripe Connect direct charges. Omitted when not configured so callers can fall back cleanly to a hosted flow.
|
|
55
|
+
* @example pk_test_...
|
|
56
|
+
*/
|
|
57
|
+
stripePublishableKey?: string;
|
|
58
|
+
};
|
|
59
|
+
CreatePaymentIntentDto: {
|
|
60
|
+
productRef?: string;
|
|
61
|
+
customerRef: string;
|
|
62
|
+
planRef?: string;
|
|
63
|
+
pricingTier?: string;
|
|
64
|
+
/**
|
|
65
|
+
* @default product
|
|
66
|
+
* @enum {string}
|
|
67
|
+
*/
|
|
68
|
+
purpose: "product" | "credit_topup" | "usage_billing";
|
|
69
|
+
amount?: number;
|
|
70
|
+
currency?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
};
|
|
73
|
+
CreateCheckoutSessionRequest: {
|
|
74
|
+
customerRef: string;
|
|
75
|
+
productRef?: string;
|
|
76
|
+
planRef?: string;
|
|
77
|
+
returnUrl?: string;
|
|
78
|
+
/** @enum {string} */
|
|
79
|
+
purpose?: "credit_topup";
|
|
80
|
+
};
|
|
81
|
+
CancelPurchaseRequest: {
|
|
82
|
+
reason?: string;
|
|
83
|
+
};
|
|
84
|
+
ProcessPaymentIntentDto: {
|
|
85
|
+
productRef: string;
|
|
86
|
+
customerRef: string;
|
|
87
|
+
planRef?: string;
|
|
88
|
+
};
|
|
89
|
+
CreateCheckoutSessionResponse: {
|
|
90
|
+
/**
|
|
91
|
+
* Checkout session ID/token
|
|
92
|
+
* @example e3f1c2d4b6a89f001122334455667788
|
|
93
|
+
*/
|
|
94
|
+
sessionId: string;
|
|
95
|
+
/**
|
|
96
|
+
* Full checkout URL based on backend configuration (ready to redirect customer)
|
|
97
|
+
* @example https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788
|
|
98
|
+
*/
|
|
99
|
+
checkoutUrl: string;
|
|
100
|
+
};
|
|
101
|
+
Plan: {
|
|
102
|
+
/**
|
|
103
|
+
* Plan type exposed in SDK
|
|
104
|
+
* @example recurring
|
|
105
|
+
* @enum {string}
|
|
106
|
+
*/
|
|
107
|
+
type: "recurring" | "one-time" | "usage-based" | "hybrid";
|
|
108
|
+
/**
|
|
109
|
+
* Plan reference
|
|
110
|
+
* @example pln_1A2B3C4D
|
|
111
|
+
*/
|
|
112
|
+
reference: string;
|
|
113
|
+
/**
|
|
114
|
+
* Meter reference for usage-based plans
|
|
115
|
+
* @example mtr_1A2B3C4D
|
|
116
|
+
*/
|
|
117
|
+
meterRef?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Plan name
|
|
120
|
+
* @example Starter
|
|
121
|
+
*/
|
|
122
|
+
name?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Plan description
|
|
125
|
+
* @example Best for teams getting started
|
|
126
|
+
*/
|
|
127
|
+
description?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Plan price in cents
|
|
130
|
+
* @example 2999
|
|
131
|
+
*/
|
|
132
|
+
price: number;
|
|
133
|
+
/**
|
|
134
|
+
* Currency code (ISO 4217)
|
|
135
|
+
* @example USD
|
|
136
|
+
*/
|
|
137
|
+
currency: string;
|
|
138
|
+
/**
|
|
139
|
+
* Currency symbol (derived from currency)
|
|
140
|
+
* @example $
|
|
141
|
+
*/
|
|
142
|
+
currencySymbol?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Number of free units included
|
|
145
|
+
* @example 100
|
|
146
|
+
*/
|
|
147
|
+
freeUnits?: number;
|
|
148
|
+
/**
|
|
149
|
+
* One-time setup fee
|
|
150
|
+
* @example 500
|
|
151
|
+
*/
|
|
152
|
+
setupFee?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Free trial period in days
|
|
155
|
+
* @example 14
|
|
156
|
+
*/
|
|
157
|
+
trialDays?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Billing cycle
|
|
160
|
+
* @example monthly
|
|
161
|
+
*/
|
|
162
|
+
billingCycle?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Billing model
|
|
165
|
+
* @example pre-paid
|
|
166
|
+
* @enum {string}
|
|
167
|
+
*/
|
|
168
|
+
billingModel?: "pre-paid" | "post-paid";
|
|
169
|
+
/**
|
|
170
|
+
* Credits per usage unit (integer, >= 1)
|
|
171
|
+
* @example 1
|
|
172
|
+
*/
|
|
173
|
+
creditsPerUnit?: number;
|
|
174
|
+
/**
|
|
175
|
+
* What the plan measures for usage tracking
|
|
176
|
+
* @example requests
|
|
177
|
+
*/
|
|
178
|
+
measures?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Usage limit for the meter
|
|
181
|
+
* @example 10000
|
|
182
|
+
*/
|
|
183
|
+
limit?: number;
|
|
184
|
+
/**
|
|
185
|
+
* Whether unused units roll over to next period
|
|
186
|
+
* @example false
|
|
187
|
+
*/
|
|
188
|
+
rolloverUnusedUnits?: boolean;
|
|
189
|
+
/** @description Usage limits */
|
|
190
|
+
limits?: {
|
|
191
|
+
[key: string]: unknown;
|
|
192
|
+
};
|
|
193
|
+
/** @description Plan features */
|
|
194
|
+
features?: {
|
|
195
|
+
[key: string]: unknown;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Whether payment is required
|
|
199
|
+
* @example true
|
|
200
|
+
*/
|
|
201
|
+
requiresPayment: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Whether the plan is active (derived from status)
|
|
204
|
+
* @example true
|
|
205
|
+
*/
|
|
206
|
+
isActive: boolean;
|
|
207
|
+
/** @description Maximum number of active users */
|
|
208
|
+
maxActiveUsers?: number;
|
|
209
|
+
/** @description Access expiry in days */
|
|
210
|
+
accessExpiryDays?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Plan status
|
|
213
|
+
* @example active
|
|
214
|
+
*/
|
|
215
|
+
status: string;
|
|
216
|
+
/** @description Creation timestamp */
|
|
217
|
+
createdAt: string;
|
|
218
|
+
/** @description Last update timestamp */
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
};
|
|
221
|
+
CreatePlanRequest: {
|
|
222
|
+
name?: string;
|
|
223
|
+
description?: string;
|
|
224
|
+
/** @enum {string} */
|
|
225
|
+
type?: "recurring" | "usage-based" | "one-time" | "hybrid";
|
|
226
|
+
/** @enum {string} */
|
|
227
|
+
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
228
|
+
price?: number;
|
|
229
|
+
creditsPerUnit?: number;
|
|
230
|
+
currency?: string;
|
|
231
|
+
/** @enum {string} */
|
|
232
|
+
billingModel?: "pre-paid" | "post-paid";
|
|
233
|
+
freeUnits?: number;
|
|
234
|
+
limit?: number;
|
|
235
|
+
basePrice?: number;
|
|
236
|
+
setupFee?: number;
|
|
237
|
+
trialDays?: number;
|
|
238
|
+
rolloverUnusedUnits?: boolean;
|
|
239
|
+
autoRenew?: boolean;
|
|
240
|
+
usageTracking: {
|
|
241
|
+
/** @enum {string} */
|
|
242
|
+
method?: "automatic" | "manual" | "hybrid";
|
|
243
|
+
/** @enum {string} */
|
|
244
|
+
granularity?: "hourly" | "daily" | "weekly" | "monthly";
|
|
245
|
+
};
|
|
246
|
+
limits: {
|
|
247
|
+
[key: string]: unknown;
|
|
248
|
+
};
|
|
249
|
+
metadata: {
|
|
250
|
+
[key: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
features: {
|
|
253
|
+
[key: string]: unknown;
|
|
254
|
+
};
|
|
255
|
+
/** @enum {string} */
|
|
256
|
+
status?: "active" | "inactive" | "archived";
|
|
257
|
+
maxActiveUsers?: number;
|
|
258
|
+
accessExpiryDays?: number;
|
|
259
|
+
default?: boolean;
|
|
260
|
+
};
|
|
261
|
+
UpdatePlanRequest: {
|
|
262
|
+
name?: string;
|
|
263
|
+
description?: string;
|
|
264
|
+
/** @enum {string} */
|
|
265
|
+
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
266
|
+
price?: number;
|
|
267
|
+
creditsPerUnit?: number;
|
|
268
|
+
currency?: string;
|
|
269
|
+
/** @enum {string} */
|
|
270
|
+
billingModel?: "pre-paid" | "post-paid";
|
|
271
|
+
freeUnits?: number;
|
|
272
|
+
limit?: number;
|
|
273
|
+
limits: {
|
|
274
|
+
[key: string]: unknown;
|
|
275
|
+
};
|
|
276
|
+
features: {
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
};
|
|
279
|
+
/** @enum {string} */
|
|
280
|
+
status?: "active" | "inactive" | "archived";
|
|
281
|
+
maxActiveUsers?: number;
|
|
282
|
+
accessExpiryDays?: number;
|
|
283
|
+
metadata: {
|
|
284
|
+
[key: string]: unknown;
|
|
285
|
+
};
|
|
286
|
+
default?: boolean;
|
|
287
|
+
};
|
|
288
|
+
CreateProductRequest: {
|
|
289
|
+
name: string;
|
|
290
|
+
description?: string;
|
|
291
|
+
imageUrl?: string;
|
|
292
|
+
productType?: string;
|
|
293
|
+
isMcpPay?: boolean;
|
|
294
|
+
config: {
|
|
295
|
+
fulfillmentType?: string;
|
|
296
|
+
validityPeriod?: number;
|
|
297
|
+
deliveryMethod?: string;
|
|
298
|
+
};
|
|
299
|
+
metadata: {
|
|
300
|
+
[key: string]: unknown;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
ProductConfigDto: {
|
|
304
|
+
/**
|
|
305
|
+
* Fulfillment type
|
|
306
|
+
* @example digital
|
|
307
|
+
*/
|
|
308
|
+
fulfillmentType?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Validity period in days
|
|
311
|
+
* @example 30
|
|
312
|
+
*/
|
|
313
|
+
validityPeriod?: number;
|
|
314
|
+
/**
|
|
315
|
+
* Delivery method
|
|
316
|
+
* @example api
|
|
317
|
+
*/
|
|
318
|
+
deliveryMethod?: string;
|
|
319
|
+
};
|
|
320
|
+
SdkPlanResponse: {
|
|
321
|
+
/**
|
|
322
|
+
* Plan reference
|
|
323
|
+
* @example pln_1A2B3C4D
|
|
324
|
+
*/
|
|
325
|
+
reference: string;
|
|
326
|
+
/**
|
|
327
|
+
* Plan price in cents
|
|
328
|
+
* @example 2999
|
|
329
|
+
*/
|
|
330
|
+
price: number;
|
|
331
|
+
/**
|
|
332
|
+
* Currency code (ISO 4217)
|
|
333
|
+
* @example USD
|
|
334
|
+
*/
|
|
335
|
+
currency: string;
|
|
336
|
+
/**
|
|
337
|
+
* Currency symbol
|
|
338
|
+
* @example $
|
|
339
|
+
*/
|
|
340
|
+
currencySymbol?: string;
|
|
341
|
+
/**
|
|
342
|
+
* One-time setup fee
|
|
343
|
+
* @example 500
|
|
344
|
+
*/
|
|
345
|
+
setupFee?: number;
|
|
346
|
+
/**
|
|
347
|
+
* Free trial period in days
|
|
348
|
+
* @example 14
|
|
349
|
+
*/
|
|
350
|
+
trialDays?: number;
|
|
351
|
+
/**
|
|
352
|
+
* Billing cycle
|
|
353
|
+
* @example monthly
|
|
354
|
+
*/
|
|
355
|
+
billingCycle?: string;
|
|
356
|
+
/**
|
|
357
|
+
* Billing model
|
|
358
|
+
* @example pre-paid
|
|
359
|
+
*/
|
|
360
|
+
billingModel?: string;
|
|
361
|
+
/**
|
|
362
|
+
* Credits per usage unit (integer, >= 1)
|
|
363
|
+
* @example 1
|
|
364
|
+
*/
|
|
365
|
+
creditsPerUnit?: number;
|
|
366
|
+
/**
|
|
367
|
+
* What the plan measures for usage tracking
|
|
368
|
+
* @example requests
|
|
369
|
+
*/
|
|
370
|
+
measures?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Meter reference for usage-based limits
|
|
373
|
+
* @example mtr_1A2B3C4D
|
|
374
|
+
*/
|
|
375
|
+
meterRef?: string;
|
|
376
|
+
/**
|
|
377
|
+
* Usage limit for the meter
|
|
378
|
+
* @example 10000
|
|
379
|
+
*/
|
|
380
|
+
limit?: number;
|
|
381
|
+
/**
|
|
382
|
+
* Whether unused units roll over to next period
|
|
383
|
+
* @example false
|
|
384
|
+
*/
|
|
385
|
+
rolloverUnusedUnits?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Included free units
|
|
388
|
+
* @example 1000
|
|
389
|
+
*/
|
|
390
|
+
freeUnits?: number;
|
|
391
|
+
/** @description Usage limits */
|
|
392
|
+
limits?: {
|
|
393
|
+
[key: string]: unknown;
|
|
394
|
+
};
|
|
395
|
+
/** @description Plan features */
|
|
396
|
+
features?: {
|
|
397
|
+
[key: string]: unknown;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Whether payment is required
|
|
401
|
+
* @example true
|
|
402
|
+
*/
|
|
403
|
+
requiresPayment: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Whether the plan is active
|
|
406
|
+
* @example true
|
|
407
|
+
*/
|
|
408
|
+
isActive: boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Plan status
|
|
411
|
+
* @example active
|
|
412
|
+
*/
|
|
413
|
+
status: string;
|
|
414
|
+
/** @description Creation timestamp */
|
|
415
|
+
createdAt: string;
|
|
416
|
+
/** @description Last update timestamp */
|
|
417
|
+
updatedAt: string;
|
|
418
|
+
};
|
|
419
|
+
SdkProductResponse: {
|
|
420
|
+
/**
|
|
421
|
+
* Product reference
|
|
422
|
+
* @example prd_1A2B3C4D
|
|
423
|
+
*/
|
|
424
|
+
reference: string;
|
|
425
|
+
/**
|
|
426
|
+
* Product name
|
|
427
|
+
* @example AI Writing Assistant
|
|
428
|
+
*/
|
|
429
|
+
name: string;
|
|
430
|
+
/** @description Product description */
|
|
431
|
+
description?: string;
|
|
432
|
+
/** @description URL to the product image */
|
|
433
|
+
imageUrl?: string;
|
|
434
|
+
/** @description Free-form product type */
|
|
435
|
+
productType?: string;
|
|
436
|
+
/**
|
|
437
|
+
* Product status
|
|
438
|
+
* @example active
|
|
439
|
+
*/
|
|
440
|
+
status: string;
|
|
441
|
+
/**
|
|
442
|
+
* Product balance in cents
|
|
443
|
+
* @example 0
|
|
444
|
+
*/
|
|
445
|
+
balance: number;
|
|
446
|
+
/**
|
|
447
|
+
* Total number of transactions
|
|
448
|
+
* @example 0
|
|
449
|
+
*/
|
|
450
|
+
totalTransactions: number;
|
|
451
|
+
/**
|
|
452
|
+
* Whether this product uses MCP Pay proxy
|
|
453
|
+
* @example false
|
|
454
|
+
*/
|
|
455
|
+
isMcpPay: boolean;
|
|
456
|
+
/** @description Product-specific configuration */
|
|
457
|
+
config?: components["schemas"]["ProductConfigDto"];
|
|
458
|
+
/** @description Arbitrary key-value metadata */
|
|
459
|
+
metadata?: {
|
|
460
|
+
[key: string]: unknown;
|
|
461
|
+
};
|
|
462
|
+
/** @description Creation timestamp */
|
|
463
|
+
createdAt: string;
|
|
464
|
+
/** @description Last update timestamp */
|
|
465
|
+
updatedAt: string;
|
|
466
|
+
/** @description Plans associated with this product */
|
|
467
|
+
plans?: components["schemas"]["SdkPlanResponse"][];
|
|
468
|
+
/**
|
|
469
|
+
* MCP linkage details for MCP-enabled products
|
|
470
|
+
* @example {
|
|
471
|
+
* "mcpServerRef": "mcp_ABC123",
|
|
472
|
+
* "mcpSubdomain": "acme-docs",
|
|
473
|
+
* "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
|
|
474
|
+
* "originUrl": "https://origin.example.com/mcp",
|
|
475
|
+
* "defaultPlanRef": "pln_FREE123"
|
|
476
|
+
* }
|
|
477
|
+
*/
|
|
478
|
+
mcp?: {
|
|
479
|
+
[key: string]: unknown;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
UpdateProductRequest: {
|
|
483
|
+
name?: string;
|
|
484
|
+
description?: string;
|
|
485
|
+
imageUrl?: string;
|
|
486
|
+
productType?: string;
|
|
487
|
+
/** @enum {string} */
|
|
488
|
+
status?: "active" | "inactive" | "suspended";
|
|
489
|
+
config: {
|
|
490
|
+
fulfillmentType?: string;
|
|
491
|
+
validityPeriod?: number;
|
|
492
|
+
deliveryMethod?: string;
|
|
493
|
+
};
|
|
494
|
+
metadata: {
|
|
495
|
+
[key: string]: unknown;
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
McpBootstrapDto: {
|
|
499
|
+
name?: string;
|
|
500
|
+
description?: string;
|
|
501
|
+
imageUrl?: string;
|
|
502
|
+
productType?: string;
|
|
503
|
+
/** Format: uri */
|
|
504
|
+
originUrl: string;
|
|
505
|
+
mcpDomain?: string;
|
|
506
|
+
authHeaderName?: string;
|
|
507
|
+
authApiKey?: string;
|
|
508
|
+
plans?: {
|
|
509
|
+
key: string;
|
|
510
|
+
name: string;
|
|
511
|
+
price: number;
|
|
512
|
+
currency: string;
|
|
513
|
+
/** @enum {string} */
|
|
514
|
+
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
515
|
+
/** @enum {string} */
|
|
516
|
+
type?: "recurring" | "one-time" | "usage-based";
|
|
517
|
+
creditsPerUnit?: number;
|
|
518
|
+
/** @enum {string} */
|
|
519
|
+
billingModel?: "pre-paid" | "post-paid";
|
|
520
|
+
freeUnits?: number;
|
|
521
|
+
limit?: number;
|
|
522
|
+
features?: {
|
|
523
|
+
[key: string]: unknown;
|
|
524
|
+
};
|
|
525
|
+
}[];
|
|
526
|
+
tools?: {
|
|
527
|
+
name: string;
|
|
528
|
+
description?: string;
|
|
529
|
+
noPlan?: boolean;
|
|
530
|
+
planKeys?: string[];
|
|
531
|
+
}[];
|
|
532
|
+
metadata: {
|
|
533
|
+
[key: string]: unknown;
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
McpBootstrapResult: {
|
|
537
|
+
/** @description Created product */
|
|
538
|
+
product: components["schemas"]["SdkProductResponse"];
|
|
539
|
+
/**
|
|
540
|
+
* Created or updated MCP server identity
|
|
541
|
+
* @example {
|
|
542
|
+
* "reference": "mcp_ABC123",
|
|
543
|
+
* "subdomain": "acme-docs",
|
|
544
|
+
* "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
|
|
545
|
+
* "url": "https://origin.example.com/mcp",
|
|
546
|
+
* "defaultPlanRef": "pln_FREE123"
|
|
547
|
+
* }
|
|
548
|
+
*/
|
|
549
|
+
mcpServer: {
|
|
550
|
+
[key: string]: unknown;
|
|
551
|
+
};
|
|
552
|
+
/**
|
|
553
|
+
* Resolved plan mapping by bootstrap key
|
|
554
|
+
* @example {
|
|
555
|
+
* "free": {
|
|
556
|
+
* "reference": "pln_FREE123",
|
|
557
|
+
* "name": "Free"
|
|
558
|
+
* }
|
|
559
|
+
* }
|
|
560
|
+
*/
|
|
561
|
+
planMap: {
|
|
562
|
+
[key: string]: unknown;
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* True when tools were auto-discovered from origin because the request omitted tools
|
|
566
|
+
* @example true
|
|
567
|
+
*/
|
|
568
|
+
toolsAutoMapped?: boolean;
|
|
569
|
+
/** @description Auto-discovered tools used during bootstrap */
|
|
570
|
+
autoMappedTools?: {
|
|
571
|
+
name?: string;
|
|
572
|
+
description?: string;
|
|
573
|
+
}[];
|
|
574
|
+
};
|
|
575
|
+
ConfigureMcpPlansDto: {
|
|
576
|
+
plans?: {
|
|
577
|
+
key: string;
|
|
578
|
+
name: string;
|
|
579
|
+
price: number;
|
|
580
|
+
currency: string;
|
|
581
|
+
/** @enum {string} */
|
|
582
|
+
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
583
|
+
/** @enum {string} */
|
|
584
|
+
type?: "recurring" | "one-time" | "usage-based";
|
|
585
|
+
creditsPerUnit?: number;
|
|
586
|
+
/** @enum {string} */
|
|
587
|
+
billingModel?: "pre-paid" | "post-paid";
|
|
588
|
+
freeUnits?: number;
|
|
589
|
+
limit?: number;
|
|
590
|
+
features?: {
|
|
591
|
+
[key: string]: unknown;
|
|
592
|
+
};
|
|
593
|
+
}[];
|
|
594
|
+
toolMapping?: {
|
|
595
|
+
name: string;
|
|
596
|
+
planKeys: string[];
|
|
597
|
+
}[];
|
|
598
|
+
};
|
|
599
|
+
ConfigureMcpPlansResult: {
|
|
600
|
+
/** @description Updated product */
|
|
601
|
+
product: components["schemas"]["SdkProductResponse"];
|
|
602
|
+
/** @description Updated MCP server identity */
|
|
603
|
+
mcpServer: {
|
|
604
|
+
[key: string]: unknown;
|
|
605
|
+
};
|
|
606
|
+
/** @description Resolved plan mapping by key (includes existing free plan) */
|
|
607
|
+
planMap: {
|
|
608
|
+
[key: string]: unknown;
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
CloneProductDto: {
|
|
612
|
+
name?: string;
|
|
613
|
+
};
|
|
614
|
+
CreateUsageRequest: {
|
|
615
|
+
customerRef: string;
|
|
616
|
+
/**
|
|
617
|
+
* @default api_call
|
|
618
|
+
* @enum {string}
|
|
619
|
+
*/
|
|
620
|
+
actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
|
|
621
|
+
/** @default 1 */
|
|
622
|
+
units: number;
|
|
623
|
+
/**
|
|
624
|
+
* @default success
|
|
625
|
+
* @enum {string}
|
|
626
|
+
*/
|
|
627
|
+
outcome: "success" | "paywall" | "fail";
|
|
628
|
+
productRef?: string;
|
|
629
|
+
purchaseRef?: string;
|
|
630
|
+
description?: string;
|
|
631
|
+
errorMessage?: string;
|
|
632
|
+
metadata: {
|
|
633
|
+
[key: string]: unknown;
|
|
634
|
+
};
|
|
635
|
+
duration?: number;
|
|
636
|
+
/** Format: date-time */
|
|
637
|
+
timestamp: string;
|
|
638
|
+
idempotencyKey?: string;
|
|
639
|
+
};
|
|
640
|
+
BulkCreateUsageRequest: {
|
|
641
|
+
events: {
|
|
642
|
+
customerRef: string;
|
|
643
|
+
/**
|
|
644
|
+
* @default api_call
|
|
645
|
+
* @enum {string}
|
|
646
|
+
*/
|
|
647
|
+
actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
|
|
648
|
+
/** @default 1 */
|
|
649
|
+
units: number;
|
|
650
|
+
/**
|
|
651
|
+
* @default success
|
|
652
|
+
* @enum {string}
|
|
653
|
+
*/
|
|
654
|
+
outcome: "success" | "paywall" | "fail";
|
|
655
|
+
productRef?: string;
|
|
656
|
+
purchaseRef?: string;
|
|
657
|
+
description?: string;
|
|
658
|
+
errorMessage?: string;
|
|
659
|
+
metadata?: {
|
|
660
|
+
[key: string]: unknown;
|
|
661
|
+
};
|
|
662
|
+
duration?: number;
|
|
663
|
+
/** Format: date-time */
|
|
664
|
+
timestamp: string;
|
|
665
|
+
idempotencyKey?: string;
|
|
666
|
+
}[];
|
|
667
|
+
};
|
|
668
|
+
RecordMeterEventZodDto: {
|
|
669
|
+
meterName: string;
|
|
670
|
+
customerRef: string;
|
|
671
|
+
value?: number;
|
|
672
|
+
properties: {
|
|
673
|
+
[key: string]: unknown;
|
|
674
|
+
};
|
|
675
|
+
productRef?: string;
|
|
676
|
+
timestamp?: string;
|
|
677
|
+
};
|
|
678
|
+
RecordBulkMeterEventsZodDto: {
|
|
679
|
+
events: {
|
|
680
|
+
meterName: string;
|
|
681
|
+
customerRef: string;
|
|
682
|
+
value?: number;
|
|
683
|
+
properties?: {
|
|
684
|
+
[key: string]: unknown;
|
|
685
|
+
};
|
|
686
|
+
productRef?: string;
|
|
687
|
+
timestamp?: string;
|
|
688
|
+
}[];
|
|
689
|
+
};
|
|
690
|
+
UsageBillingDto: {
|
|
691
|
+
/**
|
|
692
|
+
* Units consumed in current period
|
|
693
|
+
* @example 150
|
|
694
|
+
*/
|
|
695
|
+
used: number;
|
|
696
|
+
/**
|
|
697
|
+
* Units exceeding the plan limit
|
|
698
|
+
* @example 0
|
|
699
|
+
*/
|
|
700
|
+
overageUnits: number;
|
|
701
|
+
/**
|
|
702
|
+
* Overage cost in cents
|
|
703
|
+
* @example 0
|
|
704
|
+
*/
|
|
705
|
+
overageCost: number;
|
|
706
|
+
/**
|
|
707
|
+
* Period start date
|
|
708
|
+
* @example 2025-10-01T00:00:00Z
|
|
709
|
+
*/
|
|
710
|
+
periodStart?: string;
|
|
711
|
+
/**
|
|
712
|
+
* Period end date
|
|
713
|
+
* @example 2025-11-01T00:00:00Z
|
|
714
|
+
*/
|
|
715
|
+
periodEnd?: string;
|
|
716
|
+
};
|
|
717
|
+
SdkPlanSnapshotDto: {
|
|
718
|
+
/**
|
|
719
|
+
* Plan reference
|
|
720
|
+
* @example pln_1A2B3C4D
|
|
721
|
+
*/
|
|
722
|
+
reference?: string;
|
|
723
|
+
/**
|
|
724
|
+
* Plan price in cents
|
|
725
|
+
* @example 2999
|
|
726
|
+
*/
|
|
727
|
+
price: number;
|
|
728
|
+
/**
|
|
729
|
+
* Currency code
|
|
730
|
+
* @example USD
|
|
731
|
+
*/
|
|
732
|
+
currency: string;
|
|
733
|
+
/**
|
|
734
|
+
* Plan type
|
|
735
|
+
* @example recurring
|
|
736
|
+
*/
|
|
737
|
+
planType: string;
|
|
738
|
+
/**
|
|
739
|
+
* Billing cycle
|
|
740
|
+
* @example monthly
|
|
741
|
+
*/
|
|
742
|
+
billingCycle?: string | null;
|
|
743
|
+
/** @description Plan features */
|
|
744
|
+
features?: {
|
|
745
|
+
[key: string]: unknown;
|
|
746
|
+
} | null;
|
|
747
|
+
/** @description Usage limits */
|
|
748
|
+
limits?: {
|
|
749
|
+
[key: string]: unknown;
|
|
750
|
+
} | null;
|
|
751
|
+
/**
|
|
752
|
+
* Meter reference
|
|
753
|
+
* @example mtr_1A2B3C4D
|
|
754
|
+
*/
|
|
755
|
+
meterRef?: string;
|
|
756
|
+
/**
|
|
757
|
+
* Usage limit for the meter
|
|
758
|
+
* @example 5000
|
|
759
|
+
*/
|
|
760
|
+
limit?: number;
|
|
761
|
+
/**
|
|
762
|
+
* Number of free units included
|
|
763
|
+
* @example 100
|
|
764
|
+
*/
|
|
765
|
+
freeUnits?: number;
|
|
766
|
+
/**
|
|
767
|
+
* Credits per usage unit (integer, >= 1)
|
|
768
|
+
* @example 1
|
|
769
|
+
*/
|
|
770
|
+
creditsPerUnit?: number;
|
|
771
|
+
};
|
|
772
|
+
SdkPurchaseResponse: {
|
|
773
|
+
/**
|
|
774
|
+
* Purchase reference
|
|
775
|
+
* @example pur_1A2B3C4D
|
|
776
|
+
*/
|
|
777
|
+
reference: string;
|
|
778
|
+
/**
|
|
779
|
+
* Customer reference
|
|
780
|
+
* @example cus_3C4D5E6F
|
|
781
|
+
*/
|
|
782
|
+
customerRef: string;
|
|
783
|
+
/**
|
|
784
|
+
* Customer email
|
|
785
|
+
* @example customer@example.com
|
|
786
|
+
*/
|
|
787
|
+
customerEmail: string;
|
|
788
|
+
/**
|
|
789
|
+
* Product reference
|
|
790
|
+
* @example prd_1A2B3C4D
|
|
791
|
+
*/
|
|
792
|
+
productRef: string;
|
|
793
|
+
/**
|
|
794
|
+
* Product name
|
|
795
|
+
* @example API Gateway Manager
|
|
796
|
+
*/
|
|
797
|
+
productName?: string;
|
|
798
|
+
/** @description Plan snapshot at time of purchase (null for credit topups) */
|
|
799
|
+
planSnapshot?: components["schemas"]["SdkPlanSnapshotDto"];
|
|
800
|
+
/**
|
|
801
|
+
* Purchase status
|
|
802
|
+
* @example active
|
|
803
|
+
*/
|
|
804
|
+
status: string;
|
|
805
|
+
/**
|
|
806
|
+
* Amount in USD cents (normalised for aggregation)
|
|
807
|
+
* @example 9900
|
|
808
|
+
*/
|
|
809
|
+
amount: number;
|
|
810
|
+
/**
|
|
811
|
+
* Original amount in the payment currency (cents/pence)
|
|
812
|
+
* @example 10000
|
|
813
|
+
*/
|
|
814
|
+
originalAmount?: number;
|
|
815
|
+
/**
|
|
816
|
+
* Original payment currency code
|
|
817
|
+
* @example GBP
|
|
818
|
+
*/
|
|
819
|
+
currency: string;
|
|
820
|
+
/**
|
|
821
|
+
* Exchange rate from original currency to USD
|
|
822
|
+
* @example 1.3082
|
|
823
|
+
*/
|
|
824
|
+
exchangeRate?: number;
|
|
825
|
+
/** @description Start date */
|
|
826
|
+
startDate: string;
|
|
827
|
+
/** @description End date */
|
|
828
|
+
endDate?: string;
|
|
829
|
+
/** @description Paid at timestamp */
|
|
830
|
+
paidAt?: string;
|
|
831
|
+
/** @description Usage billing state for usage-based plans */
|
|
832
|
+
usage?: components["schemas"]["UsageBillingDto"];
|
|
833
|
+
/**
|
|
834
|
+
* Is recurring
|
|
835
|
+
* @example true
|
|
836
|
+
*/
|
|
837
|
+
isRecurring: boolean;
|
|
838
|
+
/**
|
|
839
|
+
* Billing cycle
|
|
840
|
+
* @enum {string}
|
|
841
|
+
*/
|
|
842
|
+
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly";
|
|
843
|
+
/** @description Next billing date */
|
|
844
|
+
nextBillingDate?: string;
|
|
845
|
+
/** @description Auto-renew enabled */
|
|
846
|
+
autoRenew?: boolean;
|
|
847
|
+
/** @description Cancelled at */
|
|
848
|
+
cancelledAt?: string;
|
|
849
|
+
/** @description Cancellation reason */
|
|
850
|
+
cancellationReason?: string;
|
|
851
|
+
/** @description Arbitrary metadata attached to the purchase */
|
|
852
|
+
metadata?: {
|
|
853
|
+
[key: string]: unknown;
|
|
854
|
+
};
|
|
855
|
+
/** @description Created at */
|
|
856
|
+
createdAt: string;
|
|
857
|
+
};
|
|
858
|
+
CheckLimitRequest: {
|
|
859
|
+
customerRef: string;
|
|
860
|
+
productRef: string;
|
|
861
|
+
meterName?: string;
|
|
862
|
+
usageType?: string;
|
|
863
|
+
};
|
|
864
|
+
LimitPlanItemDto: {
|
|
865
|
+
reference: string;
|
|
866
|
+
name?: string;
|
|
867
|
+
type: string;
|
|
868
|
+
/** @description Price in smallest currency unit (e.g. cents) */
|
|
869
|
+
price: number;
|
|
870
|
+
currency: string;
|
|
871
|
+
requiresPayment: boolean;
|
|
872
|
+
freeUnits?: number;
|
|
873
|
+
/** @description Credits per usage unit (usage-based plans) */
|
|
874
|
+
creditsPerUnit?: number;
|
|
875
|
+
billingModel?: string;
|
|
876
|
+
billingCycle?: string;
|
|
877
|
+
};
|
|
878
|
+
LimitBalanceDto: {
|
|
879
|
+
/** @description Credit balance in mils */
|
|
880
|
+
creditBalance: number;
|
|
881
|
+
/** @description Credits per usage unit */
|
|
882
|
+
creditsPerUnit: number;
|
|
883
|
+
currency: string;
|
|
884
|
+
/** @description Estimated whole units remaining from prepaid credit balance */
|
|
885
|
+
remainingUnits?: number;
|
|
886
|
+
};
|
|
887
|
+
LimitProductBriefDto: {
|
|
888
|
+
reference: string;
|
|
889
|
+
name?: string;
|
|
890
|
+
};
|
|
891
|
+
LimitResponse: {
|
|
892
|
+
/**
|
|
893
|
+
* Whether the customer is within their usage limits
|
|
894
|
+
* @example true
|
|
895
|
+
*/
|
|
896
|
+
withinLimits: boolean;
|
|
897
|
+
/**
|
|
898
|
+
* Remaining usage units before hitting the limit
|
|
899
|
+
* @example 997
|
|
900
|
+
*/
|
|
901
|
+
remaining: number;
|
|
902
|
+
/**
|
|
903
|
+
* Checkout session ID if payment is required
|
|
904
|
+
* @example e3f1c2d4b6a89f001122334455667788
|
|
905
|
+
*/
|
|
906
|
+
checkoutSessionId?: string;
|
|
907
|
+
/**
|
|
908
|
+
* Checkout URL if payment is required
|
|
909
|
+
* @example https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788
|
|
910
|
+
*/
|
|
911
|
+
checkoutUrl?: string;
|
|
912
|
+
/**
|
|
913
|
+
* The meter name to use when tracking usage events
|
|
914
|
+
* @example requests
|
|
915
|
+
*/
|
|
916
|
+
meterName?: string;
|
|
917
|
+
/** @description Credit balance in mils (for pre-paid usage-based plans) */
|
|
918
|
+
creditBalance?: number;
|
|
919
|
+
/** @description Credits per usage unit (for pre-paid usage-based plans) */
|
|
920
|
+
creditsPerUnit?: number;
|
|
921
|
+
/** @description ISO 4217 currency code for credit fields */
|
|
922
|
+
currency?: string;
|
|
923
|
+
/** @description True when the customer must activate a priced default plan before usage is allowed */
|
|
924
|
+
activationRequired?: boolean;
|
|
925
|
+
/** @description Active plans on the product available for activation or checkout */
|
|
926
|
+
plans?: components["schemas"]["LimitPlanItemDto"][];
|
|
927
|
+
/** @description Prepaid usage balance context when the default plan is usage-based */
|
|
928
|
+
balance?: components["schemas"]["LimitBalanceDto"];
|
|
929
|
+
/** @description Product the limit check applies to */
|
|
930
|
+
product?: components["schemas"]["LimitProductBriefDto"];
|
|
931
|
+
/** @description Customer portal confirmation URL when activation is required (fallback when not starting checkout) */
|
|
932
|
+
confirmationUrl?: string;
|
|
933
|
+
};
|
|
934
|
+
ActivatePlanDto: {
|
|
935
|
+
customerRef: string;
|
|
936
|
+
productRef: string;
|
|
937
|
+
planRef: string;
|
|
938
|
+
};
|
|
939
|
+
ActivatePlanResponseDto: {
|
|
940
|
+
/** @enum {string} */
|
|
941
|
+
status: "activated" | "already_active" | "topup_required" | "payment_required" | "invalid";
|
|
942
|
+
purchaseRef?: string;
|
|
943
|
+
message?: string;
|
|
944
|
+
creditBalance?: number;
|
|
945
|
+
creditsPerUnit?: number;
|
|
946
|
+
currency?: string;
|
|
947
|
+
checkoutUrl?: string;
|
|
948
|
+
checkoutSessionId?: string;
|
|
949
|
+
};
|
|
950
|
+
CreateCustomerRequest: {
|
|
951
|
+
/** Format: email */
|
|
952
|
+
email: string;
|
|
953
|
+
name?: string;
|
|
954
|
+
telephone?: string;
|
|
955
|
+
metadata: {
|
|
956
|
+
[key: string]: unknown;
|
|
957
|
+
};
|
|
958
|
+
externalRef?: string;
|
|
959
|
+
};
|
|
960
|
+
CreateCustomerSessionRequest: {
|
|
961
|
+
customerRef: string;
|
|
962
|
+
productRef?: string;
|
|
963
|
+
};
|
|
964
|
+
PurchaseInfo: {
|
|
965
|
+
/**
|
|
966
|
+
* Purchase reference
|
|
967
|
+
* @example pur_1A2B3C4D
|
|
968
|
+
*/
|
|
969
|
+
reference: string;
|
|
970
|
+
/**
|
|
971
|
+
* Product name
|
|
972
|
+
* @example API Gateway Manager
|
|
973
|
+
*/
|
|
974
|
+
productName: string;
|
|
975
|
+
/**
|
|
976
|
+
* Product reference
|
|
977
|
+
* @example prd_abc123
|
|
978
|
+
*/
|
|
979
|
+
productRef?: string;
|
|
980
|
+
/**
|
|
981
|
+
* Purchase status
|
|
982
|
+
* @example active
|
|
983
|
+
*/
|
|
984
|
+
status: string;
|
|
985
|
+
/**
|
|
986
|
+
* Start date
|
|
987
|
+
* @example 2025-10-27T10:00:00Z
|
|
988
|
+
*/
|
|
989
|
+
startDate: string;
|
|
990
|
+
/**
|
|
991
|
+
* Amount in USD cents (normalised for aggregation)
|
|
992
|
+
* @example 9900
|
|
993
|
+
*/
|
|
994
|
+
amount: number;
|
|
995
|
+
/**
|
|
996
|
+
* Original amount in the payment currency (minor units)
|
|
997
|
+
* @example 7500
|
|
998
|
+
*/
|
|
999
|
+
originalAmount?: number;
|
|
1000
|
+
/**
|
|
1001
|
+
* ISO 4217 currency code of the customer-facing charge
|
|
1002
|
+
* @example GBP
|
|
1003
|
+
*/
|
|
1004
|
+
currency: string;
|
|
1005
|
+
/**
|
|
1006
|
+
* Exchange rate from original currency to USD
|
|
1007
|
+
* @example 1.32
|
|
1008
|
+
*/
|
|
1009
|
+
exchangeRate?: number;
|
|
1010
|
+
/**
|
|
1011
|
+
* End date of purchase
|
|
1012
|
+
* @example 2025-11-27T10:00:00Z
|
|
1013
|
+
*/
|
|
1014
|
+
endDate?: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* When purchase was cancelled
|
|
1017
|
+
* @example 2025-10-28T10:00:00Z
|
|
1018
|
+
*/
|
|
1019
|
+
cancelledAt?: string;
|
|
1020
|
+
/**
|
|
1021
|
+
* Reason for cancellation
|
|
1022
|
+
* @example Customer request
|
|
1023
|
+
*/
|
|
1024
|
+
cancellationReason?: string;
|
|
1025
|
+
/**
|
|
1026
|
+
* Plan reference from the plan snapshot, for reliable plan matching
|
|
1027
|
+
* @example pln_abc123
|
|
1028
|
+
*/
|
|
1029
|
+
planRef?: string;
|
|
1030
|
+
/** @description Snapshot of the plan at time of purchase */
|
|
1031
|
+
planSnapshot?: Record<string, never>;
|
|
1032
|
+
};
|
|
1033
|
+
CustomerResponse: {
|
|
1034
|
+
/**
|
|
1035
|
+
* Customer reference identifier
|
|
1036
|
+
* @example cus_3c4d5e6f7g8h
|
|
1037
|
+
*/
|
|
1038
|
+
reference: string;
|
|
1039
|
+
/**
|
|
1040
|
+
* Customer full name
|
|
1041
|
+
* @example John Doe
|
|
1042
|
+
*/
|
|
1043
|
+
name: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* Customer email address
|
|
1046
|
+
* @example customer@example.com
|
|
1047
|
+
*/
|
|
1048
|
+
email: string;
|
|
1049
|
+
/**
|
|
1050
|
+
* External reference ID from your auth system (if set during creation or update)
|
|
1051
|
+
* @example auth_user_12345
|
|
1052
|
+
*/
|
|
1053
|
+
externalRef?: string;
|
|
1054
|
+
/** @description Active purchases */
|
|
1055
|
+
purchases?: components["schemas"]["PurchaseInfo"][];
|
|
1056
|
+
};
|
|
1057
|
+
UpdateCustomerRequest: {
|
|
1058
|
+
/** Format: email */
|
|
1059
|
+
email?: string;
|
|
1060
|
+
name?: string;
|
|
1061
|
+
telephone?: string;
|
|
1062
|
+
metadata?: unknown;
|
|
1063
|
+
externalRef?: string;
|
|
1064
|
+
};
|
|
1065
|
+
CreateCustomerSessionResponse: {
|
|
1066
|
+
/**
|
|
1067
|
+
* Customer session ID/token
|
|
1068
|
+
* @example e3f1c2d4b6a89f001122334455667788
|
|
1069
|
+
*/
|
|
1070
|
+
sessionId: string;
|
|
1071
|
+
/**
|
|
1072
|
+
* Full customer URL based on backend configuration (ready to redirect customer)
|
|
1073
|
+
* @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
|
|
1074
|
+
*/
|
|
1075
|
+
customerUrl: string;
|
|
1076
|
+
};
|
|
1077
|
+
GetCustomerSessionResponse: {
|
|
1078
|
+
/**
|
|
1079
|
+
* Customer session ID/token
|
|
1080
|
+
* @example e3f1c2d4b6a89f001122334455667788
|
|
1081
|
+
*/
|
|
1082
|
+
sessionId: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Session status
|
|
1085
|
+
* @example active
|
|
1086
|
+
* @enum {string}
|
|
1087
|
+
*/
|
|
1088
|
+
status: "active" | "expired" | "used";
|
|
1089
|
+
/**
|
|
1090
|
+
* Full customer URL based on backend configuration (ready to redirect customer)
|
|
1091
|
+
* @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
|
|
1092
|
+
*/
|
|
1093
|
+
customerUrl: string;
|
|
1094
|
+
/**
|
|
1095
|
+
* Session expiration date
|
|
1096
|
+
* @example 2025-01-01T12:00:00.000Z
|
|
1097
|
+
*/
|
|
1098
|
+
expiresAt: string;
|
|
1099
|
+
/** @description Customer object from session data */
|
|
1100
|
+
customer: components["schemas"]["CustomerResponse"];
|
|
1101
|
+
/**
|
|
1102
|
+
* Session creation date
|
|
1103
|
+
* @example 2025-01-01T11:45:00.000Z
|
|
1104
|
+
*/
|
|
1105
|
+
createdAt: string;
|
|
1106
|
+
/**
|
|
1107
|
+
* Session last update date
|
|
1108
|
+
* @example 2025-01-01T11:45:00.000Z
|
|
1109
|
+
*/
|
|
1110
|
+
updatedAt: string;
|
|
1111
|
+
};
|
|
1112
|
+
UserInfoRequest: {
|
|
1113
|
+
customerRef: string;
|
|
1114
|
+
productRef: string;
|
|
1115
|
+
};
|
|
1116
|
+
UserInfoUserDto: {
|
|
1117
|
+
/** @example cus_3C4D5E6F */
|
|
1118
|
+
reference: string;
|
|
1119
|
+
/** @example John Doe */
|
|
1120
|
+
name?: string | null;
|
|
1121
|
+
/** @example john@example.com */
|
|
1122
|
+
email: string;
|
|
1123
|
+
/** @example auth_user_12345 */
|
|
1124
|
+
externalRef?: string | null;
|
|
1125
|
+
};
|
|
1126
|
+
UserInfoUsageDto: {
|
|
1127
|
+
/** @example 1000 */
|
|
1128
|
+
total: number;
|
|
1129
|
+
/** @example 250 */
|
|
1130
|
+
used: number;
|
|
1131
|
+
/** @example 750 */
|
|
1132
|
+
remaining: number;
|
|
1133
|
+
/**
|
|
1134
|
+
* Meter reference
|
|
1135
|
+
* @example meter_ABC123
|
|
1136
|
+
*/
|
|
1137
|
+
meterRef?: string | null;
|
|
1138
|
+
/** @example 25 */
|
|
1139
|
+
percentUsed?: number | null;
|
|
1140
|
+
};
|
|
1141
|
+
UserInfoPlanDto: {
|
|
1142
|
+
/** @example pln_2B3C4D5E */
|
|
1143
|
+
reference: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Price in minor currency units (e.g. cents)
|
|
1146
|
+
* @example 2999
|
|
1147
|
+
*/
|
|
1148
|
+
price: number;
|
|
1149
|
+
/** @example USD */
|
|
1150
|
+
currency: string;
|
|
1151
|
+
/** @example recurring */
|
|
1152
|
+
type: string;
|
|
1153
|
+
/** @example monthly */
|
|
1154
|
+
billingCycle?: string | null;
|
|
1155
|
+
features?: string[] | null;
|
|
1156
|
+
limits?: {
|
|
1157
|
+
[key: string]: unknown;
|
|
1158
|
+
} | null;
|
|
1159
|
+
};
|
|
1160
|
+
UserInfoPurchaseDto: {
|
|
1161
|
+
/** @example pur_1A2B3C4D */
|
|
1162
|
+
reference: string;
|
|
1163
|
+
/** @example active */
|
|
1164
|
+
status: string;
|
|
1165
|
+
/** @example My API Product */
|
|
1166
|
+
productName: string;
|
|
1167
|
+
/** @example recurring */
|
|
1168
|
+
planType: string;
|
|
1169
|
+
/** @example 2025-10-27T10:00:00Z */
|
|
1170
|
+
startDate?: string | null;
|
|
1171
|
+
/** @example 2025-11-27T10:00:00Z */
|
|
1172
|
+
endDate?: string | null;
|
|
1173
|
+
usage?: components["schemas"]["UserInfoUsageDto"];
|
|
1174
|
+
plan?: components["schemas"]["UserInfoPlanDto"];
|
|
1175
|
+
};
|
|
1176
|
+
UserInfoResponse: {
|
|
1177
|
+
/**
|
|
1178
|
+
* Human-readable status summary
|
|
1179
|
+
* @example Active subscription: My API Product (25% usage consumed)
|
|
1180
|
+
*/
|
|
1181
|
+
status: string;
|
|
1182
|
+
/**
|
|
1183
|
+
* Customer portal session URL
|
|
1184
|
+
* @example https://solvapay.com/customer/manage?id=abc123
|
|
1185
|
+
*/
|
|
1186
|
+
verifyUrl?: string | null;
|
|
1187
|
+
user?: components["schemas"]["UserInfoUserDto"];
|
|
1188
|
+
purchase?: components["schemas"]["UserInfoPurchaseDto"];
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
responses: never;
|
|
1192
|
+
parameters: never;
|
|
1193
|
+
requestBodies: never;
|
|
1194
|
+
headers: never;
|
|
1195
|
+
pathItems: never;
|
|
1196
|
+
}
|
|
1197
|
+
interface operations {
|
|
1198
|
+
getMerchant: {
|
|
1199
|
+
parameters: {
|
|
1200
|
+
query?: never;
|
|
1201
|
+
header?: never;
|
|
1202
|
+
path?: never;
|
|
1203
|
+
cookie?: never;
|
|
1204
|
+
};
|
|
1205
|
+
requestBody?: never;
|
|
1206
|
+
responses: {
|
|
1207
|
+
/** @description Merchant identity */
|
|
1208
|
+
200: {
|
|
1209
|
+
headers: {
|
|
1210
|
+
[name: string]: unknown;
|
|
1211
|
+
};
|
|
1212
|
+
content: {
|
|
1213
|
+
"application/json": components["schemas"]["SdkMerchantResponseDto"];
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
/** @description Provider not found */
|
|
1217
|
+
404: {
|
|
1218
|
+
headers: {
|
|
1219
|
+
[name: string]: unknown;
|
|
1220
|
+
};
|
|
1221
|
+
content?: never;
|
|
1222
|
+
};
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
getPlatformConfig: {
|
|
1226
|
+
parameters: {
|
|
1227
|
+
query?: never;
|
|
1228
|
+
header?: never;
|
|
1229
|
+
path?: never;
|
|
1230
|
+
cookie?: never;
|
|
1231
|
+
};
|
|
1232
|
+
requestBody?: never;
|
|
1233
|
+
responses: {
|
|
1234
|
+
/** @description Platform config */
|
|
1235
|
+
200: {
|
|
1236
|
+
headers: {
|
|
1237
|
+
[name: string]: unknown;
|
|
1238
|
+
};
|
|
1239
|
+
content: {
|
|
1240
|
+
"application/json": components["schemas"]["SdkPlatformConfigResponseDto"];
|
|
1241
|
+
};
|
|
1242
|
+
};
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
PaymentIntentSdkController_getPaymentIntents: {
|
|
1246
|
+
parameters: {
|
|
1247
|
+
query?: {
|
|
1248
|
+
/** @description Maximum number of results */
|
|
1249
|
+
limit?: number;
|
|
1250
|
+
/** @description Pagination offset */
|
|
1251
|
+
offset?: number;
|
|
1252
|
+
};
|
|
1253
|
+
header?: never;
|
|
1254
|
+
path?: never;
|
|
1255
|
+
cookie?: never;
|
|
1256
|
+
};
|
|
1257
|
+
requestBody?: never;
|
|
1258
|
+
responses: {
|
|
1259
|
+
/** @description Payment intents retrieved successfully */
|
|
1260
|
+
200: {
|
|
1261
|
+
headers: {
|
|
1262
|
+
[name: string]: unknown;
|
|
1263
|
+
};
|
|
1264
|
+
content: {
|
|
1265
|
+
"application/json": unknown;
|
|
1266
|
+
};
|
|
1267
|
+
};
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
PaymentIntentSdkController_createPaymentIntent: {
|
|
1271
|
+
parameters: {
|
|
1272
|
+
query?: never;
|
|
1273
|
+
header: {
|
|
1274
|
+
/** @description Unique idempotency key to prevent duplicate payments (required) */
|
|
1275
|
+
"idempotency-key": string;
|
|
1276
|
+
};
|
|
1277
|
+
path?: never;
|
|
1278
|
+
cookie?: never;
|
|
1279
|
+
};
|
|
1280
|
+
/** @description Payment intent creation data */
|
|
1281
|
+
requestBody: {
|
|
1282
|
+
content: {
|
|
1283
|
+
"application/json": components["schemas"]["CreatePaymentIntentDto"];
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
responses: {
|
|
1287
|
+
/** @description Payment intent created successfully */
|
|
1288
|
+
201: {
|
|
1289
|
+
headers: {
|
|
1290
|
+
[name: string]: unknown;
|
|
1291
|
+
};
|
|
1292
|
+
content: {
|
|
1293
|
+
"application/json": unknown;
|
|
1294
|
+
};
|
|
1295
|
+
};
|
|
1296
|
+
/** @description Missing required fields or invalid data */
|
|
1297
|
+
400: {
|
|
1298
|
+
headers: {
|
|
1299
|
+
[name: string]: unknown;
|
|
1300
|
+
};
|
|
1301
|
+
content: {
|
|
1302
|
+
"application/json": unknown;
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1307
|
+
PaymentIntentSdkController_getPaymentIntent: {
|
|
1308
|
+
parameters: {
|
|
1309
|
+
query?: never;
|
|
1310
|
+
header?: never;
|
|
1311
|
+
path: {
|
|
1312
|
+
/** @description Payment intent reference or processor payment ID */
|
|
1313
|
+
reference: string;
|
|
1314
|
+
};
|
|
1315
|
+
cookie?: never;
|
|
1316
|
+
};
|
|
1317
|
+
requestBody?: never;
|
|
1318
|
+
responses: {
|
|
1319
|
+
/** @description Payment intent retrieved successfully */
|
|
1320
|
+
200: {
|
|
1321
|
+
headers: {
|
|
1322
|
+
[name: string]: unknown;
|
|
1323
|
+
};
|
|
1324
|
+
content: {
|
|
1325
|
+
"application/json": unknown;
|
|
1326
|
+
};
|
|
1327
|
+
};
|
|
1328
|
+
/** @description Payment intent not found */
|
|
1329
|
+
404: {
|
|
1330
|
+
headers: {
|
|
1331
|
+
[name: string]: unknown;
|
|
1332
|
+
};
|
|
1333
|
+
content: {
|
|
1334
|
+
"application/json": unknown;
|
|
1335
|
+
};
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
PaymentIntentSdkController_processPaymentIntent: {
|
|
1340
|
+
parameters: {
|
|
1341
|
+
query?: never;
|
|
1342
|
+
header?: never;
|
|
1343
|
+
path: {
|
|
1344
|
+
/** @description Payment processor ID returned from createPaymentIntent */
|
|
1345
|
+
processorPaymentId: string;
|
|
1346
|
+
};
|
|
1347
|
+
cookie?: never;
|
|
1348
|
+
};
|
|
1349
|
+
/** @description Payment processing data */
|
|
1350
|
+
requestBody: {
|
|
1351
|
+
content: {
|
|
1352
|
+
"application/json": components["schemas"]["ProcessPaymentIntentDto"];
|
|
1353
|
+
};
|
|
1354
|
+
};
|
|
1355
|
+
responses: {
|
|
1356
|
+
/** @description Payment intent status */
|
|
1357
|
+
200: {
|
|
1358
|
+
headers: {
|
|
1359
|
+
[name: string]: unknown;
|
|
1360
|
+
};
|
|
1361
|
+
content: {
|
|
1362
|
+
"application/json": {
|
|
1363
|
+
/**
|
|
1364
|
+
* Payment intent status
|
|
1365
|
+
* @example succeeded
|
|
1366
|
+
* @enum {string}
|
|
1367
|
+
*/
|
|
1368
|
+
status?: "succeeded" | "timeout" | "failed" | "cancelled";
|
|
1369
|
+
/**
|
|
1370
|
+
* Optional message, only present for timeout status
|
|
1371
|
+
* @example Timeout while waiting for payment intent confirmation, try again later. This could be due to payment webhooks not being configured correctly.
|
|
1372
|
+
*/
|
|
1373
|
+
message?: string;
|
|
1374
|
+
};
|
|
1375
|
+
};
|
|
1376
|
+
};
|
|
1377
|
+
/** @description Payment not succeeded, invalid request, or forbidden */
|
|
1378
|
+
400: {
|
|
1379
|
+
headers: {
|
|
1380
|
+
[name: string]: unknown;
|
|
1381
|
+
};
|
|
1382
|
+
content: {
|
|
1383
|
+
"application/json": unknown;
|
|
1384
|
+
};
|
|
1385
|
+
};
|
|
1386
|
+
};
|
|
1387
|
+
};
|
|
1388
|
+
CheckoutSessionSdkController_createCheckoutSession: {
|
|
1389
|
+
parameters: {
|
|
1390
|
+
query?: never;
|
|
1391
|
+
header?: never;
|
|
1392
|
+
path?: never;
|
|
1393
|
+
cookie?: never;
|
|
1394
|
+
};
|
|
1395
|
+
requestBody: {
|
|
1396
|
+
content: {
|
|
1397
|
+
"application/json": components["schemas"]["CreateCheckoutSessionRequest"];
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
responses: {
|
|
1401
|
+
/** @description Checkout session created */
|
|
1402
|
+
201: {
|
|
1403
|
+
headers: {
|
|
1404
|
+
[name: string]: unknown;
|
|
1405
|
+
};
|
|
1406
|
+
content: {
|
|
1407
|
+
"application/json": components["schemas"]["CreateCheckoutSessionResponse"];
|
|
1408
|
+
};
|
|
1409
|
+
};
|
|
1410
|
+
/** @description Missing customerRef or productRef */
|
|
1411
|
+
400: {
|
|
1412
|
+
headers: {
|
|
1413
|
+
[name: string]: unknown;
|
|
1414
|
+
};
|
|
1415
|
+
content?: never;
|
|
1416
|
+
};
|
|
1417
|
+
};
|
|
1418
|
+
};
|
|
1419
|
+
PlanSdkController_listPlans: {
|
|
1420
|
+
parameters: {
|
|
1421
|
+
query?: {
|
|
1422
|
+
limit?: number;
|
|
1423
|
+
offset?: number;
|
|
1424
|
+
};
|
|
1425
|
+
header?: never;
|
|
1426
|
+
path: {
|
|
1427
|
+
/** @description Product reference or ID */
|
|
1428
|
+
productRef: string;
|
|
1429
|
+
};
|
|
1430
|
+
cookie?: never;
|
|
1431
|
+
};
|
|
1432
|
+
requestBody?: never;
|
|
1433
|
+
responses: {
|
|
1434
|
+
/** @description Plans retrieved successfully */
|
|
1435
|
+
200: {
|
|
1436
|
+
headers: {
|
|
1437
|
+
[name: string]: unknown;
|
|
1438
|
+
};
|
|
1439
|
+
content: {
|
|
1440
|
+
"application/json": {
|
|
1441
|
+
plans?: components["schemas"]["Plan"][];
|
|
1442
|
+
/** @description Total number of plans for the product */
|
|
1443
|
+
total?: number;
|
|
1444
|
+
limit?: number;
|
|
1445
|
+
offset?: number;
|
|
1446
|
+
};
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
/** @description Product not found */
|
|
1450
|
+
404: {
|
|
1451
|
+
headers: {
|
|
1452
|
+
[name: string]: unknown;
|
|
1453
|
+
};
|
|
1454
|
+
content?: never;
|
|
1455
|
+
};
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
PlanSdkController_createPlan: {
|
|
1459
|
+
parameters: {
|
|
1460
|
+
query?: never;
|
|
1461
|
+
header?: never;
|
|
1462
|
+
path: {
|
|
1463
|
+
/** @description Product reference or ID */
|
|
1464
|
+
productRef: string;
|
|
1465
|
+
};
|
|
1466
|
+
cookie?: never;
|
|
1467
|
+
};
|
|
1468
|
+
requestBody: {
|
|
1469
|
+
content: {
|
|
1470
|
+
"application/json": components["schemas"]["CreatePlanRequest"];
|
|
1471
|
+
};
|
|
1472
|
+
};
|
|
1473
|
+
responses: {
|
|
1474
|
+
/** @description Plan created successfully */
|
|
1475
|
+
201: {
|
|
1476
|
+
headers: {
|
|
1477
|
+
[name: string]: unknown;
|
|
1478
|
+
};
|
|
1479
|
+
content: {
|
|
1480
|
+
"application/json": components["schemas"]["Plan"];
|
|
1481
|
+
};
|
|
1482
|
+
};
|
|
1483
|
+
/** @description Product not found */
|
|
1484
|
+
404: {
|
|
1485
|
+
headers: {
|
|
1486
|
+
[name: string]: unknown;
|
|
1487
|
+
};
|
|
1488
|
+
content?: never;
|
|
1489
|
+
};
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
PlanSdkController_getPlan: {
|
|
1493
|
+
parameters: {
|
|
1494
|
+
query?: never;
|
|
1495
|
+
header?: never;
|
|
1496
|
+
path: {
|
|
1497
|
+
/** @description Product reference or ID */
|
|
1498
|
+
productRef: string;
|
|
1499
|
+
/** @description Plan reference or ID */
|
|
1500
|
+
planRef: string;
|
|
1501
|
+
};
|
|
1502
|
+
cookie?: never;
|
|
1503
|
+
};
|
|
1504
|
+
requestBody?: never;
|
|
1505
|
+
responses: {
|
|
1506
|
+
/** @description Plan retrieved successfully */
|
|
1507
|
+
200: {
|
|
1508
|
+
headers: {
|
|
1509
|
+
[name: string]: unknown;
|
|
1510
|
+
};
|
|
1511
|
+
content: {
|
|
1512
|
+
"application/json": components["schemas"]["Plan"];
|
|
1513
|
+
};
|
|
1514
|
+
};
|
|
1515
|
+
/** @description Plan or product not found */
|
|
1516
|
+
404: {
|
|
1517
|
+
headers: {
|
|
1518
|
+
[name: string]: unknown;
|
|
1519
|
+
};
|
|
1520
|
+
content?: never;
|
|
1521
|
+
};
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
PlanSdkController_updatePlan: {
|
|
1525
|
+
parameters: {
|
|
1526
|
+
query?: never;
|
|
1527
|
+
header?: never;
|
|
1528
|
+
path: {
|
|
1529
|
+
/** @description Product reference or ID */
|
|
1530
|
+
productRef: string;
|
|
1531
|
+
/** @description Plan reference or ID */
|
|
1532
|
+
planRef: string;
|
|
1533
|
+
};
|
|
1534
|
+
cookie?: never;
|
|
1535
|
+
};
|
|
1536
|
+
requestBody: {
|
|
1537
|
+
content: {
|
|
1538
|
+
"application/json": components["schemas"]["UpdatePlanRequest"];
|
|
1539
|
+
};
|
|
1540
|
+
};
|
|
1541
|
+
responses: {
|
|
1542
|
+
/** @description Plan updated successfully */
|
|
1543
|
+
200: {
|
|
1544
|
+
headers: {
|
|
1545
|
+
[name: string]: unknown;
|
|
1546
|
+
};
|
|
1547
|
+
content: {
|
|
1548
|
+
"application/json": components["schemas"]["Plan"];
|
|
1549
|
+
};
|
|
1550
|
+
};
|
|
1551
|
+
/** @description Plan or product not found */
|
|
1552
|
+
404: {
|
|
1553
|
+
headers: {
|
|
1554
|
+
[name: string]: unknown;
|
|
1555
|
+
};
|
|
1556
|
+
content?: never;
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
};
|
|
1560
|
+
PlanSdkController_deletePlan: {
|
|
1561
|
+
parameters: {
|
|
1562
|
+
query?: never;
|
|
1563
|
+
header?: never;
|
|
1564
|
+
path: {
|
|
1565
|
+
/** @description Product reference or ID */
|
|
1566
|
+
productRef: string;
|
|
1567
|
+
/** @description Plan reference or ID */
|
|
1568
|
+
planRef: string;
|
|
1569
|
+
};
|
|
1570
|
+
cookie?: never;
|
|
1571
|
+
};
|
|
1572
|
+
requestBody?: never;
|
|
1573
|
+
responses: {
|
|
1574
|
+
/** @description Plan deleted successfully */
|
|
1575
|
+
200: {
|
|
1576
|
+
headers: {
|
|
1577
|
+
[name: string]: unknown;
|
|
1578
|
+
};
|
|
1579
|
+
content?: never;
|
|
1580
|
+
};
|
|
1581
|
+
/** @description Plan or product not found */
|
|
1582
|
+
404: {
|
|
1583
|
+
headers: {
|
|
1584
|
+
[name: string]: unknown;
|
|
1585
|
+
};
|
|
1586
|
+
content?: never;
|
|
1587
|
+
};
|
|
1588
|
+
};
|
|
1589
|
+
};
|
|
1590
|
+
ProductSdkController_listProducts: {
|
|
1591
|
+
parameters: {
|
|
1592
|
+
query?: {
|
|
1593
|
+
/** @description Max results (1-100) */
|
|
1594
|
+
limit?: number;
|
|
1595
|
+
/** @description Pagination offset */
|
|
1596
|
+
offset?: number;
|
|
1597
|
+
/** @description Search by name or description */
|
|
1598
|
+
search?: string;
|
|
1599
|
+
/** @description Filter by status */
|
|
1600
|
+
status?: "active" | "inactive" | "suspended";
|
|
1601
|
+
/** @description Filter MCP Pay products */
|
|
1602
|
+
isMcpPay?: boolean;
|
|
1603
|
+
};
|
|
1604
|
+
header?: never;
|
|
1605
|
+
path?: never;
|
|
1606
|
+
cookie?: never;
|
|
1607
|
+
};
|
|
1608
|
+
requestBody?: never;
|
|
1609
|
+
responses: {
|
|
1610
|
+
/** @description Products retrieved successfully */
|
|
1611
|
+
200: {
|
|
1612
|
+
headers: {
|
|
1613
|
+
[name: string]: unknown;
|
|
1614
|
+
};
|
|
1615
|
+
content?: never;
|
|
1616
|
+
};
|
|
1617
|
+
};
|
|
1618
|
+
};
|
|
1619
|
+
ProductSdkController_createProduct: {
|
|
1620
|
+
parameters: {
|
|
1621
|
+
query?: never;
|
|
1622
|
+
header?: never;
|
|
1623
|
+
path?: never;
|
|
1624
|
+
cookie?: never;
|
|
1625
|
+
};
|
|
1626
|
+
requestBody: {
|
|
1627
|
+
content: {
|
|
1628
|
+
"application/json": components["schemas"]["CreateProductRequest"];
|
|
1629
|
+
};
|
|
1630
|
+
};
|
|
1631
|
+
responses: {
|
|
1632
|
+
/** @description Product created successfully */
|
|
1633
|
+
201: {
|
|
1634
|
+
headers: {
|
|
1635
|
+
[name: string]: unknown;
|
|
1636
|
+
};
|
|
1637
|
+
content: {
|
|
1638
|
+
"application/json": components["schemas"]["SdkProductResponse"];
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
/** @description Missing required fields or validation error */
|
|
1642
|
+
400: {
|
|
1643
|
+
headers: {
|
|
1644
|
+
[name: string]: unknown;
|
|
1645
|
+
};
|
|
1646
|
+
content?: never;
|
|
1647
|
+
};
|
|
1648
|
+
};
|
|
1649
|
+
};
|
|
1650
|
+
ProductSdkController_getProduct: {
|
|
1651
|
+
parameters: {
|
|
1652
|
+
query?: never;
|
|
1653
|
+
header?: never;
|
|
1654
|
+
path: {
|
|
1655
|
+
/** @description Product reference or ID */
|
|
1656
|
+
productRef: string;
|
|
1657
|
+
};
|
|
1658
|
+
cookie?: never;
|
|
1659
|
+
};
|
|
1660
|
+
requestBody?: never;
|
|
1661
|
+
responses: {
|
|
1662
|
+
/** @description Product retrieved successfully */
|
|
1663
|
+
200: {
|
|
1664
|
+
headers: {
|
|
1665
|
+
[name: string]: unknown;
|
|
1666
|
+
};
|
|
1667
|
+
content: {
|
|
1668
|
+
"application/json": components["schemas"]["SdkProductResponse"];
|
|
1669
|
+
};
|
|
1670
|
+
};
|
|
1671
|
+
/** @description Product not found */
|
|
1672
|
+
404: {
|
|
1673
|
+
headers: {
|
|
1674
|
+
[name: string]: unknown;
|
|
1675
|
+
};
|
|
1676
|
+
content?: never;
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
};
|
|
1680
|
+
ProductSdkController_updateProduct: {
|
|
1681
|
+
parameters: {
|
|
1682
|
+
query?: never;
|
|
1683
|
+
header?: never;
|
|
1684
|
+
path: {
|
|
1685
|
+
/** @description Product reference or ID */
|
|
1686
|
+
productRef: string;
|
|
1687
|
+
};
|
|
1688
|
+
cookie?: never;
|
|
1689
|
+
};
|
|
1690
|
+
requestBody: {
|
|
1691
|
+
content: {
|
|
1692
|
+
"application/json": components["schemas"]["UpdateProductRequest"];
|
|
1693
|
+
};
|
|
1694
|
+
};
|
|
1695
|
+
responses: {
|
|
1696
|
+
/** @description Product updated successfully */
|
|
1697
|
+
200: {
|
|
1698
|
+
headers: {
|
|
1699
|
+
[name: string]: unknown;
|
|
1700
|
+
};
|
|
1701
|
+
content: {
|
|
1702
|
+
"application/json": components["schemas"]["SdkProductResponse"];
|
|
1703
|
+
};
|
|
1704
|
+
};
|
|
1705
|
+
/** @description Product not found */
|
|
1706
|
+
404: {
|
|
1707
|
+
headers: {
|
|
1708
|
+
[name: string]: unknown;
|
|
1709
|
+
};
|
|
1710
|
+
content?: never;
|
|
1711
|
+
};
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
ProductSdkController_deleteProduct: {
|
|
1715
|
+
parameters: {
|
|
1716
|
+
query?: never;
|
|
1717
|
+
header?: never;
|
|
1718
|
+
path: {
|
|
1719
|
+
/** @description Product reference or ID */
|
|
1720
|
+
productRef: string;
|
|
1721
|
+
};
|
|
1722
|
+
cookie?: never;
|
|
1723
|
+
};
|
|
1724
|
+
requestBody?: never;
|
|
1725
|
+
responses: {
|
|
1726
|
+
/** @description Product deleted or deactivated successfully */
|
|
1727
|
+
200: {
|
|
1728
|
+
headers: {
|
|
1729
|
+
[name: string]: unknown;
|
|
1730
|
+
};
|
|
1731
|
+
content?: never;
|
|
1732
|
+
};
|
|
1733
|
+
/** @description Product not found */
|
|
1734
|
+
404: {
|
|
1735
|
+
headers: {
|
|
1736
|
+
[name: string]: unknown;
|
|
1737
|
+
};
|
|
1738
|
+
content?: never;
|
|
1739
|
+
};
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
ProductSdkController_bootstrapMcpProduct: {
|
|
1743
|
+
parameters: {
|
|
1744
|
+
query?: never;
|
|
1745
|
+
header?: never;
|
|
1746
|
+
path?: never;
|
|
1747
|
+
cookie?: never;
|
|
1748
|
+
};
|
|
1749
|
+
requestBody: {
|
|
1750
|
+
content: {
|
|
1751
|
+
"application/json": components["schemas"]["McpBootstrapDto"];
|
|
1752
|
+
};
|
|
1753
|
+
};
|
|
1754
|
+
responses: {
|
|
1755
|
+
/** @description MCP product bootstrapped successfully */
|
|
1756
|
+
201: {
|
|
1757
|
+
headers: {
|
|
1758
|
+
[name: string]: unknown;
|
|
1759
|
+
};
|
|
1760
|
+
content: {
|
|
1761
|
+
"application/json": components["schemas"]["McpBootstrapResult"];
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1764
|
+
/** @description Invalid bootstrap request */
|
|
1765
|
+
400: {
|
|
1766
|
+
headers: {
|
|
1767
|
+
[name: string]: unknown;
|
|
1768
|
+
};
|
|
1769
|
+
content?: never;
|
|
1770
|
+
};
|
|
1771
|
+
};
|
|
1772
|
+
};
|
|
1773
|
+
ProductSdkController_configureMcpPlans: {
|
|
1774
|
+
parameters: {
|
|
1775
|
+
query?: never;
|
|
1776
|
+
header?: never;
|
|
1777
|
+
path: {
|
|
1778
|
+
/** @description Product reference or ID */
|
|
1779
|
+
productRef: string;
|
|
1780
|
+
};
|
|
1781
|
+
cookie?: never;
|
|
1782
|
+
};
|
|
1783
|
+
requestBody: {
|
|
1784
|
+
content: {
|
|
1785
|
+
"application/json": components["schemas"]["ConfigureMcpPlansDto"];
|
|
1786
|
+
};
|
|
1787
|
+
};
|
|
1788
|
+
responses: {
|
|
1789
|
+
/** @description MCP plans configured successfully */
|
|
1790
|
+
200: {
|
|
1791
|
+
headers: {
|
|
1792
|
+
[name: string]: unknown;
|
|
1793
|
+
};
|
|
1794
|
+
content: {
|
|
1795
|
+
"application/json": components["schemas"]["ConfigureMcpPlansResult"];
|
|
1796
|
+
};
|
|
1797
|
+
};
|
|
1798
|
+
/** @description Invalid MCP plans request or product is not MCP-enabled */
|
|
1799
|
+
400: {
|
|
1800
|
+
headers: {
|
|
1801
|
+
[name: string]: unknown;
|
|
1802
|
+
};
|
|
1803
|
+
content?: never;
|
|
1804
|
+
};
|
|
1805
|
+
/** @description Product not found */
|
|
1806
|
+
404: {
|
|
1807
|
+
headers: {
|
|
1808
|
+
[name: string]: unknown;
|
|
1809
|
+
};
|
|
1810
|
+
content?: never;
|
|
1811
|
+
};
|
|
1812
|
+
};
|
|
1813
|
+
};
|
|
1814
|
+
ProductSdkController_cloneProduct: {
|
|
1815
|
+
parameters: {
|
|
1816
|
+
query?: never;
|
|
1817
|
+
header?: never;
|
|
1818
|
+
path: {
|
|
1819
|
+
/** @description Product reference or ID to clone */
|
|
1820
|
+
productRef: string;
|
|
1821
|
+
};
|
|
1822
|
+
cookie?: never;
|
|
1823
|
+
};
|
|
1824
|
+
requestBody: {
|
|
1825
|
+
content: {
|
|
1826
|
+
"application/json": components["schemas"]["CloneProductDto"];
|
|
1827
|
+
};
|
|
1828
|
+
};
|
|
1829
|
+
responses: {
|
|
1830
|
+
/** @description Product cloned successfully */
|
|
1831
|
+
201: {
|
|
1832
|
+
headers: {
|
|
1833
|
+
[name: string]: unknown;
|
|
1834
|
+
};
|
|
1835
|
+
content: {
|
|
1836
|
+
"application/json": components["schemas"]["SdkProductResponse"];
|
|
1837
|
+
};
|
|
1838
|
+
};
|
|
1839
|
+
/** @description Product not found */
|
|
1840
|
+
404: {
|
|
1841
|
+
headers: {
|
|
1842
|
+
[name: string]: unknown;
|
|
1843
|
+
};
|
|
1844
|
+
content?: never;
|
|
1845
|
+
};
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
UsageSdkController_recordUsage: {
|
|
1849
|
+
parameters: {
|
|
1850
|
+
query?: never;
|
|
1851
|
+
header?: never;
|
|
1852
|
+
path?: never;
|
|
1853
|
+
cookie?: never;
|
|
1854
|
+
};
|
|
1855
|
+
requestBody: {
|
|
1856
|
+
content: {
|
|
1857
|
+
"application/json": components["schemas"]["CreateUsageRequest"];
|
|
1858
|
+
};
|
|
1859
|
+
};
|
|
1860
|
+
responses: {
|
|
1861
|
+
/** @description Usage recorded successfully */
|
|
1862
|
+
200: {
|
|
1863
|
+
headers: {
|
|
1864
|
+
[name: string]: unknown;
|
|
1865
|
+
};
|
|
1866
|
+
content: {
|
|
1867
|
+
"application/json": {
|
|
1868
|
+
/** @example true */
|
|
1869
|
+
success?: boolean;
|
|
1870
|
+
/** @example usage_A1B2C3D4 */
|
|
1871
|
+
reference?: string;
|
|
1872
|
+
};
|
|
1873
|
+
};
|
|
1874
|
+
};
|
|
1875
|
+
/** @description Validation failed */
|
|
1876
|
+
400: {
|
|
1877
|
+
headers: {
|
|
1878
|
+
[name: string]: unknown;
|
|
1879
|
+
};
|
|
1880
|
+
content?: never;
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
UsageSdkController_recordBulkUsage: {
|
|
1885
|
+
parameters: {
|
|
1886
|
+
query?: never;
|
|
1887
|
+
header?: never;
|
|
1888
|
+
path?: never;
|
|
1889
|
+
cookie?: never;
|
|
1890
|
+
};
|
|
1891
|
+
requestBody: {
|
|
1892
|
+
content: {
|
|
1893
|
+
"application/json": components["schemas"]["BulkCreateUsageRequest"];
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
responses: {
|
|
1897
|
+
/** @description Bulk usage events processed */
|
|
1898
|
+
200: {
|
|
1899
|
+
headers: {
|
|
1900
|
+
[name: string]: unknown;
|
|
1901
|
+
};
|
|
1902
|
+
content?: never;
|
|
1903
|
+
};
|
|
1904
|
+
/** @description Validation failed */
|
|
1905
|
+
400: {
|
|
1906
|
+
headers: {
|
|
1907
|
+
[name: string]: unknown;
|
|
1908
|
+
};
|
|
1909
|
+
content?: never;
|
|
1910
|
+
};
|
|
1911
|
+
};
|
|
1912
|
+
};
|
|
1913
|
+
MeterEventsSdkController_recordEvent: {
|
|
1914
|
+
parameters: {
|
|
1915
|
+
query?: never;
|
|
1916
|
+
header?: never;
|
|
1917
|
+
path?: never;
|
|
1918
|
+
cookie?: never;
|
|
1919
|
+
};
|
|
1920
|
+
requestBody: {
|
|
1921
|
+
content: {
|
|
1922
|
+
"application/json": components["schemas"]["RecordMeterEventZodDto"];
|
|
1923
|
+
};
|
|
1924
|
+
};
|
|
1925
|
+
responses: {
|
|
1926
|
+
/** @description Event recorded */
|
|
1927
|
+
200: {
|
|
1928
|
+
headers: {
|
|
1929
|
+
[name: string]: unknown;
|
|
1930
|
+
};
|
|
1931
|
+
content: {
|
|
1932
|
+
"application/json": {
|
|
1933
|
+
/** @example true */
|
|
1934
|
+
success?: boolean;
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
};
|
|
1938
|
+
/** @description Invalid meter name or meter is archived */
|
|
1939
|
+
400: {
|
|
1940
|
+
headers: {
|
|
1941
|
+
[name: string]: unknown;
|
|
1942
|
+
};
|
|
1943
|
+
content?: never;
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1946
|
+
};
|
|
1947
|
+
MeterEventsSdkController_recordBulkEvents: {
|
|
1948
|
+
parameters: {
|
|
1949
|
+
query?: never;
|
|
1950
|
+
header?: never;
|
|
1951
|
+
path?: never;
|
|
1952
|
+
cookie?: never;
|
|
1953
|
+
};
|
|
1954
|
+
requestBody: {
|
|
1955
|
+
content: {
|
|
1956
|
+
"application/json": components["schemas"]["RecordBulkMeterEventsZodDto"];
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
responses: {
|
|
1960
|
+
/** @description Events recorded */
|
|
1961
|
+
200: {
|
|
1962
|
+
headers: {
|
|
1963
|
+
[name: string]: unknown;
|
|
1964
|
+
};
|
|
1965
|
+
content: {
|
|
1966
|
+
"application/json": {
|
|
1967
|
+
/** @example true */
|
|
1968
|
+
success?: boolean;
|
|
1969
|
+
/** @example 50 */
|
|
1970
|
+
inserted?: number;
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
};
|
|
1974
|
+
/** @description Invalid meter name or meter is archived */
|
|
1975
|
+
400: {
|
|
1976
|
+
headers: {
|
|
1977
|
+
[name: string]: unknown;
|
|
1978
|
+
};
|
|
1979
|
+
content?: never;
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
PurchaseSdkController_listPurchases: {
|
|
1984
|
+
parameters: {
|
|
1985
|
+
query?: {
|
|
1986
|
+
/** @description Filter by purchase status */
|
|
1987
|
+
status?: "pending" | "active" | "trialing" | "past_due" | "cancelled" | "expired" | "suspended" | "refunded";
|
|
1988
|
+
/** @description Filter by product reference */
|
|
1989
|
+
productRef?: string;
|
|
1990
|
+
/** @description Filter by customer reference */
|
|
1991
|
+
customerRef?: string;
|
|
1992
|
+
};
|
|
1993
|
+
header?: never;
|
|
1994
|
+
path?: never;
|
|
1995
|
+
cookie?: never;
|
|
1996
|
+
};
|
|
1997
|
+
requestBody?: never;
|
|
1998
|
+
responses: {
|
|
1999
|
+
/** @description Purchases retrieved successfully */
|
|
2000
|
+
200: {
|
|
2001
|
+
headers: {
|
|
2002
|
+
[name: string]: unknown;
|
|
2003
|
+
};
|
|
2004
|
+
content: {
|
|
2005
|
+
"application/json": {
|
|
2006
|
+
purchases?: components["schemas"]["SdkPurchaseResponse"][];
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
};
|
|
2012
|
+
PurchaseSdkController_getPurchasesForCustomer: {
|
|
2013
|
+
parameters: {
|
|
2014
|
+
query?: never;
|
|
2015
|
+
header?: never;
|
|
2016
|
+
path: {
|
|
2017
|
+
/** @description Customer reference or ID */
|
|
2018
|
+
customerRef: string;
|
|
2019
|
+
};
|
|
2020
|
+
cookie?: never;
|
|
2021
|
+
};
|
|
2022
|
+
requestBody?: never;
|
|
2023
|
+
responses: {
|
|
2024
|
+
/** @description Customer purchases retrieved successfully */
|
|
2025
|
+
200: {
|
|
2026
|
+
headers: {
|
|
2027
|
+
[name: string]: unknown;
|
|
2028
|
+
};
|
|
2029
|
+
content: {
|
|
2030
|
+
"application/json": {
|
|
2031
|
+
purchases?: components["schemas"]["SdkPurchaseResponse"][];
|
|
2032
|
+
};
|
|
2033
|
+
};
|
|
2034
|
+
};
|
|
2035
|
+
/** @description Customer not found */
|
|
2036
|
+
404: {
|
|
2037
|
+
headers: {
|
|
2038
|
+
[name: string]: unknown;
|
|
2039
|
+
};
|
|
2040
|
+
content?: never;
|
|
2041
|
+
};
|
|
2042
|
+
};
|
|
2043
|
+
};
|
|
2044
|
+
PurchaseSdkController_getPurchasesForProduct: {
|
|
2045
|
+
parameters: {
|
|
2046
|
+
query?: never;
|
|
2047
|
+
header?: never;
|
|
2048
|
+
path: {
|
|
2049
|
+
/** @description Product reference or ID */
|
|
2050
|
+
productRef: string;
|
|
2051
|
+
};
|
|
2052
|
+
cookie?: never;
|
|
2053
|
+
};
|
|
2054
|
+
requestBody?: never;
|
|
2055
|
+
responses: {
|
|
2056
|
+
/** @description Product purchases retrieved successfully */
|
|
2057
|
+
200: {
|
|
2058
|
+
headers: {
|
|
2059
|
+
[name: string]: unknown;
|
|
2060
|
+
};
|
|
2061
|
+
content: {
|
|
2062
|
+
"application/json": {
|
|
2063
|
+
purchases?: components["schemas"]["SdkPurchaseResponse"][];
|
|
2064
|
+
};
|
|
2065
|
+
};
|
|
2066
|
+
};
|
|
2067
|
+
/** @description Product not found */
|
|
2068
|
+
404: {
|
|
2069
|
+
headers: {
|
|
2070
|
+
[name: string]: unknown;
|
|
2071
|
+
};
|
|
2072
|
+
content?: never;
|
|
2073
|
+
};
|
|
2074
|
+
};
|
|
2075
|
+
};
|
|
2076
|
+
PurchaseSdkController_getPurchase: {
|
|
2077
|
+
parameters: {
|
|
2078
|
+
query?: never;
|
|
2079
|
+
header?: never;
|
|
2080
|
+
path: {
|
|
2081
|
+
/** @description Purchase reference or ID */
|
|
2082
|
+
purchaseRef: string;
|
|
2083
|
+
};
|
|
2084
|
+
cookie?: never;
|
|
2085
|
+
};
|
|
2086
|
+
requestBody?: never;
|
|
2087
|
+
responses: {
|
|
2088
|
+
/** @description Purchase retrieved successfully */
|
|
2089
|
+
200: {
|
|
2090
|
+
headers: {
|
|
2091
|
+
[name: string]: unknown;
|
|
2092
|
+
};
|
|
2093
|
+
content: {
|
|
2094
|
+
"application/json": components["schemas"]["SdkPurchaseResponse"];
|
|
2095
|
+
};
|
|
2096
|
+
};
|
|
2097
|
+
/** @description Purchase not found */
|
|
2098
|
+
404: {
|
|
2099
|
+
headers: {
|
|
2100
|
+
[name: string]: unknown;
|
|
2101
|
+
};
|
|
2102
|
+
content?: never;
|
|
2103
|
+
};
|
|
2104
|
+
};
|
|
2105
|
+
};
|
|
2106
|
+
PurchaseSdkController_cancelPurchase: {
|
|
2107
|
+
parameters: {
|
|
2108
|
+
query?: never;
|
|
2109
|
+
header?: never;
|
|
2110
|
+
path: {
|
|
2111
|
+
/** @description Purchase reference or ID */
|
|
2112
|
+
purchaseRef: string;
|
|
2113
|
+
};
|
|
2114
|
+
cookie?: never;
|
|
2115
|
+
};
|
|
2116
|
+
requestBody: {
|
|
2117
|
+
content: {
|
|
2118
|
+
"application/json": components["schemas"]["CancelPurchaseRequest"];
|
|
2119
|
+
};
|
|
2120
|
+
};
|
|
2121
|
+
responses: {
|
|
2122
|
+
/** @description Purchase cancelled successfully */
|
|
2123
|
+
200: {
|
|
2124
|
+
headers: {
|
|
2125
|
+
[name: string]: unknown;
|
|
2126
|
+
};
|
|
2127
|
+
content: {
|
|
2128
|
+
"application/json": {
|
|
2129
|
+
success?: boolean;
|
|
2130
|
+
purchase?: components["schemas"]["SdkPurchaseResponse"];
|
|
2131
|
+
};
|
|
2132
|
+
};
|
|
2133
|
+
};
|
|
2134
|
+
/** @description Purchase not found */
|
|
2135
|
+
404: {
|
|
2136
|
+
headers: {
|
|
2137
|
+
[name: string]: unknown;
|
|
2138
|
+
};
|
|
2139
|
+
content?: never;
|
|
2140
|
+
};
|
|
2141
|
+
};
|
|
2142
|
+
};
|
|
2143
|
+
PurchaseSdkController_reactivatePurchase: {
|
|
2144
|
+
parameters: {
|
|
2145
|
+
query?: never;
|
|
2146
|
+
header?: never;
|
|
2147
|
+
path: {
|
|
2148
|
+
/** @description Purchase reference or ID */
|
|
2149
|
+
purchaseRef: string;
|
|
2150
|
+
};
|
|
2151
|
+
cookie?: never;
|
|
2152
|
+
};
|
|
2153
|
+
requestBody?: never;
|
|
2154
|
+
responses: {
|
|
2155
|
+
/** @description Purchase reactivated successfully */
|
|
2156
|
+
200: {
|
|
2157
|
+
headers: {
|
|
2158
|
+
[name: string]: unknown;
|
|
2159
|
+
};
|
|
2160
|
+
content: {
|
|
2161
|
+
"application/json": {
|
|
2162
|
+
success?: boolean;
|
|
2163
|
+
purchase?: components["schemas"]["SdkPurchaseResponse"];
|
|
2164
|
+
};
|
|
2165
|
+
};
|
|
2166
|
+
};
|
|
2167
|
+
/** @description Purchase cannot be reactivated */
|
|
2168
|
+
400: {
|
|
2169
|
+
headers: {
|
|
2170
|
+
[name: string]: unknown;
|
|
2171
|
+
};
|
|
2172
|
+
content?: never;
|
|
2173
|
+
};
|
|
2174
|
+
/** @description Purchase not found */
|
|
2175
|
+
404: {
|
|
2176
|
+
headers: {
|
|
2177
|
+
[name: string]: unknown;
|
|
2178
|
+
};
|
|
2179
|
+
content?: never;
|
|
2180
|
+
};
|
|
2181
|
+
};
|
|
2182
|
+
};
|
|
2183
|
+
LimitsSdkController_checkLimits: {
|
|
2184
|
+
parameters: {
|
|
2185
|
+
query?: never;
|
|
2186
|
+
header?: never;
|
|
2187
|
+
path?: never;
|
|
2188
|
+
cookie?: never;
|
|
2189
|
+
};
|
|
2190
|
+
requestBody: {
|
|
2191
|
+
content: {
|
|
2192
|
+
"application/json": components["schemas"]["CheckLimitRequest"];
|
|
2193
|
+
};
|
|
2194
|
+
};
|
|
2195
|
+
responses: {
|
|
2196
|
+
/** @description Limit check result */
|
|
2197
|
+
200: {
|
|
2198
|
+
headers: {
|
|
2199
|
+
[name: string]: unknown;
|
|
2200
|
+
};
|
|
2201
|
+
content: {
|
|
2202
|
+
"application/json": components["schemas"]["LimitResponse"];
|
|
2203
|
+
};
|
|
2204
|
+
};
|
|
2205
|
+
/** @description Missing customerRef or productRef */
|
|
2206
|
+
400: {
|
|
2207
|
+
headers: {
|
|
2208
|
+
[name: string]: unknown;
|
|
2209
|
+
};
|
|
2210
|
+
content?: never;
|
|
2211
|
+
};
|
|
2212
|
+
/** @description Customer or product not found */
|
|
2213
|
+
404: {
|
|
2214
|
+
headers: {
|
|
2215
|
+
[name: string]: unknown;
|
|
2216
|
+
};
|
|
2217
|
+
content?: never;
|
|
2218
|
+
};
|
|
2219
|
+
};
|
|
2220
|
+
};
|
|
2221
|
+
ActivateSdkController_activate: {
|
|
2222
|
+
parameters: {
|
|
2223
|
+
query?: never;
|
|
2224
|
+
header?: never;
|
|
2225
|
+
path?: never;
|
|
2226
|
+
cookie?: never;
|
|
2227
|
+
};
|
|
2228
|
+
requestBody: {
|
|
2229
|
+
content: {
|
|
2230
|
+
"application/json": components["schemas"]["ActivatePlanDto"];
|
|
2231
|
+
};
|
|
2232
|
+
};
|
|
2233
|
+
responses: {
|
|
2234
|
+
200: {
|
|
2235
|
+
headers: {
|
|
2236
|
+
[name: string]: unknown;
|
|
2237
|
+
};
|
|
2238
|
+
content: {
|
|
2239
|
+
"application/json": components["schemas"]["ActivatePlanResponseDto"];
|
|
2240
|
+
};
|
|
2241
|
+
};
|
|
2242
|
+
};
|
|
2243
|
+
};
|
|
2244
|
+
CustomerSdkController_getCustomerByQuery: {
|
|
2245
|
+
parameters: {
|
|
2246
|
+
query?: {
|
|
2247
|
+
/** @description Customer reference identifier (use exactly one query parameter) */
|
|
2248
|
+
reference?: string;
|
|
2249
|
+
/** @description External reference ID from your auth system (use exactly one query parameter) */
|
|
2250
|
+
externalRef?: string;
|
|
2251
|
+
/** @description Customer email address (use exactly one query parameter) */
|
|
2252
|
+
email?: string;
|
|
2253
|
+
};
|
|
2254
|
+
header?: never;
|
|
2255
|
+
path?: never;
|
|
2256
|
+
cookie?: never;
|
|
2257
|
+
};
|
|
2258
|
+
requestBody?: never;
|
|
2259
|
+
responses: {
|
|
2260
|
+
/** @description Customer retrieved successfully */
|
|
2261
|
+
200: {
|
|
2262
|
+
headers: {
|
|
2263
|
+
[name: string]: unknown;
|
|
2264
|
+
};
|
|
2265
|
+
content: {
|
|
2266
|
+
"application/json": components["schemas"]["CustomerResponse"];
|
|
2267
|
+
};
|
|
2268
|
+
};
|
|
2269
|
+
/** @description Invalid request - must provide exactly one of reference, externalRef, or email */
|
|
2270
|
+
400: {
|
|
2271
|
+
headers: {
|
|
2272
|
+
[name: string]: unknown;
|
|
2273
|
+
};
|
|
2274
|
+
content: {
|
|
2275
|
+
"application/json": unknown;
|
|
2276
|
+
};
|
|
2277
|
+
};
|
|
2278
|
+
/** @description Customer not found */
|
|
2279
|
+
404: {
|
|
2280
|
+
headers: {
|
|
2281
|
+
[name: string]: unknown;
|
|
2282
|
+
};
|
|
2283
|
+
content: {
|
|
2284
|
+
"application/json": unknown;
|
|
2285
|
+
};
|
|
2286
|
+
};
|
|
2287
|
+
};
|
|
2288
|
+
};
|
|
2289
|
+
CustomerSdkController_createCustomer: {
|
|
2290
|
+
parameters: {
|
|
2291
|
+
query?: never;
|
|
2292
|
+
header?: never;
|
|
2293
|
+
path?: never;
|
|
2294
|
+
cookie?: never;
|
|
2295
|
+
};
|
|
2296
|
+
/** @description Customer creation data */
|
|
2297
|
+
requestBody: {
|
|
2298
|
+
content: {
|
|
2299
|
+
"application/json": components["schemas"]["CreateCustomerRequest"];
|
|
2300
|
+
};
|
|
2301
|
+
};
|
|
2302
|
+
responses: {
|
|
2303
|
+
/** @description Customer created successfully */
|
|
2304
|
+
201: {
|
|
2305
|
+
headers: {
|
|
2306
|
+
[name: string]: unknown;
|
|
2307
|
+
};
|
|
2308
|
+
content: {
|
|
2309
|
+
"application/json": components["schemas"]["CustomerResponse"];
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2312
|
+
/** @description Invalid email or missing required fields */
|
|
2313
|
+
400: {
|
|
2314
|
+
headers: {
|
|
2315
|
+
[name: string]: unknown;
|
|
2316
|
+
};
|
|
2317
|
+
content: {
|
|
2318
|
+
"application/json": unknown;
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
};
|
|
2322
|
+
};
|
|
2323
|
+
CustomerSdkController_getCustomer: {
|
|
2324
|
+
parameters: {
|
|
2325
|
+
query?: never;
|
|
2326
|
+
header?: never;
|
|
2327
|
+
path: {
|
|
2328
|
+
/** @description Customer reference identifier */
|
|
2329
|
+
reference: string;
|
|
2330
|
+
};
|
|
2331
|
+
cookie?: never;
|
|
2332
|
+
};
|
|
2333
|
+
requestBody?: never;
|
|
2334
|
+
responses: {
|
|
2335
|
+
/** @description Customer retrieved successfully */
|
|
2336
|
+
200: {
|
|
2337
|
+
headers: {
|
|
2338
|
+
[name: string]: unknown;
|
|
2339
|
+
};
|
|
2340
|
+
content: {
|
|
2341
|
+
"application/json": components["schemas"]["CustomerResponse"];
|
|
2342
|
+
};
|
|
2343
|
+
};
|
|
2344
|
+
/** @description Customer not found */
|
|
2345
|
+
404: {
|
|
2346
|
+
headers: {
|
|
2347
|
+
[name: string]: unknown;
|
|
2348
|
+
};
|
|
2349
|
+
content: {
|
|
2350
|
+
"application/json": unknown;
|
|
2351
|
+
};
|
|
2352
|
+
};
|
|
2353
|
+
};
|
|
2354
|
+
};
|
|
2355
|
+
CustomerSdkController_updateCustomer: {
|
|
2356
|
+
parameters: {
|
|
2357
|
+
query?: never;
|
|
2358
|
+
header?: never;
|
|
2359
|
+
path: {
|
|
2360
|
+
/** @description Customer reference identifier */
|
|
2361
|
+
reference: string;
|
|
2362
|
+
};
|
|
2363
|
+
cookie?: never;
|
|
2364
|
+
};
|
|
2365
|
+
/** @description Fields to update (all optional) */
|
|
2366
|
+
requestBody: {
|
|
2367
|
+
content: {
|
|
2368
|
+
"application/json": components["schemas"]["UpdateCustomerRequest"];
|
|
2369
|
+
};
|
|
2370
|
+
};
|
|
2371
|
+
responses: {
|
|
2372
|
+
/** @description Customer updated successfully */
|
|
2373
|
+
200: {
|
|
2374
|
+
headers: {
|
|
2375
|
+
[name: string]: unknown;
|
|
2376
|
+
};
|
|
2377
|
+
content: {
|
|
2378
|
+
"application/json": components["schemas"]["CustomerResponse"];
|
|
2379
|
+
};
|
|
2380
|
+
};
|
|
2381
|
+
/** @description Invalid update payload */
|
|
2382
|
+
400: {
|
|
2383
|
+
headers: {
|
|
2384
|
+
[name: string]: unknown;
|
|
2385
|
+
};
|
|
2386
|
+
content?: never;
|
|
2387
|
+
};
|
|
2388
|
+
/** @description Customer not found */
|
|
2389
|
+
404: {
|
|
2390
|
+
headers: {
|
|
2391
|
+
[name: string]: unknown;
|
|
2392
|
+
};
|
|
2393
|
+
content?: never;
|
|
2394
|
+
};
|
|
2395
|
+
};
|
|
2396
|
+
};
|
|
2397
|
+
CustomerSdkController_getCustomerBalance: {
|
|
2398
|
+
parameters: {
|
|
2399
|
+
query?: never;
|
|
2400
|
+
header?: never;
|
|
2401
|
+
path: {
|
|
2402
|
+
/** @description Customer reference identifier */
|
|
2403
|
+
reference: string;
|
|
2404
|
+
};
|
|
2405
|
+
cookie?: never;
|
|
2406
|
+
};
|
|
2407
|
+
requestBody?: never;
|
|
2408
|
+
responses: {
|
|
2409
|
+
/** @description Customer balance retrieved successfully */
|
|
2410
|
+
200: {
|
|
2411
|
+
headers: {
|
|
2412
|
+
[name: string]: unknown;
|
|
2413
|
+
};
|
|
2414
|
+
content: {
|
|
2415
|
+
"application/json": unknown;
|
|
2416
|
+
};
|
|
2417
|
+
};
|
|
2418
|
+
/** @description Customer not found */
|
|
2419
|
+
404: {
|
|
2420
|
+
headers: {
|
|
2421
|
+
[name: string]: unknown;
|
|
2422
|
+
};
|
|
2423
|
+
content: {
|
|
2424
|
+
"application/json": unknown;
|
|
2425
|
+
};
|
|
2426
|
+
};
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
CustomerSdkController_createCustomerSession: {
|
|
2430
|
+
parameters: {
|
|
2431
|
+
query?: never;
|
|
2432
|
+
header?: never;
|
|
2433
|
+
path?: never;
|
|
2434
|
+
cookie?: never;
|
|
2435
|
+
};
|
|
2436
|
+
/** @description Customer session creation request data */
|
|
2437
|
+
requestBody: {
|
|
2438
|
+
content: {
|
|
2439
|
+
"application/json": components["schemas"]["CreateCustomerSessionRequest"];
|
|
2440
|
+
};
|
|
2441
|
+
};
|
|
2442
|
+
responses: {
|
|
2443
|
+
/** @description Customer session created successfully */
|
|
2444
|
+
201: {
|
|
2445
|
+
headers: {
|
|
2446
|
+
[name: string]: unknown;
|
|
2447
|
+
};
|
|
2448
|
+
content: {
|
|
2449
|
+
"application/json": components["schemas"]["CreateCustomerSessionResponse"];
|
|
2450
|
+
};
|
|
2451
|
+
};
|
|
2452
|
+
/** @description Invalid request data or customer not found */
|
|
2453
|
+
400: {
|
|
2454
|
+
headers: {
|
|
2455
|
+
[name: string]: unknown;
|
|
2456
|
+
};
|
|
2457
|
+
content: {
|
|
2458
|
+
"application/json": unknown;
|
|
2459
|
+
};
|
|
2460
|
+
};
|
|
2461
|
+
/** @description Customer not found */
|
|
2462
|
+
404: {
|
|
2463
|
+
headers: {
|
|
2464
|
+
[name: string]: unknown;
|
|
2465
|
+
};
|
|
2466
|
+
content: {
|
|
2467
|
+
"application/json": unknown;
|
|
2468
|
+
};
|
|
2469
|
+
};
|
|
2470
|
+
};
|
|
2471
|
+
};
|
|
2472
|
+
CustomerSdkController_getCustomerSession: {
|
|
2473
|
+
parameters: {
|
|
2474
|
+
query?: never;
|
|
2475
|
+
header?: never;
|
|
2476
|
+
path: {
|
|
2477
|
+
/** @description Customer session ID/token */
|
|
2478
|
+
sessionId: string;
|
|
2479
|
+
};
|
|
2480
|
+
cookie?: never;
|
|
2481
|
+
};
|
|
2482
|
+
requestBody?: never;
|
|
2483
|
+
responses: {
|
|
2484
|
+
/** @description Customer session retrieved successfully */
|
|
2485
|
+
200: {
|
|
2486
|
+
headers: {
|
|
2487
|
+
[name: string]: unknown;
|
|
2488
|
+
};
|
|
2489
|
+
content: {
|
|
2490
|
+
"application/json": components["schemas"]["GetCustomerSessionResponse"];
|
|
2491
|
+
};
|
|
2492
|
+
};
|
|
2493
|
+
/** @description Customer session not found */
|
|
2494
|
+
404: {
|
|
2495
|
+
headers: {
|
|
2496
|
+
[name: string]: unknown;
|
|
2497
|
+
};
|
|
2498
|
+
content: {
|
|
2499
|
+
"application/json": unknown;
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
};
|
|
2503
|
+
};
|
|
2504
|
+
UserInfoSdkController_getUserInfo: {
|
|
2505
|
+
parameters: {
|
|
2506
|
+
query?: never;
|
|
2507
|
+
header?: never;
|
|
2508
|
+
path?: never;
|
|
2509
|
+
cookie?: never;
|
|
2510
|
+
};
|
|
2511
|
+
requestBody: {
|
|
2512
|
+
content: {
|
|
2513
|
+
"application/json": components["schemas"]["UserInfoRequest"];
|
|
2514
|
+
};
|
|
2515
|
+
};
|
|
2516
|
+
responses: {
|
|
2517
|
+
/** @description User info with purchase status */
|
|
2518
|
+
200: {
|
|
2519
|
+
headers: {
|
|
2520
|
+
[name: string]: unknown;
|
|
2521
|
+
};
|
|
2522
|
+
content: {
|
|
2523
|
+
"application/json": components["schemas"]["UserInfoResponse"];
|
|
2524
|
+
};
|
|
2525
|
+
};
|
|
2526
|
+
/** @description Missing customerRef or productRef */
|
|
2527
|
+
400: {
|
|
2528
|
+
headers: {
|
|
2529
|
+
[name: string]: unknown;
|
|
2530
|
+
};
|
|
2531
|
+
content?: never;
|
|
2532
|
+
};
|
|
2533
|
+
/** @description Customer or product not found */
|
|
2534
|
+
404: {
|
|
2535
|
+
headers: {
|
|
2536
|
+
[name: string]: unknown;
|
|
2537
|
+
};
|
|
2538
|
+
content?: never;
|
|
2539
|
+
};
|
|
2540
|
+
};
|
|
2541
|
+
};
|
|
2542
|
+
PaymentMethodSdkController_getPaymentMethod: {
|
|
2543
|
+
parameters: {
|
|
2544
|
+
query: {
|
|
2545
|
+
/** @description Customer reference (e.g. `customer_...`). */
|
|
2546
|
+
customerRef: string;
|
|
2547
|
+
};
|
|
2548
|
+
header?: never;
|
|
2549
|
+
path?: never;
|
|
2550
|
+
cookie?: never;
|
|
2551
|
+
};
|
|
2552
|
+
requestBody?: never;
|
|
2553
|
+
responses: {
|
|
2554
|
+
/** @description The customer's default card, or `{ kind: 'none' }` when no card is on file. */
|
|
2555
|
+
200: {
|
|
2556
|
+
headers: {
|
|
2557
|
+
[name: string]: unknown;
|
|
2558
|
+
};
|
|
2559
|
+
content: {
|
|
2560
|
+
"application/json": {
|
|
2561
|
+
/** @enum {string} */
|
|
2562
|
+
kind: "card";
|
|
2563
|
+
/** @example visa */
|
|
2564
|
+
brand: string;
|
|
2565
|
+
/** @example 4242 */
|
|
2566
|
+
last4: string;
|
|
2567
|
+
/** @example 12 */
|
|
2568
|
+
expMonth: number;
|
|
2569
|
+
/** @example 2030 */
|
|
2570
|
+
expYear: number;
|
|
2571
|
+
} | {
|
|
2572
|
+
/** @enum {string} */
|
|
2573
|
+
kind: "none";
|
|
2574
|
+
};
|
|
2575
|
+
};
|
|
2576
|
+
};
|
|
2577
|
+
};
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
/**
|
|
2582
|
+
* SolvaPay API Client Type Definitions
|
|
2583
|
+
*
|
|
2584
|
+
* Types related to the SolvaPay API client and backend communication.
|
|
2585
|
+
*/
|
|
2586
|
+
|
|
2587
|
+
/**
|
|
2588
|
+
* One-time purchase information returned from payment processing
|
|
2589
|
+
*/
|
|
2590
|
+
interface OneTimePurchaseInfo {
|
|
2591
|
+
reference: string;
|
|
2592
|
+
productRef?: string;
|
|
2593
|
+
amount: number;
|
|
2594
|
+
currency: string;
|
|
2595
|
+
creditsAdded?: number;
|
|
2596
|
+
completedAt: string;
|
|
2597
|
+
}
|
|
2598
|
+
/**
|
|
2599
|
+
* Result from processing a payment intent
|
|
2600
|
+
*/
|
|
2601
|
+
interface ProcessPaymentResult {
|
|
2602
|
+
type: 'recurring' | 'one-time';
|
|
2603
|
+
purchase?: components['schemas']['PurchaseInfo'];
|
|
2604
|
+
oneTimePurchase?: OneTimePurchaseInfo;
|
|
2605
|
+
status: 'completed';
|
|
2606
|
+
}
|
|
2607
|
+
type ActivatePlanResult = components['schemas']['ActivatePlanResponseDto'];
|
|
2608
|
+
/**
|
|
2609
|
+
* SDK-facing payment-method projection returned by
|
|
2610
|
+
* `GET /v1/sdk/payment-method?customerRef=...`.
|
|
2611
|
+
*
|
|
2612
|
+
* Derived from the generated operation response so any backend shape
|
|
2613
|
+
* change propagates through a single `npm run generate:types` run. The
|
|
2614
|
+
* inline `oneOf` schema on the backend controller translates to a clean
|
|
2615
|
+
* `{ kind: 'card', ... } | { kind: 'none' }` discriminated union here.
|
|
2616
|
+
*/
|
|
2617
|
+
type PaymentMethodInfo = operations['PaymentMethodSdkController_getPaymentMethod']['responses']['200']['content']['application/json'];
|
|
2618
|
+
|
|
2619
|
+
/**
|
|
2620
|
+
* Paywall Type Definitions
|
|
2621
|
+
*
|
|
2622
|
+
* Types related to paywall protection, limits, and gating functionality.
|
|
2623
|
+
*/
|
|
2624
|
+
|
|
2625
|
+
type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
|
|
2626
|
+
type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
|
|
2627
|
+
type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
|
|
2628
|
+
/**
|
|
2629
|
+
* Structured content for paywall errors (MCP structuredContent and manual handling).
|
|
2630
|
+
*/
|
|
2631
|
+
type PaywallStructuredContent = {
|
|
2632
|
+
kind: 'payment_required';
|
|
2633
|
+
/** Product ref from paywall metadata (or env default) */
|
|
2634
|
+
product: string;
|
|
2635
|
+
checkoutUrl: string;
|
|
2636
|
+
message: string;
|
|
2637
|
+
/**
|
|
2638
|
+
* Quota balance at the moment the paywall tripped. Optional so
|
|
2639
|
+
* older server versions (pre-balance-on-payment_required) stay
|
|
2640
|
+
* compatible; the React `PaywallNotice.Message` prefers this
|
|
2641
|
+
* structured data over the raw `message` when available.
|
|
2642
|
+
*/
|
|
2643
|
+
balance?: LimitActivationBalance;
|
|
2644
|
+
/** Rich product context from checkLimits (name, ref, provider slug/id) */
|
|
2645
|
+
productDetails?: LimitActivationProduct;
|
|
2646
|
+
} | {
|
|
2647
|
+
kind: 'activation_required';
|
|
2648
|
+
/** Product ref from paywall metadata (or env default) */
|
|
2649
|
+
product: string;
|
|
2650
|
+
message: string;
|
|
2651
|
+
/**
|
|
2652
|
+
* Best URL for completing purchase or confirmation; mirrors confirmationUrl when present.
|
|
2653
|
+
*/
|
|
2654
|
+
checkoutUrl: string;
|
|
2655
|
+
confirmationUrl?: string;
|
|
2656
|
+
plans?: LimitPlanSummary[];
|
|
2657
|
+
balance?: LimitActivationBalance;
|
|
2658
|
+
/** Rich product context from checkLimits (name, ref, provider slug/id) */
|
|
2659
|
+
productDetails?: LimitActivationProduct;
|
|
2660
|
+
};
|
|
2661
|
+
|
|
2662
|
+
/**
|
|
2663
|
+
* Customer Helper (Core)
|
|
2664
|
+
*
|
|
2665
|
+
* Generic helper for syncing customers with SolvaPay backend.
|
|
2666
|
+
* Works with standard Web API Request (works everywhere).
|
|
2667
|
+
*/
|
|
2668
|
+
|
|
2669
|
+
type CustomerBalanceResult = {
|
|
2670
|
+
customerRef: string;
|
|
2671
|
+
credits: number;
|
|
2672
|
+
displayCurrency: string;
|
|
2673
|
+
creditsPerMinorUnit: number;
|
|
2674
|
+
displayExchangeRate: number;
|
|
2675
|
+
};
|
|
2676
|
+
|
|
2677
|
+
interface PurchaseCheckResult {
|
|
2678
|
+
customerRef: string;
|
|
2679
|
+
email?: string;
|
|
2680
|
+
name?: string;
|
|
2681
|
+
purchases: Array<{
|
|
2682
|
+
reference: string;
|
|
2683
|
+
productName?: string;
|
|
2684
|
+
productRef?: string;
|
|
2685
|
+
status?: string;
|
|
2686
|
+
startDate?: string;
|
|
2687
|
+
planSnapshot?: {
|
|
2688
|
+
meterId?: string;
|
|
2689
|
+
limit?: number;
|
|
2690
|
+
freeUnits?: number;
|
|
2691
|
+
};
|
|
2692
|
+
usage?: {
|
|
2693
|
+
used?: number;
|
|
2694
|
+
overageUnits?: number;
|
|
2695
|
+
overageCost?: number;
|
|
2696
|
+
periodStart?: string;
|
|
2697
|
+
periodEnd?: string;
|
|
2698
|
+
};
|
|
2699
|
+
[key: string]: unknown;
|
|
2700
|
+
}>;
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
/**
|
|
2704
|
+
* Usage snapshot derived from the authenticated customer's active purchase.
|
|
2705
|
+
*
|
|
2706
|
+
* Shape matches the backend's `UserInfoUsageDto` so the React `useUsage`
|
|
2707
|
+
* hook gets a canonical set of fields regardless of transport.
|
|
2708
|
+
*/
|
|
2709
|
+
interface GetUsageResult {
|
|
2710
|
+
meterRef: string | null;
|
|
2711
|
+
total: number | null;
|
|
2712
|
+
used: number;
|
|
2713
|
+
remaining: number | null;
|
|
2714
|
+
/** 0–100, rounded to 2dp. `null` when `total` is unknown. */
|
|
2715
|
+
percentUsed: number | null;
|
|
2716
|
+
periodStart?: string;
|
|
2717
|
+
periodEnd?: string;
|
|
2718
|
+
/** Raw purchase ref the usage belongs to (when a usage-based plan is active). */
|
|
2719
|
+
purchaseRef?: string;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
/**
|
|
2723
|
+
* Typed copy bundle surfaced through `<SolvaPayProvider config={{ copy }} />`.
|
|
2724
|
+
*
|
|
2725
|
+
* Every user-visible string in `@solvapay/react` routes through this bundle via
|
|
2726
|
+
* `useCopy()`. Values are either plain templates with `{placeholder}` tokens or
|
|
2727
|
+
* function-form resolvers (currently only used for mandate variants) that
|
|
2728
|
+
* receive a `MandateContext` and return the final string.
|
|
2729
|
+
*/
|
|
2730
|
+
type MandateContext = {
|
|
2731
|
+
merchant: {
|
|
2732
|
+
legalName: string;
|
|
2733
|
+
displayName?: string;
|
|
2734
|
+
supportEmail?: string;
|
|
2735
|
+
termsUrl?: string;
|
|
2736
|
+
privacyUrl?: string;
|
|
2737
|
+
};
|
|
2738
|
+
plan?: {
|
|
2739
|
+
name?: string;
|
|
2740
|
+
interval?: string;
|
|
2741
|
+
intervalCount?: number;
|
|
2742
|
+
trialDays?: number;
|
|
2743
|
+
measures?: string;
|
|
2744
|
+
billingCycle?: string;
|
|
2745
|
+
};
|
|
2746
|
+
product?: {
|
|
2747
|
+
name?: string;
|
|
2748
|
+
};
|
|
2749
|
+
amountFormatted: string;
|
|
2750
|
+
trialDays?: number;
|
|
2751
|
+
};
|
|
2752
|
+
type MandateTemplate = string | ((ctx: MandateContext) => string);
|
|
2753
|
+
interface SolvaPayCopy {
|
|
2754
|
+
mandate: {
|
|
2755
|
+
recurring: MandateTemplate;
|
|
2756
|
+
oneTime: MandateTemplate;
|
|
2757
|
+
topup: MandateTemplate;
|
|
2758
|
+
usageMetered: MandateTemplate;
|
|
2759
|
+
freeTier: MandateTemplate;
|
|
2760
|
+
};
|
|
2761
|
+
cta: {
|
|
2762
|
+
payNow: string;
|
|
2763
|
+
topUp: string;
|
|
2764
|
+
subscribe: string;
|
|
2765
|
+
trialStart: string;
|
|
2766
|
+
payAmount: string;
|
|
2767
|
+
addAmount: string;
|
|
2768
|
+
startUsing: string;
|
|
2769
|
+
processing: string;
|
|
2770
|
+
};
|
|
2771
|
+
interval: {
|
|
2772
|
+
day: string;
|
|
2773
|
+
week: string;
|
|
2774
|
+
month: string;
|
|
2775
|
+
year: string;
|
|
2776
|
+
every: string;
|
|
2777
|
+
free: string;
|
|
2778
|
+
trial: string;
|
|
2779
|
+
};
|
|
2780
|
+
terms: {
|
|
2781
|
+
checkboxLabel: string;
|
|
2782
|
+
};
|
|
2783
|
+
customer: {
|
|
2784
|
+
chargingTo: string;
|
|
2785
|
+
emailLabel: string;
|
|
2786
|
+
nameLabel: string;
|
|
2787
|
+
};
|
|
2788
|
+
balance: {
|
|
2789
|
+
credits: string;
|
|
2790
|
+
currencyEquivalent: string;
|
|
2791
|
+
};
|
|
2792
|
+
product: {
|
|
2793
|
+
currentProductLabel: string;
|
|
2794
|
+
};
|
|
2795
|
+
topup: {
|
|
2796
|
+
selectOrEnterAmount: string;
|
|
2797
|
+
minAmount: string;
|
|
2798
|
+
maxAmount: string;
|
|
2799
|
+
};
|
|
2800
|
+
activation: {
|
|
2801
|
+
paymentRequired: string;
|
|
2802
|
+
invalidConfiguration: string;
|
|
2803
|
+
unexpectedResponse: string;
|
|
2804
|
+
failed: string;
|
|
2805
|
+
};
|
|
2806
|
+
planSelector: {
|
|
2807
|
+
heading: string;
|
|
2808
|
+
currentBadge: string;
|
|
2809
|
+
popularBadge: string;
|
|
2810
|
+
freeBadge: string;
|
|
2811
|
+
perIntervalShort: string;
|
|
2812
|
+
continueButton: string;
|
|
2813
|
+
backButton: string;
|
|
2814
|
+
trialBadge: string;
|
|
2815
|
+
};
|
|
2816
|
+
amountPicker: {
|
|
2817
|
+
selectAmountLabel: string;
|
|
2818
|
+
customAmountLabel: string;
|
|
2819
|
+
creditEstimateExact: string;
|
|
2820
|
+
creditEstimateApprox: string;
|
|
2821
|
+
};
|
|
2822
|
+
activationFlow: {
|
|
2823
|
+
heading: string;
|
|
2824
|
+
activateButton: string;
|
|
2825
|
+
activatingLabel: string;
|
|
2826
|
+
topupHeading: string;
|
|
2827
|
+
topupSubheading: string;
|
|
2828
|
+
continueToPayment: string;
|
|
2829
|
+
changeAmountButton: string;
|
|
2830
|
+
retryingHeading: string;
|
|
2831
|
+
retryingSubheading: string;
|
|
2832
|
+
activatedHeading: string;
|
|
2833
|
+
activatedSubheading: string;
|
|
2834
|
+
tryAgainButton: string;
|
|
2835
|
+
backButton: string;
|
|
2836
|
+
};
|
|
2837
|
+
cancelPlan: {
|
|
2838
|
+
button: string;
|
|
2839
|
+
buttonLoading: string;
|
|
2840
|
+
confirmRecurring: string;
|
|
2841
|
+
confirmUsageBased: string;
|
|
2842
|
+
};
|
|
2843
|
+
cancelledNotice: {
|
|
2844
|
+
heading: string;
|
|
2845
|
+
expiresLabel: string;
|
|
2846
|
+
daysRemaining: string;
|
|
2847
|
+
dayRemaining: string;
|
|
2848
|
+
accessUntil: string;
|
|
2849
|
+
accessEnded: string;
|
|
2850
|
+
cancelledOn: string;
|
|
2851
|
+
reactivateButton: string;
|
|
2852
|
+
reactivateButtonLoading: string;
|
|
2853
|
+
};
|
|
2854
|
+
creditGate: {
|
|
2855
|
+
lowBalanceHeading: string;
|
|
2856
|
+
lowBalanceSubheading: string;
|
|
2857
|
+
topUpCta: string;
|
|
2858
|
+
};
|
|
2859
|
+
currentPlan: {
|
|
2860
|
+
heading: string;
|
|
2861
|
+
nextBilling: string;
|
|
2862
|
+
expiresOn: string;
|
|
2863
|
+
validIndefinitely: string;
|
|
2864
|
+
paymentMethod: string;
|
|
2865
|
+
paymentMethodExpires: string;
|
|
2866
|
+
noPaymentMethod: string;
|
|
2867
|
+
updatePaymentButton: string;
|
|
2868
|
+
/**
|
|
2869
|
+
* Human-readable unit names for `billingCycle`, used as the `interval`
|
|
2870
|
+
* arg to `formatPrice` so a monthly SEK plan renders "500 kr / month"
|
|
2871
|
+
* rather than "500 kr / monthly".
|
|
2872
|
+
*/
|
|
2873
|
+
cycleUnit: {
|
|
2874
|
+
weekly: string;
|
|
2875
|
+
monthly: string;
|
|
2876
|
+
quarterly: string;
|
|
2877
|
+
yearly: string;
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2880
|
+
customerPortal: {
|
|
2881
|
+
launchButton: string;
|
|
2882
|
+
loadingLabel: string;
|
|
2883
|
+
};
|
|
2884
|
+
errors: {
|
|
2885
|
+
paymentInitFailed: string;
|
|
2886
|
+
topupInitFailed: string;
|
|
2887
|
+
configMissingPlanOrProduct: string;
|
|
2888
|
+
configMissingAmount: string;
|
|
2889
|
+
unknownError: string;
|
|
2890
|
+
stripeUnavailable: string;
|
|
2891
|
+
paymentIntentUnavailable: string;
|
|
2892
|
+
cardElementMissing: string;
|
|
2893
|
+
paymentUnexpected: string;
|
|
2894
|
+
paymentProcessingFailed: string;
|
|
2895
|
+
paymentRequires3ds: string;
|
|
2896
|
+
paymentProcessingTimeout: string;
|
|
2897
|
+
paymentConfirmationDelayed: string;
|
|
2898
|
+
paymentStatusPrefix: string;
|
|
2899
|
+
paywallInvalidContent: string;
|
|
2900
|
+
usageLoadFailed: string;
|
|
2901
|
+
};
|
|
2902
|
+
paywall: {
|
|
2903
|
+
header: string;
|
|
2904
|
+
paymentRequiredHeading: string;
|
|
2905
|
+
activationRequiredHeading: string;
|
|
2906
|
+
resolvedHeading: string;
|
|
2907
|
+
productContext: string;
|
|
2908
|
+
balanceLine: string;
|
|
2909
|
+
paymentRequiredMessage: string;
|
|
2910
|
+
paymentRequiredMessageRemaining: string;
|
|
2911
|
+
paymentRequiredProductSuffix: string;
|
|
2912
|
+
retryButton: string;
|
|
2913
|
+
hostedCheckoutButton: string;
|
|
2914
|
+
hostedCheckoutLoading: string;
|
|
2915
|
+
};
|
|
2916
|
+
usage: {
|
|
2917
|
+
header: string;
|
|
2918
|
+
percentUsedLabel: string;
|
|
2919
|
+
usedLabel: string;
|
|
2920
|
+
remainingLabel: string;
|
|
2921
|
+
unlimitedLabel: string;
|
|
2922
|
+
resetsInLabel: string;
|
|
2923
|
+
resetsOnLabel: string;
|
|
2924
|
+
loadingLabel: string;
|
|
2925
|
+
emptyLabel: string;
|
|
2926
|
+
approachingLimit: string;
|
|
2927
|
+
atLimit: string;
|
|
2928
|
+
topUpCta: string;
|
|
2929
|
+
upgradeCta: string;
|
|
2930
|
+
refreshCta: string;
|
|
2931
|
+
};
|
|
2932
|
+
}
|
|
2933
|
+
/**
|
|
2934
|
+
* Deep-partial type for consumer overrides — every nested key is optional so
|
|
2935
|
+
* integrators can override only the strings they care about.
|
|
2936
|
+
*/
|
|
2937
|
+
type PartialSolvaPayCopy = {
|
|
2938
|
+
[K in keyof SolvaPayCopy]?: Partial<SolvaPayCopy[K]>;
|
|
2939
|
+
};
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* Unified data-access surface for `@solvapay/react`.
|
|
2943
|
+
*
|
|
2944
|
+
* By default, `SolvaPayProvider` builds an HTTP transport from `config.api` +
|
|
2945
|
+
* `config.fetch`. Integrators who need to route those calls somewhere else
|
|
2946
|
+
* (e.g. an MCP host tunnelling through `app.callServerTool`) pass a
|
|
2947
|
+
* `transport` on the provider config, replacing every call at once.
|
|
2948
|
+
*
|
|
2949
|
+
* See `@solvapay/react/mcp` for the canonical non-HTTP implementation.
|
|
2950
|
+
*/
|
|
2951
|
+
|
|
2952
|
+
interface TransportBalanceResult {
|
|
2953
|
+
credits: number;
|
|
2954
|
+
displayCurrency: string;
|
|
2955
|
+
creditsPerMinorUnit: number;
|
|
2956
|
+
displayExchangeRate: number;
|
|
2957
|
+
}
|
|
2958
|
+
interface TransportCheckoutSessionResult {
|
|
2959
|
+
checkoutUrl: string;
|
|
2960
|
+
}
|
|
2961
|
+
interface TransportCustomerSessionResult {
|
|
2962
|
+
customerUrl: string;
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* Every method is required. Transports that can't honour a method should
|
|
2966
|
+
* throw `UnsupportedTransportMethodError` from that method so callers can
|
|
2967
|
+
* feature-detect with `catch (err) { if (err instanceof UnsupportedTransportMethodError) ... }`.
|
|
2968
|
+
*
|
|
2969
|
+
* For the MCP adapter, this is usually unnecessary: `app.callServerTool`
|
|
2970
|
+
* already returns a structured error when the server doesn't expose the
|
|
2971
|
+
* tool, and the adapter propagates that straight through.
|
|
2972
|
+
*/
|
|
2973
|
+
interface SolvaPayTransport {
|
|
2974
|
+
/**
|
|
2975
|
+
* Read tools. HTTP transports implement these via `GET /api/*` routes.
|
|
2976
|
+
* MCP adapters omit them because the data is delivered on the
|
|
2977
|
+
* bootstrap payload (see `BootstrapPayload.customer` / `merchant` /
|
|
2978
|
+
* `product` / `plans` in `@solvapay/mcp`). Hooks consume these via
|
|
2979
|
+
* module-level caches that the MCP host seeds at mount time, so the
|
|
2980
|
+
* transport path is only exercised on HTTP.
|
|
2981
|
+
*/
|
|
2982
|
+
checkPurchase?: () => Promise<CustomerPurchaseData>;
|
|
2983
|
+
getBalance?: () => Promise<TransportBalanceResult>;
|
|
2984
|
+
getMerchant?: () => Promise<Merchant>;
|
|
2985
|
+
getProduct?: (productRef: string) => Promise<Product>;
|
|
2986
|
+
listPlans?: (productRef: string) => Promise<Plan[]>;
|
|
2987
|
+
/**
|
|
2988
|
+
* Fetch the customer's default payment method for rendering under
|
|
2989
|
+
* `<CurrentPlanCard>`. Returns `{ kind: 'none' }` when no card is on
|
|
2990
|
+
* file — the SDK treats both that and a throw as "hide the section".
|
|
2991
|
+
* HTTP transports implement via `GET /api/payment-method`; MCP
|
|
2992
|
+
* adapters omit (the field is on the bootstrap customer snapshot).
|
|
2993
|
+
*/
|
|
2994
|
+
getPaymentMethod?: () => Promise<PaymentMethodInfo>;
|
|
2995
|
+
/**
|
|
2996
|
+
* Optional: fetch the authenticated customer's usage snapshot for the
|
|
2997
|
+
* active usage-based plan. When omitted, `useUsage()` falls back to
|
|
2998
|
+
* reading the usage field out of `checkPurchase`.
|
|
2999
|
+
*/
|
|
3000
|
+
getUsage?: () => Promise<GetUsageResult>;
|
|
3001
|
+
createPayment: (params: {
|
|
3002
|
+
planRef?: string;
|
|
3003
|
+
productRef?: string;
|
|
3004
|
+
customer?: PrefillCustomer;
|
|
3005
|
+
}) => Promise<PaymentIntentResult>;
|
|
3006
|
+
processPayment: (params: {
|
|
3007
|
+
paymentIntentId: string;
|
|
3008
|
+
productRef: string;
|
|
3009
|
+
planRef?: string;
|
|
3010
|
+
}) => Promise<ProcessPaymentResult>;
|
|
3011
|
+
createTopupPayment: (params: {
|
|
3012
|
+
amount: number;
|
|
3013
|
+
currency?: string;
|
|
3014
|
+
}) => Promise<TopupPaymentResult>;
|
|
3015
|
+
cancelRenewal: (params: {
|
|
3016
|
+
purchaseRef: string;
|
|
3017
|
+
reason?: string;
|
|
3018
|
+
}) => Promise<CancelResult>;
|
|
3019
|
+
reactivateRenewal: (params: {
|
|
3020
|
+
purchaseRef: string;
|
|
3021
|
+
}) => Promise<ReactivateResult>;
|
|
3022
|
+
activatePlan: (params: {
|
|
3023
|
+
productRef: string;
|
|
3024
|
+
planRef: string;
|
|
3025
|
+
}) => Promise<ActivatePlanResult>;
|
|
3026
|
+
createCheckoutSession: (params?: {
|
|
3027
|
+
planRef?: string;
|
|
3028
|
+
productRef?: string;
|
|
3029
|
+
returnUrl?: string;
|
|
3030
|
+
}) => Promise<TransportCheckoutSessionResult>;
|
|
3031
|
+
createCustomerSession: () => Promise<TransportCustomerSessionResult>;
|
|
3032
|
+
}
|
|
3033
|
+
declare class UnsupportedTransportMethodError extends Error {
|
|
3034
|
+
readonly method: string;
|
|
3035
|
+
constructor(method: string);
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
interface PurchaseInfo {
|
|
3039
|
+
reference: string;
|
|
3040
|
+
productName: string;
|
|
3041
|
+
productRef?: string;
|
|
3042
|
+
status: string;
|
|
3043
|
+
startDate: string;
|
|
3044
|
+
endDate?: string;
|
|
3045
|
+
cancelledAt?: string;
|
|
3046
|
+
cancellationReason?: string;
|
|
3047
|
+
/** Normalised amount in USD cents (for cross-currency aggregation). */
|
|
3048
|
+
amount?: number;
|
|
3049
|
+
/** Amount in minor units of `currency` — what the customer was actually charged. */
|
|
3050
|
+
originalAmount?: number;
|
|
3051
|
+
currency?: string;
|
|
3052
|
+
/** Exchange rate used to convert `originalAmount` → `amount` (USD). */
|
|
3053
|
+
exchangeRate?: number;
|
|
3054
|
+
planType?: string;
|
|
3055
|
+
isRecurring?: boolean;
|
|
3056
|
+
nextBillingDate?: string;
|
|
3057
|
+
billingCycle?: string;
|
|
3058
|
+
planRef?: string;
|
|
3059
|
+
planSnapshot?: {
|
|
3060
|
+
reference?: string;
|
|
3061
|
+
name?: string | null;
|
|
3062
|
+
price?: number;
|
|
3063
|
+
meterRef?: string;
|
|
3064
|
+
limit?: number;
|
|
3065
|
+
freeUnits?: number;
|
|
3066
|
+
creditsPerUnit?: number;
|
|
3067
|
+
planType?: string;
|
|
3068
|
+
billingCycle?: string | null;
|
|
3069
|
+
features?: Record<string, unknown> | null;
|
|
3070
|
+
};
|
|
3071
|
+
usage?: {
|
|
3072
|
+
used: number;
|
|
3073
|
+
overageUnits?: number;
|
|
3074
|
+
overageCost?: number;
|
|
3075
|
+
periodStart?: string;
|
|
3076
|
+
periodEnd?: string;
|
|
3077
|
+
};
|
|
3078
|
+
/**
|
|
3079
|
+
* Arbitrary metadata attached to the purchase. `metadata.purpose ===
|
|
3080
|
+
* 'credit_topup'` signals a balance top-up rather than a plan purchase;
|
|
3081
|
+
* see `isPlanPurchase` / `isTopupPurchase` for classification helpers.
|
|
3082
|
+
*/
|
|
3083
|
+
metadata?: Record<string, unknown>;
|
|
3084
|
+
}
|
|
3085
|
+
interface CustomerPurchaseData {
|
|
3086
|
+
customerRef?: string;
|
|
3087
|
+
email?: string;
|
|
3088
|
+
name?: string;
|
|
3089
|
+
purchases: PurchaseInfo[];
|
|
3090
|
+
}
|
|
3091
|
+
interface PaymentIntentResult {
|
|
3092
|
+
clientSecret: string;
|
|
3093
|
+
publishableKey: string;
|
|
3094
|
+
accountId?: string;
|
|
3095
|
+
customerRef?: string;
|
|
3096
|
+
}
|
|
3097
|
+
/**
|
|
3098
|
+
* Subset of merchant identity surfaced by `GET /v1/sdk/merchant`.
|
|
3099
|
+
* Used by `<MandateText>` and customer-facing trust signals.
|
|
3100
|
+
*/
|
|
3101
|
+
interface Merchant {
|
|
3102
|
+
displayName: string;
|
|
3103
|
+
legalName: string;
|
|
3104
|
+
supportEmail?: string;
|
|
3105
|
+
supportUrl?: string;
|
|
3106
|
+
termsUrl?: string;
|
|
3107
|
+
privacyUrl?: string;
|
|
3108
|
+
country?: string;
|
|
3109
|
+
defaultCurrency?: string;
|
|
3110
|
+
statementDescriptor?: string;
|
|
3111
|
+
logoUrl?: string;
|
|
3112
|
+
}
|
|
3113
|
+
interface UseMerchantReturn {
|
|
3114
|
+
merchant: Merchant | null;
|
|
3115
|
+
loading: boolean;
|
|
3116
|
+
error: Error | null;
|
|
3117
|
+
refetch: () => Promise<void>;
|
|
3118
|
+
}
|
|
3119
|
+
interface Product {
|
|
3120
|
+
reference: string;
|
|
3121
|
+
name?: string;
|
|
3122
|
+
description?: string;
|
|
3123
|
+
status?: string;
|
|
3124
|
+
[key: string]: unknown;
|
|
3125
|
+
}
|
|
3126
|
+
interface UseProductReturn {
|
|
3127
|
+
product: Product | null;
|
|
3128
|
+
loading: boolean;
|
|
3129
|
+
error: Error | null;
|
|
3130
|
+
refetch: () => Promise<void>;
|
|
3131
|
+
}
|
|
3132
|
+
interface UsePlanOptions {
|
|
3133
|
+
/** Plan reference (e.g. `'pln_premium'`). */
|
|
3134
|
+
planRef?: string;
|
|
3135
|
+
/**
|
|
3136
|
+
* Optional product reference. When provided, the hook reuses the
|
|
3137
|
+
* `usePlans` cache instead of fetching a dedicated plan endpoint.
|
|
3138
|
+
*/
|
|
3139
|
+
productRef?: string;
|
|
3140
|
+
/**
|
|
3141
|
+
* Fetcher for plan lookup when `productRef` is not provided. Required in
|
|
3142
|
+
* that mode so the hook stays dependency-free.
|
|
3143
|
+
*/
|
|
3144
|
+
fetcher?: (productRef: string) => Promise<Plan[]>;
|
|
3145
|
+
}
|
|
3146
|
+
interface UsePlanReturn {
|
|
3147
|
+
plan: Plan | null;
|
|
3148
|
+
loading: boolean;
|
|
3149
|
+
error: Error | null;
|
|
3150
|
+
refetch: () => Promise<void>;
|
|
3151
|
+
}
|
|
3152
|
+
/**
|
|
3153
|
+
* Optional customer fields forwarded to payment-intent creation so the
|
|
3154
|
+
* backend customer record is authoritative. Read back via `useCustomer()`
|
|
3155
|
+
* after the intent is created.
|
|
3156
|
+
*/
|
|
3157
|
+
interface PrefillCustomer {
|
|
3158
|
+
name?: string;
|
|
3159
|
+
email?: string;
|
|
3160
|
+
}
|
|
3161
|
+
interface TopupPaymentResult {
|
|
3162
|
+
clientSecret: string;
|
|
3163
|
+
publishableKey: string;
|
|
3164
|
+
accountId?: string;
|
|
3165
|
+
customerRef?: string;
|
|
3166
|
+
}
|
|
3167
|
+
interface UseTopupOptions {
|
|
3168
|
+
amount: number;
|
|
3169
|
+
currency?: string;
|
|
3170
|
+
}
|
|
3171
|
+
interface UseTopupReturn {
|
|
3172
|
+
loading: boolean;
|
|
3173
|
+
error: Error | null;
|
|
3174
|
+
stripePromise: Promise<_stripe_stripe_js.Stripe | null> | null;
|
|
3175
|
+
clientSecret: string | null;
|
|
3176
|
+
startTopup: () => Promise<void>;
|
|
3177
|
+
reset: () => void;
|
|
3178
|
+
}
|
|
3179
|
+
interface TopupFormProps {
|
|
3180
|
+
amount: number;
|
|
3181
|
+
currency?: string;
|
|
3182
|
+
onSuccess?: (paymentIntent: PaymentIntent) => void;
|
|
3183
|
+
onError?: (error: Error) => void;
|
|
3184
|
+
returnUrl?: string;
|
|
3185
|
+
submitButtonText?: string;
|
|
3186
|
+
className?: string;
|
|
3187
|
+
buttonClassName?: string;
|
|
3188
|
+
}
|
|
3189
|
+
interface PurchaseStatus {
|
|
3190
|
+
loading: boolean;
|
|
3191
|
+
/** True when data already exists but a background refetch is in progress */
|
|
3192
|
+
isRefetching: boolean;
|
|
3193
|
+
/** Last fetch error, or null if the most recent fetch succeeded */
|
|
3194
|
+
error: Error | null;
|
|
3195
|
+
customerRef?: string;
|
|
3196
|
+
email?: string;
|
|
3197
|
+
name?: string;
|
|
3198
|
+
purchases: PurchaseInfo[];
|
|
3199
|
+
hasProduct: (productName: string) => boolean;
|
|
3200
|
+
/**
|
|
3201
|
+
* Primary active purchase (paid or free) - most recent purchase with status === 'active'
|
|
3202
|
+
* Backend keeps purchases as 'active' until expiration, even when cancelled.
|
|
3203
|
+
* null if no active purchase exists
|
|
3204
|
+
*/
|
|
3205
|
+
activePurchase: PurchaseInfo | null;
|
|
3206
|
+
/**
|
|
3207
|
+
* Check if user has any active paid purchase (amount > 0)
|
|
3208
|
+
* Checks purchases with status === 'active'.
|
|
3209
|
+
* Backend keeps purchases as 'active' until expiration, even when cancelled.
|
|
3210
|
+
*/
|
|
3211
|
+
hasPaidPurchase: boolean;
|
|
3212
|
+
/**
|
|
3213
|
+
* Most recent active paid purchase (sorted by startDate)
|
|
3214
|
+
* Returns purchase with status === 'active' and amount > 0.
|
|
3215
|
+
* null if no active paid purchase exists
|
|
3216
|
+
*/
|
|
3217
|
+
activePaidPurchase: PurchaseInfo | null;
|
|
3218
|
+
/**
|
|
3219
|
+
* Purchases that are not plans — e.g. credit top-ups, and any future
|
|
3220
|
+
* balance-transaction purposes the backend introduces. Classified
|
|
3221
|
+
* structurally (`planSnapshot == null`) with a belt-and-braces check on
|
|
3222
|
+
* `metadata.purpose`. See `isPlanPurchase` / `isTopupPurchase`.
|
|
3223
|
+
*/
|
|
3224
|
+
balanceTransactions: PurchaseInfo[];
|
|
3225
|
+
}
|
|
3226
|
+
/**
|
|
3227
|
+
* SolvaPay Provider Configuration
|
|
3228
|
+
* Sensible defaults for minimal code, but fully customizable
|
|
3229
|
+
*/
|
|
3230
|
+
interface BalanceStatus {
|
|
3231
|
+
loading: boolean;
|
|
3232
|
+
credits: number | null;
|
|
3233
|
+
displayCurrency: string | null;
|
|
3234
|
+
creditsPerMinorUnit: number | null;
|
|
3235
|
+
displayExchangeRate: number | null;
|
|
3236
|
+
refetch: () => Promise<void>;
|
|
3237
|
+
adjustBalance: (credits: number) => void;
|
|
3238
|
+
}
|
|
3239
|
+
/**
|
|
3240
|
+
* Hydration seed passed by MCP App hosts so `SolvaPayProvider` can mount
|
|
3241
|
+
* with cached data instead of firing per-view tool calls. Non-MCP
|
|
3242
|
+
* integrators leave this undefined — all current behaviour (fetch on
|
|
3243
|
+
* mount, HTTP routes) is preserved.
|
|
3244
|
+
*/
|
|
3245
|
+
interface SolvaPayProviderInitial {
|
|
3246
|
+
/** Authenticated customer ref (`customer.ref` from the bootstrap). */
|
|
3247
|
+
customerRef: string | null;
|
|
3248
|
+
purchase: PurchaseCheckResult | null;
|
|
3249
|
+
paymentMethod: PaymentMethodInfo | null;
|
|
3250
|
+
balance: CustomerBalanceResult | null;
|
|
3251
|
+
usage: GetUsageResult | null;
|
|
3252
|
+
merchant: Merchant;
|
|
3253
|
+
product: Product;
|
|
3254
|
+
plans: Plan[];
|
|
3255
|
+
}
|
|
3256
|
+
interface SolvaPayConfig {
|
|
3257
|
+
/**
|
|
3258
|
+
* API route configuration
|
|
3259
|
+
* Defaults to standard Next.js API routes
|
|
3260
|
+
*/
|
|
3261
|
+
api?: {
|
|
3262
|
+
checkPurchase?: string;
|
|
3263
|
+
createPayment?: string;
|
|
3264
|
+
processPayment?: string;
|
|
3265
|
+
createTopupPayment?: string;
|
|
3266
|
+
customerBalance?: string;
|
|
3267
|
+
cancelRenewal?: string;
|
|
3268
|
+
reactivateRenewal?: string;
|
|
3269
|
+
activatePlan?: string;
|
|
3270
|
+
listPlans?: string;
|
|
3271
|
+
getMerchant?: string;
|
|
3272
|
+
getProduct?: string;
|
|
3273
|
+
createCheckoutSession?: string;
|
|
3274
|
+
createCustomerSession?: string;
|
|
3275
|
+
getPaymentMethod?: string;
|
|
3276
|
+
getUsage?: string;
|
|
3277
|
+
};
|
|
3278
|
+
/**
|
|
3279
|
+
* Data-access transport. Replaces the default HTTP calls with any
|
|
3280
|
+
* compatible implementation (e.g. `createMcpAppAdapter(app)` from
|
|
3281
|
+
* `@solvapay/react/mcp`). When omitted, the provider builds a default
|
|
3282
|
+
* HTTP transport from `config.api` + `config.fetch`.
|
|
3283
|
+
*/
|
|
3284
|
+
transport?: SolvaPayTransport;
|
|
3285
|
+
/**
|
|
3286
|
+
* BCP-47 locale tag (e.g. 'en', 'sv-SE'). Threaded through every SDK
|
|
3287
|
+
* component, `Intl.NumberFormat`, and Stripe Elements. Defaults to the
|
|
3288
|
+
* runtime default (typically 'en').
|
|
3289
|
+
*/
|
|
3290
|
+
locale?: string;
|
|
3291
|
+
/**
|
|
3292
|
+
* Partial copy overrides. Keys not supplied fall back to the bundled English
|
|
3293
|
+
* defaults — consumers only provide the strings they actually want to change.
|
|
3294
|
+
*/
|
|
3295
|
+
copy?: PartialSolvaPayCopy;
|
|
3296
|
+
/**
|
|
3297
|
+
* Authentication configuration
|
|
3298
|
+
* Uses adapter pattern for flexible auth provider support
|
|
3299
|
+
*/
|
|
3300
|
+
auth?: {
|
|
3301
|
+
/**
|
|
3302
|
+
* Auth adapter instance
|
|
3303
|
+
* Default: checks localStorage for 'auth_token' key
|
|
3304
|
+
*
|
|
3305
|
+
* @example
|
|
3306
|
+
* ```tsx
|
|
3307
|
+
* import { createSupabaseAuthAdapter } from '@solvapay/react-supabase';
|
|
3308
|
+
*
|
|
3309
|
+
* <SolvaPayProvider
|
|
3310
|
+
* config={{
|
|
3311
|
+
* auth: {
|
|
3312
|
+
* adapter: createSupabaseAuthAdapter({
|
|
3313
|
+
* supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
3314
|
+
* supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
3315
|
+
* })
|
|
3316
|
+
* }
|
|
3317
|
+
* }}
|
|
3318
|
+
* >
|
|
3319
|
+
* ```
|
|
3320
|
+
*/
|
|
3321
|
+
adapter?: AuthAdapter;
|
|
3322
|
+
};
|
|
3323
|
+
/**
|
|
3324
|
+
* Custom fetch implementation
|
|
3325
|
+
* Default: uses global fetch
|
|
3326
|
+
*/
|
|
3327
|
+
fetch?: typeof fetch;
|
|
3328
|
+
/**
|
|
3329
|
+
* Request headers to include in all API calls
|
|
3330
|
+
* Default: empty
|
|
3331
|
+
*/
|
|
3332
|
+
headers?: HeadersInit | (() => Promise<HeadersInit>);
|
|
3333
|
+
/**
|
|
3334
|
+
* Custom error handler
|
|
3335
|
+
* Default: logs to console
|
|
3336
|
+
*/
|
|
3337
|
+
onError?: (error: Error, context: string) => void;
|
|
3338
|
+
/**
|
|
3339
|
+
* Pre-fetched seed for MCP App hosts. When provided, the provider
|
|
3340
|
+
* mounts with the snapshot already applied — no `checkPurchase`,
|
|
3341
|
+
* `getBalance`, `getMerchant`, `getProduct`, `getPlans`, or
|
|
3342
|
+
* `getPaymentMethod` calls on first render. Non-MCP integrators leave
|
|
3343
|
+
* this undefined; HTTP behaviour is unchanged.
|
|
3344
|
+
*/
|
|
3345
|
+
initial?: SolvaPayProviderInitial;
|
|
3346
|
+
/**
|
|
3347
|
+
* Post-mutation re-fetch for MCP App hosts. When provided, the
|
|
3348
|
+
* provider's `refreshBootstrap()` calls this to get a fresh
|
|
3349
|
+
* `SolvaPayProviderInitial` snapshot (typically by re-invoking
|
|
3350
|
+
* `manage_account` on the host) and re-applies it to provider state
|
|
3351
|
+
* and the module caches. Non-MCP integrators leave this undefined —
|
|
3352
|
+
* `refreshBootstrap()` falls back to `refetchPurchase()` +
|
|
3353
|
+
* `balance.refetch()`. Return `null` to skip the refresh (e.g. when
|
|
3354
|
+
* the host is offline).
|
|
3355
|
+
*/
|
|
3356
|
+
refreshInitial?: () => Promise<SolvaPayProviderInitial | null>;
|
|
3357
|
+
}
|
|
3358
|
+
interface CancelResult {
|
|
3359
|
+
reference?: string;
|
|
3360
|
+
status?: string;
|
|
3361
|
+
cancelledAt?: string;
|
|
3362
|
+
[key: string]: unknown;
|
|
3363
|
+
}
|
|
3364
|
+
interface ReactivateResult {
|
|
3365
|
+
reference?: string;
|
|
3366
|
+
status?: string;
|
|
3367
|
+
[key: string]: unknown;
|
|
3368
|
+
}
|
|
3369
|
+
|
|
3370
|
+
interface UsePaymentMethodReturn {
|
|
3371
|
+
paymentMethod: PaymentMethodInfo | null;
|
|
3372
|
+
loading: boolean;
|
|
3373
|
+
error: Error | null;
|
|
3374
|
+
refetch: () => Promise<void>;
|
|
3375
|
+
}
|
|
3376
|
+
interface SolvaPayContextValue {
|
|
3377
|
+
purchase: PurchaseStatus;
|
|
3378
|
+
refetchPurchase: () => Promise<void>;
|
|
3379
|
+
createPayment: (params: {
|
|
3380
|
+
planRef?: string;
|
|
3381
|
+
productRef?: string;
|
|
3382
|
+
customer?: PrefillCustomer;
|
|
3383
|
+
}) => Promise<PaymentIntentResult>;
|
|
3384
|
+
processPayment?: (params: {
|
|
3385
|
+
paymentIntentId: string;
|
|
3386
|
+
productRef: string;
|
|
3387
|
+
planRef?: string;
|
|
3388
|
+
}) => Promise<ProcessPaymentResult>;
|
|
3389
|
+
createTopupPayment: (params: {
|
|
3390
|
+
amount: number;
|
|
3391
|
+
currency?: string;
|
|
3392
|
+
}) => Promise<TopupPaymentResult>;
|
|
3393
|
+
cancelRenewal: (params: {
|
|
3394
|
+
purchaseRef: string;
|
|
3395
|
+
reason?: string;
|
|
3396
|
+
}) => Promise<CancelResult>;
|
|
3397
|
+
reactivateRenewal: (params: {
|
|
3398
|
+
purchaseRef: string;
|
|
3399
|
+
}) => Promise<ReactivateResult>;
|
|
3400
|
+
activatePlan: (params: {
|
|
3401
|
+
productRef: string;
|
|
3402
|
+
planRef: string;
|
|
3403
|
+
}) => Promise<ActivatePlanResult>;
|
|
3404
|
+
customerRef?: string;
|
|
3405
|
+
updateCustomerRef?: (newCustomerRef: string) => void;
|
|
3406
|
+
balance: BalanceStatus;
|
|
3407
|
+
/**
|
|
3408
|
+
* Re-bootstrap the MCP snapshot (customer + product-scoped data).
|
|
3409
|
+
* Always callable; on non-MCP transports falls back to
|
|
3410
|
+
* `refetchPurchase()` + `balance.refetch()` so every caller can use
|
|
3411
|
+
* the same post-mutation hook.
|
|
3412
|
+
*/
|
|
3413
|
+
refreshBootstrap?: () => Promise<void>;
|
|
3414
|
+
/** @internal Provider config — used by SDK hooks, not part of public API */
|
|
3415
|
+
_config?: SolvaPayConfig;
|
|
3416
|
+
}
|
|
3417
|
+
interface SolvaPayProviderProps {
|
|
3418
|
+
/**
|
|
3419
|
+
* Configuration object with sensible defaults.
|
|
3420
|
+
*
|
|
3421
|
+
* To customise data access (e.g. route through MCP instead of HTTP), pass
|
|
3422
|
+
* `config.transport`. Legacy per-method overrides (`createPayment`,
|
|
3423
|
+
* `checkPurchase`, `processPayment`, `createTopupPayment`) have been
|
|
3424
|
+
* removed in favour of the unified transport surface — see
|
|
3425
|
+
* [`SolvaPayTransport`](../transport/types.ts) and
|
|
3426
|
+
* `@solvapay/react/mcp` for an MCP implementation.
|
|
3427
|
+
*/
|
|
3428
|
+
config?: SolvaPayConfig;
|
|
3429
|
+
children: React.ReactNode;
|
|
3430
|
+
}
|
|
3431
|
+
/**
|
|
3432
|
+
* Error type for payment operations
|
|
3433
|
+
*/
|
|
3434
|
+
interface PaymentError extends Error {
|
|
3435
|
+
code?: string;
|
|
3436
|
+
type?: string;
|
|
3437
|
+
}
|
|
3438
|
+
/**
|
|
3439
|
+
* Plan returned by the SolvaPay API.
|
|
3440
|
+
*
|
|
3441
|
+
* All fields are optional except `reference` so the type stays compatible
|
|
3442
|
+
* with partial JSON responses from custom fetcher functions.
|
|
3443
|
+
*/
|
|
3444
|
+
interface Plan {
|
|
3445
|
+
type?: 'recurring' | 'one-time' | 'usage-based';
|
|
3446
|
+
reference: string;
|
|
3447
|
+
name?: string;
|
|
3448
|
+
description?: string;
|
|
3449
|
+
price?: number;
|
|
3450
|
+
currency?: string;
|
|
3451
|
+
currencySymbol?: string;
|
|
3452
|
+
freeUnits?: number;
|
|
3453
|
+
setupFee?: number;
|
|
3454
|
+
trialDays?: number;
|
|
3455
|
+
billingCycle?: string;
|
|
3456
|
+
billingModel?: 'pre-paid' | 'post-paid';
|
|
3457
|
+
creditsPerUnit?: number;
|
|
3458
|
+
measures?: string;
|
|
3459
|
+
limit?: number;
|
|
3460
|
+
rolloverUnusedUnits?: boolean;
|
|
3461
|
+
limits?: Record<string, unknown>;
|
|
3462
|
+
features?: Record<string, unknown> | string[];
|
|
3463
|
+
requiresPayment?: boolean;
|
|
3464
|
+
default?: boolean;
|
|
3465
|
+
isActive?: boolean;
|
|
3466
|
+
maxActiveUsers?: number;
|
|
3467
|
+
accessExpiryDays?: number;
|
|
3468
|
+
status?: string;
|
|
3469
|
+
createdAt?: string;
|
|
3470
|
+
updatedAt?: string;
|
|
3471
|
+
interval?: string;
|
|
3472
|
+
metadata?: Record<string, unknown>;
|
|
3473
|
+
}
|
|
3474
|
+
/**
|
|
3475
|
+
* Options for usePlans hook
|
|
3476
|
+
*/
|
|
3477
|
+
interface UsePlansOptions {
|
|
3478
|
+
/**
|
|
3479
|
+
* Fetcher function to retrieve plans
|
|
3480
|
+
*/
|
|
3481
|
+
fetcher: (productRef: string) => Promise<Plan[]>;
|
|
3482
|
+
/**
|
|
3483
|
+
* Product reference to fetch plans for
|
|
3484
|
+
*/
|
|
3485
|
+
productRef?: string;
|
|
3486
|
+
/**
|
|
3487
|
+
* Optional filter function to filter plans.
|
|
3488
|
+
* Receives plan and its index (after sorting, if sortBy is provided).
|
|
3489
|
+
*/
|
|
3490
|
+
filter?: (plan: Plan, index: number) => boolean;
|
|
3491
|
+
/**
|
|
3492
|
+
* Optional sort function to sort plans
|
|
3493
|
+
*/
|
|
3494
|
+
sortBy?: (a: Plan, b: Plan) => number;
|
|
3495
|
+
/**
|
|
3496
|
+
* Auto-select first paid plan on load
|
|
3497
|
+
*/
|
|
3498
|
+
autoSelectFirstPaid?: boolean;
|
|
3499
|
+
/**
|
|
3500
|
+
* Plan reference to select initially when plans load.
|
|
3501
|
+
* Applied at most once when selectionReady is true.
|
|
3502
|
+
* Takes priority over autoSelectFirstPaid.
|
|
3503
|
+
*/
|
|
3504
|
+
initialPlanRef?: string;
|
|
3505
|
+
/**
|
|
3506
|
+
* When false, plans still fetch but auto-selection is deferred.
|
|
3507
|
+
* When it transitions to true, one-shot initial selection fires.
|
|
3508
|
+
* Defaults to true.
|
|
3509
|
+
*/
|
|
3510
|
+
selectionReady?: boolean;
|
|
3511
|
+
}
|
|
3512
|
+
/**
|
|
3513
|
+
* Return type for usePlans hook
|
|
3514
|
+
*/
|
|
3515
|
+
interface UsePlansReturn {
|
|
3516
|
+
plans: Plan[];
|
|
3517
|
+
loading: boolean;
|
|
3518
|
+
error: Error | null;
|
|
3519
|
+
selectedPlanIndex: number;
|
|
3520
|
+
selectedPlan: Plan | null;
|
|
3521
|
+
setSelectedPlanIndex: (index: number) => void;
|
|
3522
|
+
selectPlan: (planRef: string) => void;
|
|
3523
|
+
refetch: () => Promise<void>;
|
|
3524
|
+
/** True after the one-shot initial selection has been applied */
|
|
3525
|
+
isSelectionReady: boolean;
|
|
3526
|
+
}
|
|
3527
|
+
/**
|
|
3528
|
+
* Return type for usePurchaseStatus hook
|
|
3529
|
+
*
|
|
3530
|
+
* Provides advanced purchase status helpers and utilities.
|
|
3531
|
+
* Focuses on cancelled purchase logic and date formatting.
|
|
3532
|
+
* For basic purchase data and paid status, use usePurchase() instead.
|
|
3533
|
+
*/
|
|
3534
|
+
interface PurchaseStatusReturn {
|
|
3535
|
+
/**
|
|
3536
|
+
* Most recent cancelled paid purchase (sorted by startDate)
|
|
3537
|
+
* null if no cancelled paid purchase exists
|
|
3538
|
+
*/
|
|
3539
|
+
cancelledPurchase: PurchaseInfo | null;
|
|
3540
|
+
/**
|
|
3541
|
+
* Whether to show cancelled purchase notice
|
|
3542
|
+
* true if cancelledPurchase exists
|
|
3543
|
+
*/
|
|
3544
|
+
shouldShowCancelledNotice: boolean;
|
|
3545
|
+
/**
|
|
3546
|
+
* Format a date string to locale format (e.g., "January 15, 2024")
|
|
3547
|
+
* Returns null if dateString is not provided
|
|
3548
|
+
*/
|
|
3549
|
+
formatDate: (dateString?: string) => string | null;
|
|
3550
|
+
/**
|
|
3551
|
+
* Calculate days until expiration date
|
|
3552
|
+
* Returns null if endDate is not provided, otherwise returns days (0 or positive)
|
|
3553
|
+
*/
|
|
3554
|
+
getDaysUntilExpiration: (endDate?: string) => number | null;
|
|
3555
|
+
}
|
|
3556
|
+
/**
|
|
3557
|
+
* Payment form props - simplified and minimal
|
|
3558
|
+
*/
|
|
3559
|
+
/**
|
|
3560
|
+
* Discriminated checkout-completion result surfaced by `<PaymentForm>` and
|
|
3561
|
+
* `<CheckoutLayout>` via their `onResult` callback. Integrators handling
|
|
3562
|
+
* both paid and free plans should use `onResult` to get a single typed
|
|
3563
|
+
* callback; paid-only integrators keep using `onSuccess(paymentIntent)`.
|
|
3564
|
+
*/
|
|
3565
|
+
type PaymentResult = {
|
|
3566
|
+
kind: 'paid';
|
|
3567
|
+
paymentIntent: PaymentIntent;
|
|
3568
|
+
};
|
|
3569
|
+
type ActivationResult = {
|
|
3570
|
+
kind: 'activated';
|
|
3571
|
+
result: ActivatePlanResult;
|
|
3572
|
+
};
|
|
3573
|
+
type CheckoutResult = PaymentResult | ActivationResult;
|
|
3574
|
+
interface PaymentFormProps {
|
|
3575
|
+
/**
|
|
3576
|
+
* Plan reference to checkout. When omitted, the SDK auto-resolves the plan from
|
|
3577
|
+
* productRef (requires exactly one active plan or a default plan). Pass explicitly
|
|
3578
|
+
* when the product has multiple plans without a default.
|
|
3579
|
+
*/
|
|
3580
|
+
planRef?: string;
|
|
3581
|
+
/**
|
|
3582
|
+
* Product reference. Required when planRef is omitted (for plan resolution)
|
|
3583
|
+
* and for processing payment after confirmation.
|
|
3584
|
+
*/
|
|
3585
|
+
productRef?: string;
|
|
3586
|
+
/**
|
|
3587
|
+
* Callback when payment succeeds. Fires on paid flows only — preserved
|
|
3588
|
+
* exactly for backwards compatibility. Free/activation flows do NOT fire
|
|
3589
|
+
* `onSuccess`; use `onResult` to receive both paid and activated results.
|
|
3590
|
+
*/
|
|
3591
|
+
onSuccess?: (paymentIntent: PaymentIntent) => void;
|
|
3592
|
+
/**
|
|
3593
|
+
* Unified callback fired on both paid and activated completions with a
|
|
3594
|
+
* discriminated result. Safe to provide alongside `onSuccess` — for paid
|
|
3595
|
+
* flows both fire (in order: `onSuccess` first, then `onResult`).
|
|
3596
|
+
*/
|
|
3597
|
+
onResult?: (result: CheckoutResult) => void;
|
|
3598
|
+
/**
|
|
3599
|
+
* Override the default free-plan activation step. When provided, the form
|
|
3600
|
+
* awaits this promise on submit and fires `onResult` when it resolves.
|
|
3601
|
+
* When omitted, the default behavior calls `activatePlan` from context.
|
|
3602
|
+
*/
|
|
3603
|
+
onFreePlan?: (plan: Plan) => Promise<unknown> | void;
|
|
3604
|
+
/**
|
|
3605
|
+
* Callback when payment fails
|
|
3606
|
+
*/
|
|
3607
|
+
onError?: (error: Error) => void;
|
|
3608
|
+
/**
|
|
3609
|
+
* Return URL after payment completion. Defaults to current page URL if not provided.
|
|
3610
|
+
*/
|
|
3611
|
+
returnUrl?: string;
|
|
3612
|
+
/**
|
|
3613
|
+
* Text for the submit button. Defaults to "Pay Now"
|
|
3614
|
+
*/
|
|
3615
|
+
submitButtonText?: string;
|
|
3616
|
+
/**
|
|
3617
|
+
* Optional className for the form container
|
|
3618
|
+
*/
|
|
3619
|
+
className?: string;
|
|
3620
|
+
/**
|
|
3621
|
+
* Optional className for the submit button
|
|
3622
|
+
*/
|
|
3623
|
+
buttonClassName?: string;
|
|
3624
|
+
/**
|
|
3625
|
+
* Customer name/email to forward to backend PaymentIntent creation so the
|
|
3626
|
+
* server-side customer record is authoritative. Echoed back via
|
|
3627
|
+
* `useCustomer()` after the intent is created.
|
|
3628
|
+
*/
|
|
3629
|
+
prefillCustomer?: PrefillCustomer;
|
|
3630
|
+
/**
|
|
3631
|
+
* When true, the default tree renders a terms/privacy checkbox and gates
|
|
3632
|
+
* the submit button until it is ticked. No-op when custom `children` are
|
|
3633
|
+
* passed — compose `<PaymentForm.TermsCheckbox />` yourself.
|
|
3634
|
+
*/
|
|
3635
|
+
requireTermsAcceptance?: boolean;
|
|
3636
|
+
}
|
|
3637
|
+
interface UseTopupAmountSelectorOptions {
|
|
3638
|
+
currency: string;
|
|
3639
|
+
minAmount?: number;
|
|
3640
|
+
maxAmount?: number;
|
|
3641
|
+
}
|
|
3642
|
+
interface UseTopupAmountSelectorReturn {
|
|
3643
|
+
quickAmounts: number[];
|
|
3644
|
+
selectedAmount: number | null;
|
|
3645
|
+
customAmount: string;
|
|
3646
|
+
resolvedAmount: number | null;
|
|
3647
|
+
selectQuickAmount: (amount: number) => void;
|
|
3648
|
+
setCustomAmount: (value: string) => void;
|
|
3649
|
+
error: string | null;
|
|
3650
|
+
validate: () => boolean;
|
|
3651
|
+
reset: () => void;
|
|
3652
|
+
currencySymbol: string;
|
|
3653
|
+
}
|
|
3654
|
+
type PurchaseStatusValue = 'pending' | 'active' | 'trialing' | 'past_due' | 'cancelled' | 'expired' | 'suspended' | 'refunded';
|
|
3655
|
+
|
|
3656
|
+
export { type ActivationResult as A, type BalanceStatus as B, type CheckoutResult as C, type Merchant as D, type PaymentError as E, type PaymentIntentResult as F, type PaymentMethodInfo as G, type PaymentResult as H, type PurchaseStatusValue as I, type TopupPaymentResult as J, type TransportBalanceResult as K, type TransportCheckoutSessionResult as L, type MandateContext as M, type TransportCustomerSessionResult as N, UnsupportedTransportMethodError as O, type PaymentFormProps as P, type SolvaPayProviderInitial as Q, type ReactivateResult as R, type SolvaPayProviderProps as S, type TopupFormProps as T, type UsePlansOptions as U, type PrefillCustomer as a, type Plan as b, type PurchaseStatus as c, type SolvaPayContextValue as d, type UsePlansReturn as e, type UsePlanOptions as f, type UsePlanReturn as g, type UseProductReturn as h, type UseMerchantReturn as i, type SolvaPayCopy as j, type PurchaseStatusReturn as k, type CancelResult as l, type ActivatePlanResult as m, type UseTopupOptions as n, type UseTopupReturn as o, type UseTopupAmountSelectorOptions as p, type UseTopupAmountSelectorReturn as q, type UsePaymentMethodReturn as r, type SolvaPayTransport as s, type PaywallStructuredContent as t, type PartialSolvaPayCopy as u, type PurchaseInfo as v, type Product as w, type SolvaPayConfig as x, type CustomerPurchaseData as y, type MandateTemplate as z };
|