@solvapay/react 1.2.1 → 1.3.0-preview-cb8ad16e16ce8f8f357bd7f2e7068d85159df587
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 +11 -0
- package/dist/adapters/auth0.cjs +60 -0
- package/dist/adapters/auth0.d.cts +16 -0
- package/dist/adapters/auth0.d.ts +16 -0
- package/dist/adapters/auth0.js +15 -0
- package/dist/adapters/session-auth.cjs +49 -0
- package/dist/adapters/session-auth.d.cts +20 -0
- package/dist/adapters/session-auth.d.ts +20 -0
- package/dist/adapters/session-auth.js +6 -0
- package/dist/{chunk-XRNCDI2T.js → chunk-3UR4QQ5P.js} +1 -1
- package/dist/chunk-JTW665JR.js +25 -0
- package/dist/{chunk-Y2UAJG67.js → chunk-ORMHGGOU.js} +244 -73
- package/dist/{chunk-MYD6KTR2.js → chunk-WGDHMTDO.js} +1 -1
- package/dist/{index-DPoqku6R.d.cts → index-BwwdMBdt.d.ts} +20 -5
- package/dist/{index-Cs-QqpkJ.d.ts → index-kXLvp7EU.d.cts} +20 -5
- package/dist/index.cjs +294 -106
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +8 -3
- package/dist/mcp/index.cjs +328 -70
- package/dist/mcp/index.d.cts +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +131 -34
- package/dist/mcp/styles.css +39 -0
- package/dist/primitives/index.cjs +207 -38
- package/dist/primitives/index.d.cts +22 -5
- package/dist/primitives/index.d.ts +22 -5
- package/dist/primitives/index.js +6 -2
- package/dist/{shared-DpS2yEah.d.cts → shared-BNZAIWkU.d.cts} +196 -7
- package/dist/{shared-CXRbrNFw.d.ts → shared-lIhc8DS3.d.ts} +196 -7
- package/dist/styles.css +25 -0
- package/package.json +12 -7
package/dist/primitives/index.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
useCreditGate,
|
|
52
52
|
usePaywallNotice,
|
|
53
53
|
usePurchaseGate
|
|
54
|
-
} from "../chunk-
|
|
54
|
+
} from "../chunk-WGDHMTDO.js";
|
|
55
55
|
import {
|
|
56
56
|
AmountPicker,
|
|
57
57
|
AmountPickerConfirm,
|
|
@@ -98,9 +98,11 @@ import {
|
|
|
98
98
|
PlanSelector,
|
|
99
99
|
PlanSelectorCard,
|
|
100
100
|
PlanSelectorCardBadge,
|
|
101
|
+
PlanSelectorCardCurrency,
|
|
101
102
|
PlanSelectorCardInterval,
|
|
102
103
|
PlanSelectorCardName,
|
|
103
104
|
PlanSelectorCardPrice,
|
|
105
|
+
PlanSelectorCurrencySwitcher,
|
|
104
106
|
PlanSelectorError,
|
|
105
107
|
PlanSelectorGrid,
|
|
106
108
|
PlanSelectorHeading,
|
|
@@ -128,7 +130,7 @@ import {
|
|
|
128
130
|
usePlanSelector,
|
|
129
131
|
useTopupForm,
|
|
130
132
|
useUsageMeter
|
|
131
|
-
} from "../chunk-
|
|
133
|
+
} from "../chunk-ORMHGGOU.js";
|
|
132
134
|
import "../chunk-UMXOAUW7.js";
|
|
133
135
|
export {
|
|
134
136
|
ActivationFlow,
|
|
@@ -211,9 +213,11 @@ export {
|
|
|
211
213
|
PlanSelector,
|
|
212
214
|
PlanSelectorCard,
|
|
213
215
|
PlanSelectorCardBadge,
|
|
216
|
+
PlanSelectorCardCurrency,
|
|
214
217
|
PlanSelectorCardInterval,
|
|
215
218
|
PlanSelectorCardName,
|
|
216
219
|
PlanSelectorCardPrice,
|
|
220
|
+
PlanSelectorCurrencySwitcher,
|
|
217
221
|
PlanSelectorError,
|
|
218
222
|
PlanSelectorGrid,
|
|
219
223
|
PlanSelectorHeading,
|
|
@@ -33,6 +33,15 @@ interface components {
|
|
|
33
33
|
* @example usd
|
|
34
34
|
*/
|
|
35
35
|
defaultCurrency?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Full set of currencies a customer may pay credit topups in, including the default currency. Omitted/single-entry means single-currency behavior.
|
|
38
|
+
* @example [
|
|
39
|
+
* "USD",
|
|
40
|
+
* "EUR",
|
|
41
|
+
* "GBP"
|
|
42
|
+
* ]
|
|
43
|
+
*/
|
|
44
|
+
supportedTopupCurrencies?: string[];
|
|
36
45
|
/**
|
|
37
46
|
* Descriptor appearing on the customer card statement
|
|
38
47
|
* @example ACME INC
|
|
@@ -250,6 +259,33 @@ interface components {
|
|
|
250
259
|
*/
|
|
251
260
|
checkoutUrl: string;
|
|
252
261
|
};
|
|
262
|
+
PlanPricingOptionDto: {
|
|
263
|
+
/**
|
|
264
|
+
* ISO 4217 currency code
|
|
265
|
+
* @example USD
|
|
266
|
+
*/
|
|
267
|
+
currency: string;
|
|
268
|
+
/**
|
|
269
|
+
* Price in smallest currency unit (e.g. cents)
|
|
270
|
+
* @example 2999
|
|
271
|
+
*/
|
|
272
|
+
price: number;
|
|
273
|
+
/**
|
|
274
|
+
* Base price in smallest currency unit (hybrid plans)
|
|
275
|
+
* @example 1999
|
|
276
|
+
*/
|
|
277
|
+
basePrice?: number;
|
|
278
|
+
/**
|
|
279
|
+
* One-time setup fee in smallest currency unit
|
|
280
|
+
* @example 500
|
|
281
|
+
*/
|
|
282
|
+
setupFee?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Whether this is the default currency option for the plan
|
|
285
|
+
* @example true
|
|
286
|
+
*/
|
|
287
|
+
default?: boolean;
|
|
288
|
+
};
|
|
253
289
|
Plan: {
|
|
254
290
|
/**
|
|
255
291
|
* Plan type exposed in SDK
|
|
@@ -287,6 +323,8 @@ interface components {
|
|
|
287
323
|
* @example USD
|
|
288
324
|
*/
|
|
289
325
|
currency: string;
|
|
326
|
+
/** @description Per-currency price options for this plan */
|
|
327
|
+
pricingOptions?: components["schemas"]["PlanPricingOptionDto"][];
|
|
290
328
|
/**
|
|
291
329
|
* Currency symbol (derived from currency)
|
|
292
330
|
* @example $
|
|
@@ -380,6 +418,13 @@ interface components {
|
|
|
380
418
|
price?: number;
|
|
381
419
|
creditsPerUnit?: number;
|
|
382
420
|
currency?: string;
|
|
421
|
+
pricingOptions?: {
|
|
422
|
+
currency: string;
|
|
423
|
+
price: number;
|
|
424
|
+
basePrice?: number;
|
|
425
|
+
setupFee?: number;
|
|
426
|
+
default?: boolean;
|
|
427
|
+
}[];
|
|
383
428
|
/** @enum {string} */
|
|
384
429
|
billingModel?: "pre-paid" | "post-paid";
|
|
385
430
|
freeUnits?: number;
|
|
@@ -418,6 +463,13 @@ interface components {
|
|
|
418
463
|
price?: number;
|
|
419
464
|
creditsPerUnit?: number;
|
|
420
465
|
currency?: string;
|
|
466
|
+
pricingOptions?: {
|
|
467
|
+
currency: string;
|
|
468
|
+
price: number;
|
|
469
|
+
basePrice?: number;
|
|
470
|
+
setupFee?: number;
|
|
471
|
+
default?: boolean;
|
|
472
|
+
}[];
|
|
421
473
|
/** @enum {string} */
|
|
422
474
|
billingModel?: "pre-paid" | "post-paid";
|
|
423
475
|
freeUnits?: number;
|
|
@@ -662,6 +714,13 @@ interface components {
|
|
|
662
714
|
name: string;
|
|
663
715
|
price: number;
|
|
664
716
|
currency: string;
|
|
717
|
+
pricingOptions?: {
|
|
718
|
+
currency: string;
|
|
719
|
+
price: number;
|
|
720
|
+
basePrice?: number;
|
|
721
|
+
setupFee?: number;
|
|
722
|
+
default?: boolean;
|
|
723
|
+
}[];
|
|
665
724
|
/** @enum {string} */
|
|
666
725
|
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
667
726
|
/** @enum {string} */
|
|
@@ -730,6 +789,13 @@ interface components {
|
|
|
730
789
|
name: string;
|
|
731
790
|
price: number;
|
|
732
791
|
currency: string;
|
|
792
|
+
pricingOptions?: {
|
|
793
|
+
currency: string;
|
|
794
|
+
price: number;
|
|
795
|
+
basePrice?: number;
|
|
796
|
+
setupFee?: number;
|
|
797
|
+
default?: boolean;
|
|
798
|
+
}[];
|
|
733
799
|
/** @enum {string} */
|
|
734
800
|
billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
|
|
735
801
|
/** @enum {string} */
|
|
@@ -763,6 +829,52 @@ interface components {
|
|
|
763
829
|
CloneProductDto: {
|
|
764
830
|
name?: string;
|
|
765
831
|
};
|
|
832
|
+
CreditDebitSuccessResponse: {
|
|
833
|
+
/** @enum {number} */
|
|
834
|
+
debited: true;
|
|
835
|
+
/**
|
|
836
|
+
* Credits debited for this usage event
|
|
837
|
+
* @example 10
|
|
838
|
+
*/
|
|
839
|
+
amount: number;
|
|
840
|
+
/**
|
|
841
|
+
* Estimated remaining units after debit
|
|
842
|
+
* @example 99
|
|
843
|
+
*/
|
|
844
|
+
unitsRemaining: number;
|
|
845
|
+
};
|
|
846
|
+
CreditDebitSkippedResponse: {
|
|
847
|
+
/** @enum {number} */
|
|
848
|
+
debited: false;
|
|
849
|
+
/**
|
|
850
|
+
* Reason no credit debit was recorded
|
|
851
|
+
* @example duplicate
|
|
852
|
+
* @enum {string}
|
|
853
|
+
*/
|
|
854
|
+
reason: "duplicate" | "no_product_ref" | "customer_not_found" | "no_active_purchase" | "plan_not_credit_based";
|
|
855
|
+
};
|
|
856
|
+
UsageRecordResponse: {
|
|
857
|
+
/** @example true */
|
|
858
|
+
success: boolean;
|
|
859
|
+
/** @example usage_A1B2C3D4 */
|
|
860
|
+
reference: string;
|
|
861
|
+
creditDebit?: components["schemas"]["CreditDebitSuccessResponse"] | components["schemas"]["CreditDebitSkippedResponse"];
|
|
862
|
+
};
|
|
863
|
+
BulkUsageResultResponse: {
|
|
864
|
+
/** @example usage_A1B2C3D4 */
|
|
865
|
+
reference: string;
|
|
866
|
+
creditDebit?: components["schemas"]["CreditDebitSuccessResponse"] | components["schemas"]["CreditDebitSkippedResponse"];
|
|
867
|
+
};
|
|
868
|
+
BulkUsageResponse: {
|
|
869
|
+
/** @example true */
|
|
870
|
+
success: boolean;
|
|
871
|
+
/**
|
|
872
|
+
* Number of usage events inserted
|
|
873
|
+
* @example 2
|
|
874
|
+
*/
|
|
875
|
+
inserted: number;
|
|
876
|
+
results: components["schemas"]["BulkUsageResultResponse"][];
|
|
877
|
+
};
|
|
766
878
|
CreateUsageRequest: {
|
|
767
879
|
customerRef: string;
|
|
768
880
|
/**
|
|
@@ -1032,6 +1144,8 @@ interface components {
|
|
|
1032
1144
|
creditsPerUnit?: number;
|
|
1033
1145
|
billingModel?: string;
|
|
1034
1146
|
billingCycle?: string;
|
|
1147
|
+
/** @description Per-currency price options for this plan */
|
|
1148
|
+
pricingOptions?: components["schemas"]["PlanPricingOptionDto"][];
|
|
1035
1149
|
};
|
|
1036
1150
|
LimitBalanceDto: {
|
|
1037
1151
|
/** @description Credit balance in mils */
|
|
@@ -1115,6 +1229,22 @@ interface components {
|
|
|
1115
1229
|
};
|
|
1116
1230
|
externalRef?: string;
|
|
1117
1231
|
};
|
|
1232
|
+
GrantCustomerCreditsRequest: {
|
|
1233
|
+
credits: number;
|
|
1234
|
+
reason?: string;
|
|
1235
|
+
};
|
|
1236
|
+
GrantCustomerCreditsResponse: {
|
|
1237
|
+
/** @description Whether the grant was recorded */
|
|
1238
|
+
success: boolean;
|
|
1239
|
+
/** @description Customer reference identifier */
|
|
1240
|
+
customerRef: string;
|
|
1241
|
+
/** @description Granted credit amount */
|
|
1242
|
+
credits: number;
|
|
1243
|
+
/** @description Customer credit balance after the grant */
|
|
1244
|
+
balance: number;
|
|
1245
|
+
/** @description Machine-readable grant reason */
|
|
1246
|
+
reason?: string;
|
|
1247
|
+
};
|
|
1118
1248
|
CreateCustomerSessionRequest: {
|
|
1119
1249
|
customerRef: string;
|
|
1120
1250
|
productRef?: string;
|
|
@@ -2018,12 +2148,7 @@ interface operations {
|
|
|
2018
2148
|
[name: string]: unknown;
|
|
2019
2149
|
};
|
|
2020
2150
|
content: {
|
|
2021
|
-
"application/json":
|
|
2022
|
-
/** @example true */
|
|
2023
|
-
success?: boolean;
|
|
2024
|
-
/** @example usage_A1B2C3D4 */
|
|
2025
|
-
reference?: string;
|
|
2026
|
-
};
|
|
2151
|
+
"application/json": components["schemas"]["UsageRecordResponse"];
|
|
2027
2152
|
};
|
|
2028
2153
|
};
|
|
2029
2154
|
/** @description Validation failed */
|
|
@@ -2053,7 +2178,9 @@ interface operations {
|
|
|
2053
2178
|
headers: {
|
|
2054
2179
|
[name: string]: unknown;
|
|
2055
2180
|
};
|
|
2056
|
-
content
|
|
2181
|
+
content: {
|
|
2182
|
+
"application/json": components["schemas"]["BulkUsageResponse"];
|
|
2183
|
+
};
|
|
2057
2184
|
};
|
|
2058
2185
|
/** @description Validation failed */
|
|
2059
2186
|
400: {
|
|
@@ -2585,6 +2712,43 @@ interface operations {
|
|
|
2585
2712
|
};
|
|
2586
2713
|
};
|
|
2587
2714
|
};
|
|
2715
|
+
CustomerSdkController_grantCredits: {
|
|
2716
|
+
parameters: {
|
|
2717
|
+
query?: never;
|
|
2718
|
+
header?: {
|
|
2719
|
+
/** @description Provider-scoped idempotency key for safe grant retries */
|
|
2720
|
+
"Idempotency-Key"?: string;
|
|
2721
|
+
};
|
|
2722
|
+
path: {
|
|
2723
|
+
/** @description Customer reference identifier */
|
|
2724
|
+
reference: string;
|
|
2725
|
+
};
|
|
2726
|
+
cookie?: never;
|
|
2727
|
+
};
|
|
2728
|
+
requestBody: {
|
|
2729
|
+
content: {
|
|
2730
|
+
"application/json": components["schemas"]["GrantCustomerCreditsRequest"];
|
|
2731
|
+
};
|
|
2732
|
+
};
|
|
2733
|
+
responses: {
|
|
2734
|
+
/** @description Credits granted successfully */
|
|
2735
|
+
200: {
|
|
2736
|
+
headers: {
|
|
2737
|
+
[name: string]: unknown;
|
|
2738
|
+
};
|
|
2739
|
+
content: {
|
|
2740
|
+
"application/json": components["schemas"]["GrantCustomerCreditsResponse"];
|
|
2741
|
+
};
|
|
2742
|
+
};
|
|
2743
|
+
/** @description Customer not found */
|
|
2744
|
+
404: {
|
|
2745
|
+
headers: {
|
|
2746
|
+
[name: string]: unknown;
|
|
2747
|
+
};
|
|
2748
|
+
content?: never;
|
|
2749
|
+
};
|
|
2750
|
+
};
|
|
2751
|
+
};
|
|
2588
2752
|
CustomerSdkController_createCustomerSession: {
|
|
2589
2753
|
parameters: {
|
|
2590
2754
|
query?: never;
|
|
@@ -3022,6 +3186,7 @@ interface SolvaPayCopy {
|
|
|
3022
3186
|
currentBadge: string;
|
|
3023
3187
|
popularBadge: string;
|
|
3024
3188
|
freeBadge: string;
|
|
3189
|
+
usageRateLabel: string;
|
|
3025
3190
|
perIntervalShort: string;
|
|
3026
3191
|
continueButton: string;
|
|
3027
3192
|
backButton: string;
|
|
@@ -3363,6 +3528,7 @@ interface SolvaPayTransport {
|
|
|
3363
3528
|
createPayment: (params: {
|
|
3364
3529
|
planRef?: string;
|
|
3365
3530
|
productRef?: string;
|
|
3531
|
+
currency?: string;
|
|
3366
3532
|
customer?: PrefillCustomer;
|
|
3367
3533
|
}) => Promise<PaymentIntentResult>;
|
|
3368
3534
|
processPayment: (params: {
|
|
@@ -3486,6 +3652,13 @@ interface Merchant {
|
|
|
3486
3652
|
privacyUrl?: string;
|
|
3487
3653
|
country?: string;
|
|
3488
3654
|
defaultCurrency?: string;
|
|
3655
|
+
/**
|
|
3656
|
+
* Full set of currencies (including `defaultCurrency`) the customer may
|
|
3657
|
+
* pay credit topups in. Surfaced only when the merchant enabled more than
|
|
3658
|
+
* one — single-currency merchants leave this undefined and keep today's
|
|
3659
|
+
* behavior. Drives the topup currency switcher in the PAYG amount step.
|
|
3660
|
+
*/
|
|
3661
|
+
supportedTopupCurrencies?: string[];
|
|
3489
3662
|
statementDescriptor?: string;
|
|
3490
3663
|
logoUrl?: string;
|
|
3491
3664
|
/**
|
|
@@ -3794,6 +3967,7 @@ interface SolvaPayContextValue {
|
|
|
3794
3967
|
createPayment: (params: {
|
|
3795
3968
|
planRef?: string;
|
|
3796
3969
|
productRef?: string;
|
|
3970
|
+
currency?: string;
|
|
3797
3971
|
customer?: PrefillCustomer;
|
|
3798
3972
|
}) => Promise<PaymentIntentResult>;
|
|
3799
3973
|
processPayment?: (params: {
|
|
@@ -3872,6 +4046,13 @@ interface PaymentError extends Error {
|
|
|
3872
4046
|
* All fields are optional except `reference` so the type stays compatible
|
|
3873
4047
|
* with partial JSON responses from custom fetcher functions.
|
|
3874
4048
|
*/
|
|
4049
|
+
interface PlanPricingOption {
|
|
4050
|
+
currency: string;
|
|
4051
|
+
price: number;
|
|
4052
|
+
basePrice?: number;
|
|
4053
|
+
setupFee?: number;
|
|
4054
|
+
default?: boolean;
|
|
4055
|
+
}
|
|
3875
4056
|
interface Plan {
|
|
3876
4057
|
type?: 'recurring' | 'one-time' | 'usage-based';
|
|
3877
4058
|
reference: string;
|
|
@@ -3879,6 +4060,7 @@ interface Plan {
|
|
|
3879
4060
|
description?: string;
|
|
3880
4061
|
price?: number;
|
|
3881
4062
|
currency?: string;
|
|
4063
|
+
pricingOptions?: PlanPricingOption[];
|
|
3882
4064
|
currencySymbol?: string;
|
|
3883
4065
|
freeUnits?: number;
|
|
3884
4066
|
setupFee?: number;
|
|
@@ -4117,6 +4299,13 @@ interface BootstrapPlanLike {
|
|
|
4117
4299
|
meterRef?: string | null;
|
|
4118
4300
|
creditsPerUnit?: number | null;
|
|
4119
4301
|
requiresPayment?: boolean;
|
|
4302
|
+
pricingOptions?: Array<{
|
|
4303
|
+
currency: string;
|
|
4304
|
+
price: number;
|
|
4305
|
+
basePrice?: number;
|
|
4306
|
+
setupFee?: number;
|
|
4307
|
+
default?: boolean;
|
|
4308
|
+
}>;
|
|
4120
4309
|
}
|
|
4121
4310
|
type SuccessMeta = {
|
|
4122
4311
|
branch: 'payg';
|