@reevit/react 0.2.0 → 0.2.3
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/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +76 -15
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -41,6 +41,8 @@ interface ReevitCheckoutProps extends ReevitCheckoutConfig, ReevitCheckoutCallba
|
|
|
41
41
|
autoOpen?: boolean;
|
|
42
42
|
/** Custom theme */
|
|
43
43
|
theme?: ReevitTheme;
|
|
44
|
+
/** Custom API base URL (for testing or self-hosted deployments) */
|
|
45
|
+
apiBaseUrl?: string;
|
|
44
46
|
}
|
|
45
47
|
type CheckoutState = 'idle' | 'loading' | 'ready' | 'method_selected' | 'processing' | 'success' | 'failed' | 'closed';
|
|
46
48
|
interface PaymentResult {
|
|
@@ -130,7 +132,7 @@ interface ReevitContextValue {
|
|
|
130
132
|
currency: string;
|
|
131
133
|
}
|
|
132
134
|
declare function useReevitContext(): ReevitContextValue;
|
|
133
|
-
declare function ReevitCheckout({ publicKey, amount, currency, email, phone, reference, metadata, paymentMethods, onSuccess, onError, onClose, onStateChange, children, autoOpen, theme, }: ReevitCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
declare function ReevitCheckout({ publicKey, amount, currency, email, phone, reference, metadata, paymentMethods, onSuccess, onError, onClose, onStateChange, children, autoOpen, theme, apiBaseUrl, }: ReevitCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
134
136
|
|
|
135
137
|
interface PaymentMethodSelectorProps {
|
|
136
138
|
methods: PaymentMethod[];
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ interface ReevitCheckoutProps extends ReevitCheckoutConfig, ReevitCheckoutCallba
|
|
|
41
41
|
autoOpen?: boolean;
|
|
42
42
|
/** Custom theme */
|
|
43
43
|
theme?: ReevitTheme;
|
|
44
|
+
/** Custom API base URL (for testing or self-hosted deployments) */
|
|
45
|
+
apiBaseUrl?: string;
|
|
44
46
|
}
|
|
45
47
|
type CheckoutState = 'idle' | 'loading' | 'ready' | 'method_selected' | 'processing' | 'success' | 'failed' | 'closed';
|
|
46
48
|
interface PaymentResult {
|
|
@@ -130,7 +132,7 @@ interface ReevitContextValue {
|
|
|
130
132
|
currency: string;
|
|
131
133
|
}
|
|
132
134
|
declare function useReevitContext(): ReevitContextValue;
|
|
133
|
-
declare function ReevitCheckout({ publicKey, amount, currency, email, phone, reference, metadata, paymentMethods, onSuccess, onError, onClose, onStateChange, children, autoOpen, theme, }: ReevitCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
declare function ReevitCheckout({ publicKey, amount, currency, email, phone, reference, metadata, paymentMethods, onSuccess, onError, onClose, onStateChange, children, autoOpen, theme, apiBaseUrl, }: ReevitCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
134
136
|
|
|
135
137
|
interface PaymentMethodSelectorProps {
|
|
136
138
|
methods: PaymentMethod[];
|
package/dist/index.js
CHANGED
|
@@ -85,7 +85,7 @@ var API_BASE_URL_PRODUCTION = "https://api.reevit.io";
|
|
|
85
85
|
var API_BASE_URL_SANDBOX = "https://sandbox-api.reevit.io";
|
|
86
86
|
var DEFAULT_TIMEOUT = 3e4;
|
|
87
87
|
function isSandboxKey(publicKey) {
|
|
88
|
-
return publicKey.startsWith("pk_test_") || publicKey.startsWith("pk_sandbox_");
|
|
88
|
+
return publicKey.startsWith("pk_test_") || publicKey.startsWith("pk_sandbox_") || publicKey.startsWith("pfk_test_") || publicKey.startsWith("pfk_sandbox_");
|
|
89
89
|
}
|
|
90
90
|
function createPaymentError(response, errorData) {
|
|
91
91
|
return {
|
|
@@ -739,7 +739,8 @@ function ReevitCheckout({
|
|
|
739
739
|
// UI
|
|
740
740
|
children,
|
|
741
741
|
autoOpen = false,
|
|
742
|
-
theme
|
|
742
|
+
theme,
|
|
743
|
+
apiBaseUrl
|
|
743
744
|
}) {
|
|
744
745
|
const [isOpen, setIsOpen] = react.useState(autoOpen);
|
|
745
746
|
const [showPSPBridge, setShowPSPBridge] = react.useState(false);
|
|
@@ -759,6 +760,7 @@ function ReevitCheckout({
|
|
|
759
760
|
isComplete
|
|
760
761
|
} = useReevit({
|
|
761
762
|
config: { publicKey, amount, currency, email, phone, reference, metadata, paymentMethods },
|
|
763
|
+
apiBaseUrl,
|
|
762
764
|
onSuccess: (result2) => {
|
|
763
765
|
onSuccess?.(result2);
|
|
764
766
|
setTimeout(() => {
|
|
@@ -920,7 +922,14 @@ function ReevitCheckout({
|
|
|
920
922
|
"aria-modal": "true",
|
|
921
923
|
children: [
|
|
922
924
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "reevit-modal__header", children: [
|
|
923
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "reevit-modal__branding", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "reevit-modal__branding", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
926
|
+
"img",
|
|
927
|
+
{
|
|
928
|
+
src: "https://i.imgur.com/bzUR5Lm.png",
|
|
929
|
+
alt: "Reevit",
|
|
930
|
+
className: "reevit-modal__logo"
|
|
931
|
+
}
|
|
932
|
+
) }),
|
|
924
933
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
925
934
|
"button",
|
|
926
935
|
{
|