@solvapay/react 2.7.1 → 2.7.2-preview-075e9a831604cc453af9bf1433121c493747a4e2
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 +10 -0
- package/dist/{UsageMeter-DMXIqN6R.d.ts → UsageMeter-B8b2qP8z.d.ts} +2 -2
- package/dist/{UsageMeter-7TlUFO4f.d.cts → UsageMeter-BEOlIgFb.d.cts} +2 -2
- package/dist/{chunk-OSNWRO7K.js → chunk-2CO2RU4P.js} +1 -1
- package/dist/{chunk-A4RMDNX2.js → chunk-P4KEZ4D4.js} +1 -1
- package/dist/{chunk-NVIMOERI.js → chunk-WWYACUNM.js} +3 -4
- package/dist/{index-Cw6HeErQ.d.ts → index-CSuzdP_a.d.ts} +1 -1
- package/dist/{index-FASAoYDW.d.cts → index-Dz7xuqg5.d.cts} +1 -1
- package/dist/index.cjs +63 -64
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/mcp/index.cjs +84 -85
- package/dist/mcp/index.d.cts +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +2 -2
- package/dist/primitives/index.d.cts +5 -5
- package/dist/primitives/index.d.ts +5 -5
- package/dist/primitives/index.js +2 -2
- package/dist/{useUsage-C7I5dNGM.d.cts → useUsage-B6k6Yk5M.d.cts} +1590 -70
- package/dist/{useUsage-Chx6wiUC.d.ts → useUsage-CKkreEu4.d.ts} +1590 -70
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @solvapay/react changelog
|
|
2
2
|
|
|
3
|
+
## 2.7.2-preview-075e9a831604cc453af9bf1433121c493747a4e2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [80b8b65]
|
|
8
|
+
- Updated dependencies [5aa5637]
|
|
9
|
+
- Updated dependencies [3b7fecd]
|
|
10
|
+
- @solvapay/core@1.9.0-preview-075e9a831604cc453af9bf1433121c493747a4e2
|
|
11
|
+
- @solvapay/mcp-core@0.6.0-preview-075e9a831604cc453af9bf1433121c493747a4e2
|
|
12
|
+
|
|
3
13
|
## 2.7.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { _ as UsageSnapshot } from './useUsage-
|
|
2
|
+
import { _ as UsageSnapshot } from './useUsage-CKkreEu4.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `<UsageMeter>` compound primitive — renders the authenticated customer's
|
|
@@ -71,4 +71,4 @@ declare const UsageMeter: React.ForwardRefExoticComponent<UsageMeterRootProps &
|
|
|
71
71
|
|
|
72
72
|
declare function useUsageMeter(): UsageMeterContextValue;
|
|
73
73
|
|
|
74
|
-
export { Bar as B, Empty as E, Label as L, Percentage as P, ResetsIn as R,
|
|
74
|
+
export { Bar as B, Empty as E, Label as L, Percentage as P, ResetsIn as R, UsageMeter as U, type UsageMeterClassNames as a, Loading as b, Root as c, type UsageMeterRootProps as d, useUsageMeter as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { _ as UsageSnapshot } from './useUsage-
|
|
2
|
+
import { _ as UsageSnapshot } from './useUsage-B6k6Yk5M.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `<UsageMeter>` compound primitive — renders the authenticated customer's
|
|
@@ -71,4 +71,4 @@ declare const UsageMeter: React.ForwardRefExoticComponent<UsageMeterRootProps &
|
|
|
71
71
|
|
|
72
72
|
declare function useUsageMeter(): UsageMeterContextValue;
|
|
73
73
|
|
|
74
|
-
export { Bar as B, Empty as E, Label as L, Percentage as P, ResetsIn as R,
|
|
74
|
+
export { Bar as B, Empty as E, Label as L, Percentage as P, ResetsIn as R, UsageMeter as U, type UsageMeterClassNames as a, Loading as b, Root as c, type UsageMeterRootProps as d, useUsageMeter as u };
|
|
@@ -801,7 +801,6 @@ import { createContext as createContext2, useState, useEffect, useCallback, useM
|
|
|
801
801
|
|
|
802
802
|
// ../server/src/index.ts
|
|
803
803
|
import crypto from "crypto";
|
|
804
|
-
import { SolvaPayError } from "@solvapay/core";
|
|
805
804
|
|
|
806
805
|
// ../server/src/helpers/balance-poll.ts
|
|
807
806
|
var BALANCE_RECONCILE_DELAYS_MS = [500, 1e3, 2e3, 4e3, 8e3, 16e3];
|
|
@@ -2767,7 +2766,7 @@ function createTaxSummaryParts(useCtx, prefix) {
|
|
|
2767
2766
|
|
|
2768
2767
|
// src/utils/errors.ts
|
|
2769
2768
|
var DOCS_BASE_URL = "https://solvapay.com/docs";
|
|
2770
|
-
var
|
|
2769
|
+
var SolvaPayError = class extends Error {
|
|
2771
2770
|
code;
|
|
2772
2771
|
docsUrl;
|
|
2773
2772
|
constructor(code, message, docsUrl) {
|
|
@@ -2777,7 +2776,7 @@ var SolvaPayError2 = class extends Error {
|
|
|
2777
2776
|
this.docsUrl = docsUrl;
|
|
2778
2777
|
}
|
|
2779
2778
|
};
|
|
2780
|
-
var MissingProviderError = class extends
|
|
2779
|
+
var MissingProviderError = class extends SolvaPayError {
|
|
2781
2780
|
constructor(primitiveName) {
|
|
2782
2781
|
const docsUrl = `${DOCS_BASE_URL}/troubleshooting/missing-provider`;
|
|
2783
2782
|
super(
|
|
@@ -2788,7 +2787,7 @@ var MissingProviderError = class extends SolvaPayError2 {
|
|
|
2788
2787
|
this.name = "MissingProviderError";
|
|
2789
2788
|
}
|
|
2790
2789
|
};
|
|
2791
|
-
var MissingProductRefError = class extends
|
|
2790
|
+
var MissingProductRefError = class extends SolvaPayError {
|
|
2792
2791
|
constructor(primitiveName) {
|
|
2793
2792
|
const docsUrl = `${DOCS_BASE_URL}/primitives/product-ref`;
|
|
2794
2793
|
super(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a1 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a2 as AutoRechargeInput, u as AutoRechargeConfig, a3 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-CKkreEu4.js';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
|
|
4
4
|
import { TaxBreakdown } from '@solvapay/core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a1 as components, b as Plan, P as PaymentFormProps, a as PrefillCustomer, A as ActivationResult, s as UseTopupAmountSelectorReturn, a2 as AutoRechargeInput, u as AutoRechargeConfig, a3 as AutoRechargeDisplayBlock, E as CheckoutStep, O as SuccessMeta } from './useUsage-B6k6Yk5M.cjs';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PaymentElement, CardElement } from '@stripe/react-stripe-js';
|
|
4
4
|
import { TaxBreakdown } from '@solvapay/core';
|
package/dist/index.cjs
CHANGED
|
@@ -123,7 +123,6 @@ var import_react2 = require("react");
|
|
|
123
123
|
|
|
124
124
|
// ../server/src/index.ts
|
|
125
125
|
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
126
|
-
var import_core = require("@solvapay/core");
|
|
127
126
|
|
|
128
127
|
// ../server/src/helpers/balance-poll.ts
|
|
129
128
|
var BALANCE_RECONCILE_DELAYS_MS = [500, 1e3, 2e3, 4e3, 8e3, 16e3];
|
|
@@ -2104,7 +2103,7 @@ function useStripeAppearance(root, appearance) {
|
|
|
2104
2103
|
|
|
2105
2104
|
// src/utils/errors.ts
|
|
2106
2105
|
var DOCS_BASE_URL = "https://solvapay.com/docs";
|
|
2107
|
-
var
|
|
2106
|
+
var SolvaPayError = class extends Error {
|
|
2108
2107
|
code;
|
|
2109
2108
|
docsUrl;
|
|
2110
2109
|
constructor(code, message, docsUrl) {
|
|
@@ -2114,7 +2113,7 @@ var SolvaPayError2 = class extends Error {
|
|
|
2114
2113
|
this.docsUrl = docsUrl;
|
|
2115
2114
|
}
|
|
2116
2115
|
};
|
|
2117
|
-
var MissingProviderError = class extends
|
|
2116
|
+
var MissingProviderError = class extends SolvaPayError {
|
|
2118
2117
|
constructor(primitiveName) {
|
|
2119
2118
|
const docsUrl = `${DOCS_BASE_URL}/troubleshooting/missing-provider`;
|
|
2120
2119
|
super(
|
|
@@ -2125,7 +2124,7 @@ var MissingProviderError = class extends SolvaPayError2 {
|
|
|
2125
2124
|
this.name = "MissingProviderError";
|
|
2126
2125
|
}
|
|
2127
2126
|
};
|
|
2128
|
-
var MissingProductRefError = class extends
|
|
2127
|
+
var MissingProductRefError = class extends SolvaPayError {
|
|
2129
2128
|
constructor(primitiveName) {
|
|
2130
2129
|
const docsUrl = `${DOCS_BASE_URL}/primitives/product-ref`;
|
|
2131
2130
|
super(
|
|
@@ -2872,10 +2871,10 @@ function interpolate(template, vars) {
|
|
|
2872
2871
|
|
|
2873
2872
|
// src/components/businessCheckoutParts.tsx
|
|
2874
2873
|
var import_react15 = require("react");
|
|
2875
|
-
var
|
|
2874
|
+
var import_core = require("@solvapay/core");
|
|
2876
2875
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2877
2876
|
function mapBusinessFieldErrors(input) {
|
|
2878
|
-
const result = (0,
|
|
2877
|
+
const result = (0, import_core.validateBusinessDetails)(input);
|
|
2879
2878
|
if (result.success) return {};
|
|
2880
2879
|
const errors = {};
|
|
2881
2880
|
for (const issue of result.error.issues) {
|
|
@@ -2892,25 +2891,25 @@ function isBusinessDetailsKey(key) {
|
|
|
2892
2891
|
function attr(prefix, suffix) {
|
|
2893
2892
|
return `data-solvapay-${prefix}-${suffix}`;
|
|
2894
2893
|
}
|
|
2895
|
-
var SUPPORTED_BUSINESS_COUNTRIES_SET = new Set(
|
|
2894
|
+
var SUPPORTED_BUSINESS_COUNTRIES_SET = new Set(import_core.SUPPORTED_BUSINESS_COUNTRIES);
|
|
2896
2895
|
function isSupportedBusinessCountry(value) {
|
|
2897
2896
|
return SUPPORTED_BUSINESS_COUNTRIES_SET.has(value);
|
|
2898
2897
|
}
|
|
2899
2898
|
function resolveTaxIdLabel(country) {
|
|
2900
2899
|
if (country && isSupportedBusinessCountry(country)) {
|
|
2901
|
-
return (0,
|
|
2900
|
+
return (0, import_core.getTaxIdFieldLabel)(country);
|
|
2902
2901
|
}
|
|
2903
2902
|
return "Tax ID";
|
|
2904
2903
|
}
|
|
2905
2904
|
function resolveTaxIdPlaceholder(country) {
|
|
2906
2905
|
if (country && isSupportedBusinessCountry(country)) {
|
|
2907
|
-
return (0,
|
|
2906
|
+
return (0, import_core.getTaxIdExample)(country);
|
|
2908
2907
|
}
|
|
2909
2908
|
return "Enter tax ID";
|
|
2910
2909
|
}
|
|
2911
2910
|
function resolveTaxIdHelperText(country) {
|
|
2912
2911
|
if (country && isSupportedBusinessCountry(country)) {
|
|
2913
|
-
return (0,
|
|
2912
|
+
return (0, import_core.getTaxIdHelperText)(country);
|
|
2914
2913
|
}
|
|
2915
2914
|
return "";
|
|
2916
2915
|
}
|
|
@@ -2989,14 +2988,14 @@ function createBusinessDetailsParts(useCtx, prefix) {
|
|
|
2989
2988
|
ctx.setBusinessDetails({
|
|
2990
2989
|
customerCountry: nextCountry || void 0,
|
|
2991
2990
|
...ctx.businessDetails.isBusiness ? { country: nextCountry || void 0 } : {},
|
|
2992
|
-
...!(0,
|
|
2993
|
-
...!(0,
|
|
2991
|
+
...!(0, import_core.isStateRequired)(nextCountry) ? { customerState: void 0 } : {},
|
|
2992
|
+
...!(0, import_core.isPostalCodeRequired)(nextCountry) ? { customerPostalCode: void 0 } : {}
|
|
2994
2993
|
});
|
|
2995
2994
|
})
|
|
2996
2995
|
};
|
|
2997
2996
|
const defaultOptions = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2998
2997
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "", children: "Select country" }),
|
|
2999
|
-
|
|
2998
|
+
import_core.BUSINESS_COUNTRY_OPTIONS.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value, children: label }, value))
|
|
3000
2999
|
] });
|
|
3001
3000
|
if (asChild) {
|
|
3002
3001
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Slot, { ref: forwardedRef, ...commonProps, children: children ?? defaultOptions });
|
|
@@ -3005,15 +3004,15 @@ function createBusinessDetailsParts(useCtx, prefix) {
|
|
|
3005
3004
|
});
|
|
3006
3005
|
const State = (0, import_react15.forwardRef)(function BusinessDetailsState({ asChild, onChange, ...rest }, forwardedRef) {
|
|
3007
3006
|
const ctx = useCtx("BusinessDetails.State");
|
|
3008
|
-
const country = (0,
|
|
3009
|
-
if (!country || !(0,
|
|
3007
|
+
const country = (0, import_core.resolveBuyerCountry)(ctx.businessDetails);
|
|
3008
|
+
if (!country || !(0, import_core.isStateRequired)(country)) return null;
|
|
3010
3009
|
const commonProps = {
|
|
3011
3010
|
...rest,
|
|
3012
3011
|
[attr(prefix, "business-details-state")]: "",
|
|
3013
3012
|
type: "text",
|
|
3014
3013
|
value: ctx.businessDetails.customerState ?? "",
|
|
3015
3014
|
"aria-invalid": ctx.fieldErrors.customerState ? true : void 0,
|
|
3016
|
-
"aria-label": rest["aria-label"] ?? (0,
|
|
3015
|
+
"aria-label": rest["aria-label"] ?? (0, import_core.getStateFieldLabel)(country),
|
|
3017
3016
|
onChange: composeEventHandlers(onChange, (e) => {
|
|
3018
3017
|
ctx.setBusinessDetails({ customerState: e.target.value || void 0 });
|
|
3019
3018
|
})
|
|
@@ -3025,16 +3024,16 @@ function createBusinessDetailsParts(useCtx, prefix) {
|
|
|
3025
3024
|
});
|
|
3026
3025
|
const PostalCode = (0, import_react15.forwardRef)(function BusinessDetailsPostalCode({ asChild, onChange, ...rest }, forwardedRef) {
|
|
3027
3026
|
const ctx = useCtx("BusinessDetails.PostalCode");
|
|
3028
|
-
const country = (0,
|
|
3029
|
-
if (!country || !(0,
|
|
3027
|
+
const country = (0, import_core.resolveBuyerCountry)(ctx.businessDetails);
|
|
3028
|
+
if (!country || !(0, import_core.isPostalCodeRequired)(country)) return null;
|
|
3030
3029
|
const commonProps = {
|
|
3031
3030
|
...rest,
|
|
3032
3031
|
[attr(prefix, "business-details-postal")]: "",
|
|
3033
3032
|
type: "text",
|
|
3034
3033
|
value: ctx.businessDetails.customerPostalCode ?? "",
|
|
3035
|
-
placeholder: rest.placeholder ?? (0,
|
|
3034
|
+
placeholder: rest.placeholder ?? (0, import_core.getPostalCodePlaceholder)(country),
|
|
3036
3035
|
"aria-invalid": ctx.fieldErrors.customerPostalCode ? true : void 0,
|
|
3037
|
-
"aria-label": rest["aria-label"] ?? (0,
|
|
3036
|
+
"aria-label": rest["aria-label"] ?? (0, import_core.getPostalCodeFieldLabel)(country),
|
|
3038
3037
|
onChange: composeEventHandlers(onChange, (e) => {
|
|
3039
3038
|
ctx.setBusinessDetails({ customerPostalCode: e.target.value || void 0 });
|
|
3040
3039
|
})
|
|
@@ -3064,23 +3063,23 @@ function createBusinessDetailsParts(useCtx, prefix) {
|
|
|
3064
3063
|
});
|
|
3065
3064
|
const Fields2 = (0, import_react15.forwardRef)(function BusinessDetailsFields({ asChild, children, ...rest }, forwardedRef) {
|
|
3066
3065
|
const ctx = useCtx("BusinessDetails.Fields");
|
|
3067
|
-
const country = (0,
|
|
3066
|
+
const country = (0, import_core.resolveBuyerCountry)(ctx.businessDetails) ?? "";
|
|
3068
3067
|
const taxIdLabel = resolveTaxIdLabel(country);
|
|
3069
3068
|
const taxIdPlaceholder = resolveTaxIdPlaceholder(country);
|
|
3070
3069
|
const taxIdHelperText = resolveTaxIdHelperText(country);
|
|
3071
|
-
const showState = !!country && (0,
|
|
3072
|
-
const showPostal = !!country && (0,
|
|
3070
|
+
const showState = !!country && (0, import_core.isStateRequired)(country);
|
|
3071
|
+
const showPostal = !!country && (0, import_core.isPostalCodeRequired)(country);
|
|
3073
3072
|
const content = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
3074
3073
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "solvapay-business-field", children: [
|
|
3075
3074
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "solvapay-business-field-label", children: "Country" }),
|
|
3076
3075
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Country, {})
|
|
3077
3076
|
] }),
|
|
3078
3077
|
showState ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "solvapay-business-field", children: [
|
|
3079
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "solvapay-business-field-label", children: (0,
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "solvapay-business-field-label", children: (0, import_core.getStateFieldLabel)(country) }),
|
|
3080
3079
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(State, {})
|
|
3081
3080
|
] }) : null,
|
|
3082
3081
|
showPostal ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "solvapay-business-field", children: [
|
|
3083
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "solvapay-business-field-label", children: (0,
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "solvapay-business-field-label", children: (0, import_core.getPostalCodeFieldLabel)(country) }),
|
|
3084
3083
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PostalCode, {})
|
|
3085
3084
|
] }) : null,
|
|
3086
3085
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "solvapay-checkout-business-toggle", children: [
|
|
@@ -3913,7 +3912,7 @@ function resolveCta(input) {
|
|
|
3913
3912
|
|
|
3914
3913
|
// src/hooks/useBusinessDetailsAttach.ts
|
|
3915
3914
|
var import_react19 = require("react");
|
|
3916
|
-
var
|
|
3915
|
+
var import_core2 = require("@solvapay/core");
|
|
3917
3916
|
var defaultBusinessDetails = { isBusiness: false };
|
|
3918
3917
|
function useBusinessDetailsAttach(options) {
|
|
3919
3918
|
const {
|
|
@@ -3955,9 +3954,9 @@ function useBusinessDetailsAttach(options) {
|
|
|
3955
3954
|
if (!processorPaymentId || !attachBusinessDetails) {
|
|
3956
3955
|
return !attachBusinessDetails;
|
|
3957
3956
|
}
|
|
3958
|
-
const addressErrors = (0,
|
|
3959
|
-
const validation = (0,
|
|
3960
|
-
if (!validation.success || !(0,
|
|
3957
|
+
const addressErrors = (0, import_core2.getCustomerAddressFieldErrors)(input);
|
|
3958
|
+
const validation = (0, import_core2.validateBusinessDetails)(input);
|
|
3959
|
+
if (!validation.success || !(0, import_core2.isCustomerAddressComplete)(input)) {
|
|
3961
3960
|
setFieldErrors({
|
|
3962
3961
|
...mapBusinessFieldErrors(input),
|
|
3963
3962
|
...addressErrors
|
|
@@ -3998,12 +3997,12 @@ function useBusinessDetailsAttach(options) {
|
|
|
3998
3997
|
);
|
|
3999
3998
|
(0, import_react19.useEffect)(() => {
|
|
4000
3999
|
if (!processorPaymentId || !attachBusinessDetails) return;
|
|
4001
|
-
const validation = (0,
|
|
4002
|
-
if (!validation.success || !(0,
|
|
4000
|
+
const validation = (0, import_core2.validateBusinessDetails)(businessDetails);
|
|
4001
|
+
if (!validation.success || !(0, import_core2.isCustomerAddressComplete)(businessDetails)) {
|
|
4003
4002
|
const countrySelected = !!(businessDetails.customerCountry?.trim() || businessDetails.isBusiness && businessDetails.country?.trim());
|
|
4004
4003
|
setFieldErrors({
|
|
4005
4004
|
...mapBusinessFieldErrors(businessDetails),
|
|
4006
|
-
...countrySelected ? (0,
|
|
4005
|
+
...countrySelected ? (0, import_core2.getCustomerAddressFieldErrors)(businessDetails) : {}
|
|
4007
4006
|
});
|
|
4008
4007
|
setBusinessDetailsAttached(false);
|
|
4009
4008
|
return;
|
|
@@ -4029,7 +4028,7 @@ function useBusinessDetailsAttach(options) {
|
|
|
4029
4028
|
}
|
|
4030
4029
|
|
|
4031
4030
|
// src/primitives/PaymentForm.tsx
|
|
4032
|
-
var
|
|
4031
|
+
var import_core3 = require("@solvapay/core");
|
|
4033
4032
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4034
4033
|
function toSubmitVariant(variant) {
|
|
4035
4034
|
switch (variant) {
|
|
@@ -4338,7 +4337,7 @@ var PaidInner = ({
|
|
|
4338
4337
|
onError
|
|
4339
4338
|
]);
|
|
4340
4339
|
const isReady = !!(stripe && elements);
|
|
4341
|
-
const canSubmit = isReady && !!clientSecret && !!elementKind && paymentInputComplete && (!requireTermsAcceptance || termsAccepted) && (!requiresBusinessAttach || businessDetailsAttached) && (0,
|
|
4340
|
+
const canSubmit = isReady && !!clientSecret && !!elementKind && paymentInputComplete && (!requireTermsAcceptance || termsAccepted) && (!requiresBusinessAttach || businessDetailsAttached) && (0, import_core3.isCustomerAddressComplete)(businessDetails) && !businessDetailsAttaching && !isProcessing;
|
|
4342
4341
|
const submit = (0, import_react20.useCallback)(async () => {
|
|
4343
4342
|
if (!stripe || !elements || !clientSecret || !elementKind) {
|
|
4344
4343
|
const msg = !stripe || !elements ? copy.errors.stripeUnavailable : copy.errors.paymentIntentUnavailable;
|
|
@@ -4369,7 +4368,7 @@ var PaidInner = ({
|
|
|
4369
4368
|
billingDetails: buildConfirmBillingDetails({
|
|
4370
4369
|
name: customerName.trim() || customer.name,
|
|
4371
4370
|
email: customer.email ?? prefillCustomer?.email,
|
|
4372
|
-
country: (0,
|
|
4371
|
+
country: (0, import_core3.resolveBuyerCountry)(businessDetails),
|
|
4373
4372
|
state: businessDetails.customerState,
|
|
4374
4373
|
postalCode: businessDetails.customerPostalCode
|
|
4375
4374
|
}),
|
|
@@ -5375,7 +5374,7 @@ function useTopup(options) {
|
|
|
5375
5374
|
}
|
|
5376
5375
|
|
|
5377
5376
|
// src/primitives/TopupForm.tsx
|
|
5378
|
-
var
|
|
5377
|
+
var import_core4 = require("@solvapay/core");
|
|
5379
5378
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5380
5379
|
var TopupFormContext = (0, import_react25.createContext)(null);
|
|
5381
5380
|
function useTopupCtx(part) {
|
|
@@ -5613,7 +5612,7 @@ var Inner = ({
|
|
|
5613
5612
|
runAttach
|
|
5614
5613
|
} = businessAttach;
|
|
5615
5614
|
const isReady = !!(stripe && elements);
|
|
5616
|
-
const canSubmit = isReady && paymentInputComplete && !isProcessing && !!clientSecret && (!requiresBusinessAttach || businessDetailsAttached) && (0,
|
|
5615
|
+
const canSubmit = isReady && paymentInputComplete && !isProcessing && !!clientSecret && (!requiresBusinessAttach || businessDetailsAttached) && (0, import_core4.isCustomerAddressComplete)(businessDetails) && !businessDetailsAttaching;
|
|
5617
5616
|
const submit = (0, import_react25.useCallback)(async () => {
|
|
5618
5617
|
if (!stripe || !elements || !clientSecret) {
|
|
5619
5618
|
const msg = copy.errors.stripeUnavailable;
|
|
@@ -5640,7 +5639,7 @@ var Inner = ({
|
|
|
5640
5639
|
billingDetails: buildConfirmBillingDetails({
|
|
5641
5640
|
name: customer.name,
|
|
5642
5641
|
email: customer.email,
|
|
5643
|
-
country: (0,
|
|
5642
|
+
country: (0, import_core4.resolveBuyerCountry)(businessDetails),
|
|
5644
5643
|
state: businessDetails.customerState,
|
|
5645
5644
|
postalCode: businessDetails.customerPostalCode
|
|
5646
5645
|
}),
|
|
@@ -6227,7 +6226,7 @@ var StripePaymentFormWrapper = ({
|
|
|
6227
6226
|
|
|
6228
6227
|
// src/primitives/BalanceBadge.tsx
|
|
6229
6228
|
var import_react29 = require("react");
|
|
6230
|
-
var
|
|
6229
|
+
var import_core5 = require("@solvapay/core");
|
|
6231
6230
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6232
6231
|
var BalanceBadge = (0, import_react29.forwardRef)(function BalanceBadge2({ asChild, numberOnly, lowThreshold = 10, children, ...rest }, forwardedRef) {
|
|
6233
6232
|
const solva = (0, import_react29.useContext)(SolvaPayContext);
|
|
@@ -6256,14 +6255,14 @@ var BalanceBadge = (0, import_react29.forwardRef)(function BalanceBadge2({ asChi
|
|
|
6256
6255
|
const formattedCredits = new Intl.NumberFormat(locale).format(credits);
|
|
6257
6256
|
let currencyEquivalent = "";
|
|
6258
6257
|
if (!numberOnly && displayCurrency && creditsPerMinorUnit) {
|
|
6259
|
-
const displayMinor = (0,
|
|
6258
|
+
const displayMinor = (0, import_core5.creditsToDisplayMinorUnits)({
|
|
6260
6259
|
credits,
|
|
6261
6260
|
creditsPerMinorUnit,
|
|
6262
6261
|
displayExchangeRate: displayExchangeRate ?? 1,
|
|
6263
6262
|
displayCurrency
|
|
6264
6263
|
});
|
|
6265
6264
|
if (displayMinor !== null) {
|
|
6266
|
-
const minorPerMajor = (0,
|
|
6265
|
+
const minorPerMajor = (0, import_core5.minorUnitsPerMajor)(displayCurrency);
|
|
6267
6266
|
const formatted = new Intl.NumberFormat(locale, {
|
|
6268
6267
|
style: "currency",
|
|
6269
6268
|
currency: displayCurrency,
|
|
@@ -6293,13 +6292,13 @@ var import_react32 = require("react");
|
|
|
6293
6292
|
var import_react30 = require("react");
|
|
6294
6293
|
|
|
6295
6294
|
// src/utils/planPricing.ts
|
|
6296
|
-
var
|
|
6295
|
+
var import_core6 = require("@solvapay/core");
|
|
6297
6296
|
function getPlanPricingOptions(plan) {
|
|
6298
6297
|
if (plan.pricingOptions && plan.pricingOptions.length > 0) {
|
|
6299
6298
|
return plan.pricingOptions;
|
|
6300
6299
|
}
|
|
6301
6300
|
const defaultCurrency = (plan.currency ?? "USD").toUpperCase();
|
|
6302
|
-
const charges = (0,
|
|
6301
|
+
const charges = (0, import_core6.headlineCharges)(plan);
|
|
6303
6302
|
if (charges.length > 0) {
|
|
6304
6303
|
return charges.map((charge) => ({
|
|
6305
6304
|
currency: charge.currency,
|
|
@@ -7368,7 +7367,7 @@ var DefaultTree3 = ({ showCreditEstimate }) => {
|
|
|
7368
7367
|
};
|
|
7369
7368
|
|
|
7370
7369
|
// src/primitives/CancelPlanButton.tsx
|
|
7371
|
-
var
|
|
7370
|
+
var import_core7 = require("@solvapay/core");
|
|
7372
7371
|
var import_react34 = require("react");
|
|
7373
7372
|
|
|
7374
7373
|
// src/hooks/usePurchaseActions.ts
|
|
@@ -7426,7 +7425,7 @@ var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
|
7426
7425
|
function resolveConfirmText(confirm, purchase, defaults) {
|
|
7427
7426
|
if (confirm === false) return null;
|
|
7428
7427
|
if (typeof confirm === "string") return confirm;
|
|
7429
|
-
const isUsageBased = ((0,
|
|
7428
|
+
const isUsageBased = ((0, import_core7.countsUsage)(purchase?.planSnapshot) || purchase?.planSnapshot?.isMetered === true) && purchase?.isRecurring !== true;
|
|
7430
7429
|
if (isUsageBased) return defaults.usageBased;
|
|
7431
7430
|
return defaults.recurring;
|
|
7432
7431
|
}
|
|
@@ -7881,7 +7880,7 @@ var CreditGate2 = ({
|
|
|
7881
7880
|
};
|
|
7882
7881
|
|
|
7883
7882
|
// src/components/CurrentPlanCard.tsx
|
|
7884
|
-
var
|
|
7883
|
+
var import_core10 = require("@solvapay/core");
|
|
7885
7884
|
|
|
7886
7885
|
// src/hooks/usePaymentMethod.ts
|
|
7887
7886
|
var import_react38 = require("react");
|
|
@@ -8217,7 +8216,7 @@ var UpdatePaymentMethodButton = (0, import_react42.forwardRef)(function UpdatePa
|
|
|
8217
8216
|
var import_react45 = require("react");
|
|
8218
8217
|
|
|
8219
8218
|
// src/hooks/useUsage.ts
|
|
8220
|
-
var
|
|
8219
|
+
var import_core8 = require("@solvapay/core");
|
|
8221
8220
|
var import_react44 = require("react");
|
|
8222
8221
|
|
|
8223
8222
|
// src/hooks/useLimits.ts
|
|
@@ -8398,7 +8397,7 @@ var usageSeedGeneration = 0;
|
|
|
8398
8397
|
function deriveUsage(purchase, limits) {
|
|
8399
8398
|
if (!purchase) return null;
|
|
8400
8399
|
const usage = purchase.usage;
|
|
8401
|
-
if (!(0,
|
|
8400
|
+
if (!(0, import_core8.countsUsage)(purchase.planSnapshot) && purchase.planSnapshot?.isMetered !== true && !usage) {
|
|
8402
8401
|
return null;
|
|
8403
8402
|
}
|
|
8404
8403
|
const hasFiniteCap = limits.unlimited === false && limits.remaining !== null;
|
|
@@ -8428,7 +8427,7 @@ function useUsage() {
|
|
|
8428
8427
|
setSeedGeneration(usageSeedGeneration);
|
|
8429
8428
|
setOverride(seededUsage);
|
|
8430
8429
|
}
|
|
8431
|
-
const usageCounted = (0,
|
|
8430
|
+
const usageCounted = (0, import_core8.countsUsage)(activePurchase?.planSnapshot) || activePurchase?.planSnapshot?.isMetered === true;
|
|
8432
8431
|
const {
|
|
8433
8432
|
remaining: limitRemaining,
|
|
8434
8433
|
unlimited,
|
|
@@ -8697,7 +8696,7 @@ var UsageMeter = Object.assign(Root10, {
|
|
|
8697
8696
|
});
|
|
8698
8697
|
|
|
8699
8698
|
// src/primitives/checkout/shared.ts
|
|
8700
|
-
var
|
|
8699
|
+
var import_core9 = require("@solvapay/core");
|
|
8701
8700
|
|
|
8702
8701
|
// src/utils/isPayg.ts
|
|
8703
8702
|
function isPaygPlan(plan) {
|
|
@@ -8738,10 +8737,10 @@ function formatContinueLabel(plan, locale, pricingOption) {
|
|
|
8738
8737
|
return `Continue with ${plan.name ?? "Plan"} \u2014 ${priceLabel}`;
|
|
8739
8738
|
}
|
|
8740
8739
|
function planBillingCycle(plan) {
|
|
8741
|
-
return (0,
|
|
8740
|
+
return (0, import_core9.billingCycle)(plan);
|
|
8742
8741
|
}
|
|
8743
8742
|
function planBillingInterval(plan) {
|
|
8744
|
-
return (0,
|
|
8743
|
+
return (0, import_core9.billingCycle)(plan)?.interval ?? null;
|
|
8745
8744
|
}
|
|
8746
8745
|
function formatCycleSuffix(cycle) {
|
|
8747
8746
|
if (!cycle) return "";
|
|
@@ -8750,7 +8749,7 @@ function formatCycleSuffix(cycle) {
|
|
|
8750
8749
|
return `/${short}`;
|
|
8751
8750
|
}
|
|
8752
8751
|
function formatPlanPriceLabel(plan, locale, pricingOption) {
|
|
8753
|
-
const shape = (0,
|
|
8752
|
+
const shape = (0, import_core9.planPricingShape)(plan);
|
|
8754
8753
|
switch (shape.shape) {
|
|
8755
8754
|
case "free":
|
|
8756
8755
|
return "Free";
|
|
@@ -8779,27 +8778,27 @@ function singularMeterNoun(unit) {
|
|
|
8779
8778
|
return unit;
|
|
8780
8779
|
}
|
|
8781
8780
|
function formatPaygRate(plan, locale, balance) {
|
|
8782
|
-
const rate = (0,
|
|
8781
|
+
const rate = (0, import_core9.usageRate)(plan);
|
|
8783
8782
|
if (!rate || !(rate.amountMinor > 0)) return null;
|
|
8784
8783
|
const prefix = rate.tiered ? "from " : "";
|
|
8785
|
-
const credits = (0,
|
|
8786
|
-
const unit = singularMeterNoun(rate.meter ?? (0,
|
|
8784
|
+
const credits = (0, import_core9.creditsPerUnitFromBalance)(plan, balance);
|
|
8785
|
+
const unit = singularMeterNoun(rate.meter ?? (0, import_core9.meterName)(plan) ?? "unit");
|
|
8787
8786
|
if (credits != null) {
|
|
8788
8787
|
return `${prefix}${credits.toLocaleString(locale)} ${credits === 1 ? "credit" : "credits"} / ${unit}`;
|
|
8789
8788
|
}
|
|
8790
8789
|
return `${prefix}${formatPrice(rate.amountMinor, rate.currency.toUpperCase(), { locale })} / ${unit}`;
|
|
8791
8790
|
}
|
|
8792
8791
|
function inferIncludedUnits(plan) {
|
|
8793
|
-
const cap = (0,
|
|
8792
|
+
const cap = (0, import_core9.includedUnits)(plan);
|
|
8794
8793
|
return cap != null && cap > 0 ? cap : null;
|
|
8795
8794
|
}
|
|
8796
8795
|
function planMeterName(plan) {
|
|
8797
|
-
return (0,
|
|
8796
|
+
return (0, import_core9.meterName)(plan);
|
|
8798
8797
|
}
|
|
8799
8798
|
function recurringCreditNote(plan) {
|
|
8800
|
-
const [meter] = (0,
|
|
8799
|
+
const [meter] = (0, import_core9.creditDrawnMeters)(plan);
|
|
8801
8800
|
if (!meter) return null;
|
|
8802
|
-
const cap = (0,
|
|
8801
|
+
const cap = (0, import_core9.includedUnits)(plan, meter);
|
|
8803
8802
|
if (cap != null && cap > 0) {
|
|
8804
8803
|
return `Usage past your ${cap.toLocaleString()} included ${meter} is paid from credits. Your balance is 0.`;
|
|
8805
8804
|
}
|
|
@@ -8824,7 +8823,7 @@ function PlanTypeLine({
|
|
|
8824
8823
|
className
|
|
8825
8824
|
}) {
|
|
8826
8825
|
const copy = useCopy();
|
|
8827
|
-
const isMetered = (0,
|
|
8826
|
+
const isMetered = (0, import_core10.countsUsage)(purchase.planSnapshot) || purchase.planSnapshot?.isMetered === true;
|
|
8828
8827
|
if (purchase.isRecurring) {
|
|
8829
8828
|
const date2 = formatDate(purchase.nextBillingDate);
|
|
8830
8829
|
if (!date2) return null;
|
|
@@ -8941,7 +8940,7 @@ var CurrentPlanCard = ({
|
|
|
8941
8940
|
const catalogPlan = plans?.find(
|
|
8942
8941
|
(p) => p.reference === (snapshot?.reference ?? activePurchase.planRef)
|
|
8943
8942
|
);
|
|
8944
|
-
const isUsageBased = (0,
|
|
8943
|
+
const isUsageBased = (0, import_core10.countsUsage)(snapshot) || snapshot?.isMetered === true || (0, import_core10.countsUsage)(catalogPlan);
|
|
8945
8944
|
const planType = activePurchase.isRecurring ? "recurring" : isUsageBased ? "usage-based" : "one-time";
|
|
8946
8945
|
const amount = activePurchase.originalAmount ?? activePurchase.amount ?? 0;
|
|
8947
8946
|
const currency = activePurchase.currency ?? "usd";
|
|
@@ -9318,7 +9317,7 @@ function stripSetupIntentParams() {
|
|
|
9318
9317
|
}
|
|
9319
9318
|
|
|
9320
9319
|
// src/utils/credit-estimation.ts
|
|
9321
|
-
var
|
|
9320
|
+
var import_core11 = require("@solvapay/core");
|
|
9322
9321
|
function estimateCredits(resolvedAmountMajor, currency, creditsPerMinorUnit, displayExchangeRate) {
|
|
9323
9322
|
if (resolvedAmountMajor == null || resolvedAmountMajor <= 0) return null;
|
|
9324
9323
|
if (creditsPerMinorUnit == null || creditsPerMinorUnit <= 0) return null;
|
|
@@ -9330,7 +9329,7 @@ function estimateCurrencyMajorFromCredits(credits, currency, creditsPerMinorUnit
|
|
|
9330
9329
|
if (credits == null || credits <= 0) return null;
|
|
9331
9330
|
if (creditsPerMinorUnit == null || creditsPerMinorUnit <= 0) return null;
|
|
9332
9331
|
const rate = displayExchangeRate ?? 1;
|
|
9333
|
-
const displayMinor = (0,
|
|
9332
|
+
const displayMinor = (0, import_core11.creditsToDisplayMinorUnits)({
|
|
9334
9333
|
credits,
|
|
9335
9334
|
creditsPerMinorUnit,
|
|
9336
9335
|
displayExchangeRate: rate,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-
|
|
3
|
-
export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-
|
|
4
|
-
import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-
|
|
5
|
-
export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-
|
|
2
|
+
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-B6k6Yk5M.cjs';
|
|
3
|
+
export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-B6k6Yk5M.cjs';
|
|
4
|
+
import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-Dz7xuqg5.cjs';
|
|
5
|
+
export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-Dz7xuqg5.cjs';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-
|
|
3
|
-
export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-
|
|
4
|
-
import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-
|
|
5
|
-
export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-
|
|
2
|
+
import { S as SolvaPayProviderProps, P as PaymentFormProps, a as PrefillCustomer, T as TopupFormProps, C as CheckoutResult, b as Plan, A as ActivationResult, B as BootstrapPlanLike, c as SaveAutoRechargeResponse, d as PurchaseStatus, e as SolvaPayContextValue, U as UsePlansOptions, f as UsePlansReturn, g as UsePlanOptions, h as UsePlanReturn, i as UseProductReturn, j as UseMerchantReturn, k as SolvaPayCopy, l as PurchaseStatusReturn, m as CancelResult, R as ReactivateResult, n as ActivatePlanResult, o as UseTopupOptions, p as UseTopupReturn, q as BalanceStatus, r as UseTopupAmountSelectorOptions, s as UseTopupAmountSelectorReturn, t as UsePaymentMethodReturn, u as AutoRechargeConfig, v as SaveAutoRechargeInput, w as SolvaPayTransport, x as PartialSolvaPayCopy, y as PurchaseInfo, z as Product, D as SolvaPayConfig } from './useUsage-CKkreEu4.js';
|
|
3
|
+
export { E as CheckoutStep, F as CustomerPurchaseData, M as MandateContext, G as MandateTemplate, H as Merchant, I as PaymentError, J as PaymentIntentResult, K as PaymentMethodInfo, L as PaymentResult, N as PurchaseStatusValue, O as SuccessMeta, Q as TopupPaymentResult, V as TransportBalanceResult, W as TransportCheckoutSessionResult, X as TransportCustomerSessionResult, Y as TransportLimitsResult, Z as UnsupportedTransportMethodError, _ as UsageSnapshot, $ as UseUsageReturn, a0 as useUsage } from './useUsage-CKkreEu4.js';
|
|
4
|
+
import { P as PaymentFormSummary, a as PaymentFormCustomerFields, b as PaymentFormPaymentElement, c as PaymentFormCardElement, d as PaymentFormMandateText, e as PaymentFormTermsCheckbox, f as PaymentFormSubmitButton, g as PaymentFormLoading, h as PaymentFormError, i as PaymentFormLegalFooter, j as PaymentFormBusinessDetails, k as PaymentFormTaxSummary, A as AutoRechargeInputPayload, l as PaywallStructuredContent, C as CheckoutVariant } from './index-CSuzdP_a.js';
|
|
5
|
+
export { m as ActivationFlowStep, B as BalanceBadge, n as CancelPlanButton, o as CheckoutErrorPhase, p as CheckoutStatus, q as CheckoutSteps, r as CheckoutSummary, s as CheckoutSummaryProps, M as MandateText, t as MandateTextProps, u as PlanBadge, v as ProductBadge, w as PurchaseGate, U as UseCheckoutFlowOptions, x as UseCheckoutFlowReturn, y as configToAutoRechargeInput, z as deriveVariant, D as useCheckoutFlow, E as useCheckoutStepsContext } from './index-CSuzdP_a.js';
|
|
6
6
|
import { PaymentIntent, Stripe, StripeElements } from '@stripe/stripe-js';
|
|
7
7
|
import { BusinessDetailsInput, TaxBreakdown } from '@solvapay/core';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSessionAuthAdapter
|
|
3
3
|
} from "./chunk-JTW665JR.js";
|
|
4
|
-
import {
|
|
5
|
-
LaunchCustomerPortalButton,
|
|
6
|
-
usePaymentMethod
|
|
7
|
-
} from "./chunk-A4RMDNX2.js";
|
|
8
4
|
import {
|
|
9
5
|
ActivationFlow,
|
|
10
6
|
AutoRecharge,
|
|
@@ -20,7 +16,11 @@ import {
|
|
|
20
16
|
useCheckoutSteps,
|
|
21
17
|
useCreditGate,
|
|
22
18
|
usePaywallResolver
|
|
23
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2CO2RU4P.js";
|
|
20
|
+
import {
|
|
21
|
+
LaunchCustomerPortalButton,
|
|
22
|
+
usePaymentMethod
|
|
23
|
+
} from "./chunk-P4KEZ4D4.js";
|
|
24
24
|
import {
|
|
25
25
|
AmountPicker,
|
|
26
26
|
BalanceBadge,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
useTopupAmountSelector,
|
|
101
101
|
useTransport,
|
|
102
102
|
useUsage
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-WWYACUNM.js";
|
|
104
104
|
import {
|
|
105
105
|
createAnonymousAuthAdapter,
|
|
106
106
|
defaultAuthAdapter,
|