@superlogic/spree-pay 0.5.2 → 0.5.4
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/build/{CryptoComTab-EKWP4XOV.js → CryptoComTab-WXKBRJF3.js} +5 -5
- package/build/{CryptoTab-XJZHGZ5E.js → CryptoTab-G55XLBX2.js} +8 -11
- package/build/{chunk-VBGTP4XP.js → chunk-H7S3CTS3.js} +1 -1
- package/build/{chunk-ABVIUWRK.js → chunk-QJCZPYQC.js} +5 -4
- package/build/{chunk-ECIGRDXS.js → chunk-RZ43EXC2.js} +451 -13
- package/build/index.cjs +666 -224
- package/build/index.css +9 -0
- package/build/index.js +14 -17
- package/package.json +5 -3
package/build/index.css
CHANGED
|
@@ -936,6 +936,15 @@
|
|
|
936
936
|
var(--tw-ring-shadow),
|
|
937
937
|
var(--tw-shadow);
|
|
938
938
|
}
|
|
939
|
+
.sl-spreepay .shadow {
|
|
940
|
+
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
941
|
+
box-shadow:
|
|
942
|
+
var(--tw-inset-shadow),
|
|
943
|
+
var(--tw-inset-ring-shadow),
|
|
944
|
+
var(--tw-ring-offset-shadow),
|
|
945
|
+
var(--tw-ring-shadow),
|
|
946
|
+
var(--tw-shadow);
|
|
947
|
+
}
|
|
939
948
|
.sl-spreepay .shadow-\[0_6\.25px_25px_0_rgba\(0\,0\,0\,0\.05\)\] {
|
|
940
949
|
--tw-shadow: 0 6.25px 25px 0 var(--tw-shadow-color, rgba(0,0,0,0.05));
|
|
941
950
|
box-shadow:
|
package/build/index.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
getSplitAmount,
|
|
9
9
|
getTransactionFee,
|
|
10
10
|
useSlapiBalance
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-H7S3CTS3.js";
|
|
12
12
|
import {
|
|
13
13
|
Iframe3ds
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QJCZPYQC.js";
|
|
15
15
|
import {
|
|
16
16
|
InfoBanner,
|
|
17
17
|
LogLevel,
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
StaticConfigProvider,
|
|
28
28
|
cn,
|
|
29
29
|
configureLogger,
|
|
30
|
+
esm_default,
|
|
30
31
|
isDeclineStatus,
|
|
31
32
|
isNewCard,
|
|
32
33
|
isPaymentError,
|
|
@@ -42,11 +43,10 @@ import {
|
|
|
42
43
|
useSpreePayRegister,
|
|
43
44
|
useSpreePaymentMethod,
|
|
44
45
|
useStaticConfig
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RZ43EXC2.js";
|
|
46
47
|
|
|
47
48
|
// src/SpreePay.tsx
|
|
48
49
|
import { useCallback as useCallback8, useEffect as useEffect8, useMemo as useMemo9, useState as useState12 } from "react";
|
|
49
|
-
import NiceModal4 from "@ebay/nice-modal-react";
|
|
50
50
|
import { SWRConfig } from "swr";
|
|
51
51
|
|
|
52
52
|
// src/SpreePayContent.tsx
|
|
@@ -56,7 +56,6 @@ import { Suspense, lazy, useEffect as useEffect6 } from "react";
|
|
|
56
56
|
import { useCallback as useCallback6, useEffect as useEffect5, useState as useState10 } from "react";
|
|
57
57
|
|
|
58
58
|
// src/hooks/payments/useCardPayment.ts
|
|
59
|
-
import NiceModal from "@ebay/nice-modal-react";
|
|
60
59
|
var cardPaymentLogger = logger.child("card-payment");
|
|
61
60
|
var useCardPayment = () => {
|
|
62
61
|
const { selectedPaymentMethod } = useSpreePaymentMethod();
|
|
@@ -120,7 +119,7 @@ var useCardPayment = () => {
|
|
|
120
119
|
cardPaymentLogger.debug("Starting 3DS flow", {
|
|
121
120
|
paymentId: paymentResData.id
|
|
122
121
|
});
|
|
123
|
-
const paymentIntent = await
|
|
122
|
+
const paymentIntent = await esm_default.show(Iframe3ds, { url: paymentResData.redirectUrl });
|
|
124
123
|
if (paymentIntent) {
|
|
125
124
|
cardPaymentLogger.debug("3DS completed, validating", {
|
|
126
125
|
paymentId: paymentResData.id,
|
|
@@ -258,7 +257,6 @@ async function handleSendErc20(params) {
|
|
|
258
257
|
}
|
|
259
258
|
|
|
260
259
|
// src/hooks/payments/utils.ts
|
|
261
|
-
import NiceModal2 from "@ebay/nice-modal-react";
|
|
262
260
|
var REFRESH_INTERVAL = 3 * 1e3;
|
|
263
261
|
var MAX_RETRIES = 10;
|
|
264
262
|
async function longPollPoints(paymentId) {
|
|
@@ -303,7 +301,7 @@ async function longPollCardStatus(paymentId) {
|
|
|
303
301
|
return detail.status;
|
|
304
302
|
}
|
|
305
303
|
if (!shown3ds && detail.card?.redirectUrl) {
|
|
306
|
-
const paymentIntent = await
|
|
304
|
+
const paymentIntent = await esm_default.show(Iframe3ds, { url: detail.card?.redirectUrl });
|
|
307
305
|
shown3ds = true;
|
|
308
306
|
if (paymentIntent) {
|
|
309
307
|
await SlapiPaymentService.validate3DS({ paymentId });
|
|
@@ -424,7 +422,6 @@ var usePointsPayment = (mode = "web2") => {
|
|
|
424
422
|
};
|
|
425
423
|
|
|
426
424
|
// src/hooks/payments/useSplitCardPayments.ts
|
|
427
|
-
import NiceModal3 from "@ebay/nice-modal-react";
|
|
428
425
|
var splitPaymentLogger = logger.child("split-card-payment");
|
|
429
426
|
var useSplitCardPayments = (mode = "web2") => {
|
|
430
427
|
const { selectedPaymentMethod } = useSpreePaymentMethod();
|
|
@@ -480,7 +477,7 @@ var useSplitCardPayments = (mode = "web2") => {
|
|
|
480
477
|
});
|
|
481
478
|
if (paymentResData.redirectUrl) {
|
|
482
479
|
splitPaymentLogger.debug("Starting 3DS flow for card portion", { paymentId: paymentResData.id });
|
|
483
|
-
const paymentIntent = await
|
|
480
|
+
const paymentIntent = await esm_default.show(Iframe3ds, { url: paymentResData.redirectUrl });
|
|
484
481
|
if (paymentIntent) {
|
|
485
482
|
splitPaymentLogger.debug("3DS completed, validating", { paymentId: paymentResData.id });
|
|
486
483
|
await SlapiPaymentService.validate3DS({ paymentId: paymentResData.id });
|
|
@@ -2171,12 +2168,12 @@ var CreditCardTab = () => {
|
|
|
2171
2168
|
}
|
|
2172
2169
|
return settlePaymentResult(res, failureMessage, failureCode);
|
|
2173
2170
|
} catch (e) {
|
|
2174
|
-
|
|
2171
|
+
throw toPaymentError(e, failureMessage, failureCode);
|
|
2175
2172
|
} finally {
|
|
2176
|
-
mutateBalance();
|
|
2173
|
+
mutateBalance().catch(() => void 0);
|
|
2177
2174
|
if (selectedPaymentMethod.type === "CREDIT_CARD" /* CREDIT_CARD */ && selectedPaymentMethod.method && isNewCard(selectedPaymentMethod.method)) {
|
|
2178
2175
|
const knownIds = new Set(cards.map((c) => c.id));
|
|
2179
|
-
const updated = await mutateCards();
|
|
2176
|
+
const updated = await mutateCards().catch(() => void 0);
|
|
2180
2177
|
const newSavedCard = (updated?.data ?? []).find((c) => c.active && !knownIds.has(c.id));
|
|
2181
2178
|
setSelectedPaymentMethod({
|
|
2182
2179
|
...selectedPaymentMethod,
|
|
@@ -2185,7 +2182,7 @@ var CreditCardTab = () => {
|
|
|
2185
2182
|
});
|
|
2186
2183
|
setNewCards([]);
|
|
2187
2184
|
} else {
|
|
2188
|
-
mutateCards();
|
|
2185
|
+
mutateCards().catch(() => void 0);
|
|
2189
2186
|
}
|
|
2190
2187
|
}
|
|
2191
2188
|
},
|
|
@@ -2284,9 +2281,9 @@ var TabButtons = (props) => {
|
|
|
2284
2281
|
|
|
2285
2282
|
// src/SpreePayContent.tsx
|
|
2286
2283
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2287
|
-
var CryptoTab = lazy(() => import("./CryptoTab-
|
|
2284
|
+
var CryptoTab = lazy(() => import("./CryptoTab-G55XLBX2.js").then((module) => ({ default: module.CryptoTab })));
|
|
2288
2285
|
var CryptoComTab = lazy(
|
|
2289
|
-
() => import("./CryptoComTab-
|
|
2286
|
+
() => import("./CryptoComTab-WXKBRJF3.js").then((module) => ({ default: module.CryptoComTab }))
|
|
2290
2287
|
);
|
|
2291
2288
|
var TabLoadingFallback = () => /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-center px-5 py-8 md:px-7", children: /* @__PURE__ */ jsxs11("div", { className: "flex flex-col items-center gap-3", children: [
|
|
2292
2289
|
/* @__PURE__ */ jsx18("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-(--border-component-specific-card) border-t-(--brand-primary)" }),
|
|
@@ -2498,7 +2495,7 @@ var SpreePayInner = () => {
|
|
|
2498
2495
|
revalidateOnFocus: false,
|
|
2499
2496
|
revalidateIfStale: false
|
|
2500
2497
|
},
|
|
2501
|
-
children: /* @__PURE__ */ jsx20(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx20(
|
|
2498
|
+
children: /* @__PURE__ */ jsx20(PortalContainerProvider, { container: portalEl, children: /* @__PURE__ */ jsx20(esm_default.Provider, { children: /* @__PURE__ */ jsx20(LoginStatusProvider, { isLoggedIn: Boolean(_accessToken), children: /* @__PURE__ */ jsx20(SpreePayContent, {}) }) }) })
|
|
2502
2499
|
}
|
|
2503
2500
|
);
|
|
2504
2501
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superlogic/spree-pay",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Spree-pay React component and utilities",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"react-dom": "^18 || ^19"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ebay/nice-modal-react": "^1.2.13",
|
|
46
45
|
"@mocanetwork/airkit": "1.7.0",
|
|
47
46
|
"@radix-ui/react-checkbox": "^1.1.3",
|
|
48
47
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
@@ -65,6 +64,7 @@
|
|
|
65
64
|
"xss": "^1.0.15"
|
|
66
65
|
},
|
|
67
66
|
"devDependencies": {
|
|
67
|
+
"@ebay/nice-modal-react": "^1.2.13",
|
|
68
68
|
"@repo/eslint-config": "^1.0.0",
|
|
69
69
|
"@tailwindcss/postcss": "^4.3.0",
|
|
70
70
|
"@types/react": "^19",
|
|
@@ -96,6 +96,8 @@
|
|
|
96
96
|
"react-dom",
|
|
97
97
|
"swr"
|
|
98
98
|
],
|
|
99
|
-
"noExternal": [
|
|
99
|
+
"noExternal": [
|
|
100
|
+
"@ebay/nice-modal-react"
|
|
101
|
+
]
|
|
100
102
|
}
|
|
101
103
|
}
|