@blocklet/payment-react 1.25.10 → 1.26.1
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/es/checkout-v2/checkout-v2.d.ts +2 -0
- package/es/checkout-v2/checkout-v2.js +121 -0
- package/es/checkout-v2/components/dialogs/checkout-dialogs.d.ts +1 -0
- package/es/checkout-v2/components/dialogs/checkout-dialogs.js +106 -0
- package/es/checkout-v2/components/left/billing-toggle.d.ts +6 -0
- package/es/checkout-v2/components/left/billing-toggle.js +118 -0
- package/es/checkout-v2/components/left/cross-sell-card.d.ts +10 -0
- package/es/checkout-v2/components/left/cross-sell-card.js +167 -0
- package/es/checkout-v2/components/left/product-item-card.d.ts +26 -0
- package/es/checkout-v2/components/left/product-item-card.js +571 -0
- package/es/checkout-v2/components/left/promotion-input.d.ts +19 -0
- package/es/checkout-v2/components/left/promotion-input.js +178 -0
- package/es/checkout-v2/components/left/staking-breakdown.d.ts +9 -0
- package/es/checkout-v2/components/left/staking-breakdown.js +48 -0
- package/es/checkout-v2/components/left/trial-info.d.ts +13 -0
- package/es/checkout-v2/components/left/trial-info.js +48 -0
- package/es/checkout-v2/components/right/currency-grid.d.ts +8 -0
- package/es/checkout-v2/components/right/currency-grid.js +48 -0
- package/es/checkout-v2/components/right/customer-info-card.d.ts +17 -0
- package/es/checkout-v2/components/right/customer-info-card.js +156 -0
- package/es/checkout-v2/components/right/status-feedback.d.ts +7 -0
- package/es/checkout-v2/components/right/status-feedback.js +17 -0
- package/es/checkout-v2/components/right/submit-button.d.ts +10 -0
- package/es/checkout-v2/components/right/submit-button.js +29 -0
- package/es/checkout-v2/components/right/subscription-disclaimer.d.ts +11 -0
- package/es/checkout-v2/components/right/subscription-disclaimer.js +8 -0
- package/es/checkout-v2/components/shared/exchange-rate-footer.d.ts +23 -0
- package/es/checkout-v2/components/shared/exchange-rate-footer.js +182 -0
- package/es/checkout-v2/components/shared/scenario-badge.d.ts +6 -0
- package/es/checkout-v2/components/shared/scenario-badge.js +47 -0
- package/es/checkout-v2/components/shared/total-display.d.ts +7 -0
- package/es/checkout-v2/components/shared/total-display.js +84 -0
- package/es/checkout-v2/index.d.ts +2 -0
- package/es/checkout-v2/index.js +1 -0
- package/es/checkout-v2/layouts/checkout-layout.d.ts +7 -0
- package/es/checkout-v2/layouts/checkout-layout.js +226 -0
- package/es/checkout-v2/panels/left/composite-panel.d.ts +1 -0
- package/es/checkout-v2/panels/left/composite-panel.js +423 -0
- package/es/checkout-v2/panels/left/credit-topup-panel.d.ts +1 -0
- package/es/checkout-v2/panels/left/credit-topup-panel.js +611 -0
- package/es/checkout-v2/panels/left/scenario-router.d.ts +1 -0
- package/es/checkout-v2/panels/left/scenario-router.js +19 -0
- package/es/checkout-v2/panels/right/payment-panel.d.ts +1 -0
- package/es/checkout-v2/panels/right/payment-panel.js +644 -0
- package/es/checkout-v2/types.d.ts +15 -0
- package/es/checkout-v2/types.js +0 -0
- package/es/checkout-v2/utils/format.d.ts +59 -0
- package/es/checkout-v2/utils/format.js +125 -0
- package/es/checkout-v2/utils/scenario-detector.d.ts +3 -0
- package/es/checkout-v2/utils/scenario-detector.js +17 -0
- package/es/checkout-v2/views/error-view.d.ts +7 -0
- package/es/checkout-v2/views/error-view.js +269 -0
- package/es/checkout-v2/views/loading-view.d.ts +5 -0
- package/es/checkout-v2/views/loading-view.js +158 -0
- package/es/checkout-v2/views/success-view.d.ts +29 -0
- package/es/checkout-v2/views/success-view.js +614 -0
- package/es/components/phone-field.d.ts +14 -0
- package/es/components/phone-field.js +96 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/locales/en.js +45 -6
- package/es/locales/zh.js +45 -6
- package/es/payment/form/index.js +10 -1
- package/lib/checkout-v2/checkout-v2.d.ts +2 -0
- package/lib/checkout-v2/checkout-v2.js +151 -0
- package/lib/checkout-v2/components/dialogs/checkout-dialogs.d.ts +1 -0
- package/lib/checkout-v2/components/dialogs/checkout-dialogs.js +131 -0
- package/lib/checkout-v2/components/left/billing-toggle.d.ts +6 -0
- package/lib/checkout-v2/components/left/billing-toggle.js +126 -0
- package/lib/checkout-v2/components/left/cross-sell-card.d.ts +10 -0
- package/lib/checkout-v2/components/left/cross-sell-card.js +257 -0
- package/lib/checkout-v2/components/left/product-item-card.d.ts +26 -0
- package/lib/checkout-v2/components/left/product-item-card.js +738 -0
- package/lib/checkout-v2/components/left/promotion-input.d.ts +19 -0
- package/lib/checkout-v2/components/left/promotion-input.js +220 -0
- package/lib/checkout-v2/components/left/staking-breakdown.d.ts +9 -0
- package/lib/checkout-v2/components/left/staking-breakdown.js +96 -0
- package/lib/checkout-v2/components/left/trial-info.d.ts +13 -0
- package/lib/checkout-v2/components/left/trial-info.js +82 -0
- package/lib/checkout-v2/components/right/currency-grid.d.ts +8 -0
- package/lib/checkout-v2/components/right/currency-grid.js +96 -0
- package/lib/checkout-v2/components/right/customer-info-card.d.ts +17 -0
- package/lib/checkout-v2/components/right/customer-info-card.js +246 -0
- package/lib/checkout-v2/components/right/status-feedback.d.ts +7 -0
- package/lib/checkout-v2/components/right/status-feedback.js +30 -0
- package/lib/checkout-v2/components/right/submit-button.d.ts +10 -0
- package/lib/checkout-v2/components/right/submit-button.js +35 -0
- package/lib/checkout-v2/components/right/subscription-disclaimer.d.ts +11 -0
- package/lib/checkout-v2/components/right/subscription-disclaimer.js +33 -0
- package/lib/checkout-v2/components/shared/exchange-rate-footer.d.ts +23 -0
- package/lib/checkout-v2/components/shared/exchange-rate-footer.js +282 -0
- package/lib/checkout-v2/components/shared/scenario-badge.d.ts +6 -0
- package/lib/checkout-v2/components/shared/scenario-badge.js +57 -0
- package/lib/checkout-v2/components/shared/total-display.d.ts +7 -0
- package/lib/checkout-v2/components/shared/total-display.js +154 -0
- package/lib/checkout-v2/index.d.ts +2 -0
- package/lib/checkout-v2/index.js +13 -0
- package/lib/checkout-v2/layouts/checkout-layout.d.ts +7 -0
- package/lib/checkout-v2/layouts/checkout-layout.js +308 -0
- package/lib/checkout-v2/panels/left/composite-panel.d.ts +1 -0
- package/lib/checkout-v2/panels/left/composite-panel.js +515 -0
- package/lib/checkout-v2/panels/left/credit-topup-panel.d.ts +1 -0
- package/lib/checkout-v2/panels/left/credit-topup-panel.js +795 -0
- package/lib/checkout-v2/panels/left/scenario-router.d.ts +1 -0
- package/lib/checkout-v2/panels/left/scenario-router.js +29 -0
- package/lib/checkout-v2/panels/right/payment-panel.d.ts +1 -0
- package/lib/checkout-v2/panels/right/payment-panel.js +906 -0
- package/lib/checkout-v2/types.d.ts +15 -0
- package/lib/checkout-v2/types.js +1 -0
- package/lib/checkout-v2/utils/format.d.ts +59 -0
- package/lib/checkout-v2/utils/format.js +158 -0
- package/lib/checkout-v2/utils/scenario-detector.d.ts +3 -0
- package/lib/checkout-v2/utils/scenario-detector.js +23 -0
- package/lib/checkout-v2/views/error-view.d.ts +7 -0
- package/lib/checkout-v2/views/error-view.js +321 -0
- package/lib/checkout-v2/views/loading-view.d.ts +5 -0
- package/lib/checkout-v2/views/loading-view.js +168 -0
- package/lib/checkout-v2/views/success-view.d.ts +29 -0
- package/lib/checkout-v2/views/success-view.js +735 -0
- package/lib/components/phone-field.d.ts +14 -0
- package/lib/components/phone-field.js +130 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +8 -0
- package/lib/locales/en.js +45 -6
- package/lib/locales/zh.js +45 -6
- package/lib/payment/form/index.js +10 -1
- package/package.json +4 -3
- package/src/checkout-v2/checkout-v2.tsx +155 -0
- package/src/checkout-v2/components/dialogs/checkout-dialogs.tsx +134 -0
- package/src/checkout-v2/components/left/billing-toggle.tsx +122 -0
- package/src/checkout-v2/components/left/cross-sell-card.tsx +170 -0
- package/src/checkout-v2/components/left/product-item-card.tsx +642 -0
- package/src/checkout-v2/components/left/promotion-input.tsx +207 -0
- package/src/checkout-v2/components/left/staking-breakdown.tsx +57 -0
- package/src/checkout-v2/components/left/trial-info.tsx +63 -0
- package/src/checkout-v2/components/right/currency-grid.tsx +59 -0
- package/src/checkout-v2/components/right/customer-info-card.tsx +214 -0
- package/src/checkout-v2/components/right/status-feedback.tsx +35 -0
- package/src/checkout-v2/components/right/submit-button.tsx +37 -0
- package/src/checkout-v2/components/right/subscription-disclaimer.tsx +27 -0
- package/src/checkout-v2/components/shared/exchange-rate-footer.tsx +221 -0
- package/src/checkout-v2/components/shared/scenario-badge.tsx +51 -0
- package/src/checkout-v2/components/shared/total-display.tsx +112 -0
- package/src/checkout-v2/index.ts +2 -0
- package/src/checkout-v2/layouts/checkout-layout.tsx +232 -0
- package/src/checkout-v2/panels/left/composite-panel.tsx +465 -0
- package/src/checkout-v2/panels/left/credit-topup-panel.tsx +677 -0
- package/src/checkout-v2/panels/left/scenario-router.tsx +22 -0
- package/src/checkout-v2/panels/right/payment-panel.tsx +703 -0
- package/src/checkout-v2/types.ts +18 -0
- package/src/checkout-v2/utils/format.ts +205 -0
- package/src/checkout-v2/utils/scenario-detector.ts +30 -0
- package/src/checkout-v2/views/error-view.tsx +293 -0
- package/src/checkout-v2/views/loading-view.tsx +162 -0
- package/src/checkout-v2/views/success-view.tsx +770 -0
- package/src/components/phone-field.tsx +119 -0
- package/src/index.ts +3 -0
- package/src/locales/en.tsx +45 -4
- package/src/locales/zh.tsx +43 -4
- package/src/payment/form/index.tsx +16 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
module.exports = LoadingView;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _material = require("@mui/material");
|
|
9
|
+
var _styles = require("@mui/material/styles");
|
|
10
|
+
var _Header = _interopRequireDefault(require("@blocklet/ui-react/lib/Header"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function PulsingDots() {
|
|
13
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
14
|
+
sx: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
gap: 2,
|
|
17
|
+
mt: 4
|
|
18
|
+
},
|
|
19
|
+
children: [0, 1, 2].map(i => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
20
|
+
sx: {
|
|
21
|
+
width: 12,
|
|
22
|
+
height: 12,
|
|
23
|
+
borderRadius: "50%",
|
|
24
|
+
bgcolor: "primary.main",
|
|
25
|
+
opacity: 0.4,
|
|
26
|
+
animation: `pulse 1.4s ease-in-out ${i * 0.2}s infinite`,
|
|
27
|
+
"@keyframes pulse": {
|
|
28
|
+
"0%, 80%, 100%": {
|
|
29
|
+
transform: "scale(0.6)",
|
|
30
|
+
opacity: 0.3
|
|
31
|
+
},
|
|
32
|
+
"40%": {
|
|
33
|
+
transform: "scale(1)",
|
|
34
|
+
opacity: 0.7
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, i))
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function LoadingDecoration() {
|
|
42
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
43
|
+
sx: {
|
|
44
|
+
position: "relative",
|
|
45
|
+
width: {
|
|
46
|
+
xs: 160,
|
|
47
|
+
md: 200
|
|
48
|
+
},
|
|
49
|
+
height: {
|
|
50
|
+
xs: 160,
|
|
51
|
+
md: 200
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
55
|
+
sx: {
|
|
56
|
+
position: "absolute",
|
|
57
|
+
inset: 0,
|
|
58
|
+
borderRadius: "38% 62% 63% 37% / 41% 44% 56% 59%",
|
|
59
|
+
background: t => `linear-gradient(45deg, ${(0, _styles.alpha)(t.palette.primary.main, 0.1)}, ${(0, _styles.alpha)(t.palette.primary.main, 0.03)})`,
|
|
60
|
+
filter: "blur(1px)",
|
|
61
|
+
animation: "spin 20s linear infinite",
|
|
62
|
+
"@keyframes spin": {
|
|
63
|
+
from: {
|
|
64
|
+
transform: "rotate(0deg)"
|
|
65
|
+
},
|
|
66
|
+
to: {
|
|
67
|
+
transform: "rotate(360deg)"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
72
|
+
sx: {
|
|
73
|
+
position: "absolute",
|
|
74
|
+
inset: 0,
|
|
75
|
+
borderRadius: "38% 62% 63% 37% / 41% 44% 56% 59%",
|
|
76
|
+
background: t => `linear-gradient(135deg, ${(0, _styles.alpha)(t.palette.primary.main, 0.07)}, ${(0, _styles.alpha)(t.palette.primary.main, 0.01)})`,
|
|
77
|
+
filter: "blur(1px)",
|
|
78
|
+
transform: "scale(0.88)",
|
|
79
|
+
opacity: 0.6,
|
|
80
|
+
animation: "spinReverse 15s linear infinite",
|
|
81
|
+
"@keyframes spinReverse": {
|
|
82
|
+
from: {
|
|
83
|
+
transform: "scale(0.88) rotate(0deg)"
|
|
84
|
+
},
|
|
85
|
+
to: {
|
|
86
|
+
transform: "scale(0.88) rotate(-360deg)"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function LoadingView({
|
|
94
|
+
mode = "inline"
|
|
95
|
+
}) {
|
|
96
|
+
const isFullScreen = mode === "standalone";
|
|
97
|
+
const theme = (0, _styles.useTheme)();
|
|
98
|
+
const primaryColor = theme.palette.primary.main;
|
|
99
|
+
const bgSx = {
|
|
100
|
+
background: {
|
|
101
|
+
xs: "none",
|
|
102
|
+
md: `linear-gradient(160deg, ${(0, _styles.alpha)(primaryColor, 0.03)} 0%, ${(0, _styles.alpha)(primaryColor, 0.07)} 50%, ${(0, _styles.alpha)(primaryColor, 0.04)} 100%)`
|
|
103
|
+
},
|
|
104
|
+
bgcolor: t => t.palette.mode === "dark" ? "background.default" : "#f8faff"
|
|
105
|
+
};
|
|
106
|
+
const centerContent = /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
107
|
+
sx: {
|
|
108
|
+
display: "flex",
|
|
109
|
+
flexDirection: "column",
|
|
110
|
+
alignItems: "center",
|
|
111
|
+
justifyContent: "center",
|
|
112
|
+
flex: 1
|
|
113
|
+
},
|
|
114
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(LoadingDecoration, {}), /* @__PURE__ */(0, _jsxRuntime.jsx)(PulsingDots, {})]
|
|
115
|
+
});
|
|
116
|
+
if (!isFullScreen) {
|
|
117
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
|
|
118
|
+
sx: {
|
|
119
|
+
display: "flex",
|
|
120
|
+
width: "100%",
|
|
121
|
+
minHeight: {
|
|
122
|
+
xs: 400,
|
|
123
|
+
md: 640
|
|
124
|
+
},
|
|
125
|
+
maxWidth: 1120,
|
|
126
|
+
mx: "auto",
|
|
127
|
+
borderRadius: "16px",
|
|
128
|
+
overflow: "hidden",
|
|
129
|
+
boxShadow: 1,
|
|
130
|
+
border: 1,
|
|
131
|
+
borderColor: "divider",
|
|
132
|
+
borderLeft: "4px solid",
|
|
133
|
+
borderLeftColor: "primary.main",
|
|
134
|
+
...bgSx
|
|
135
|
+
},
|
|
136
|
+
children: centerContent
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
140
|
+
sx: {
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: "100vh",
|
|
143
|
+
minHeight: "100vh",
|
|
144
|
+
display: "flex",
|
|
145
|
+
flexDirection: "column",
|
|
146
|
+
position: "relative",
|
|
147
|
+
overflow: "hidden",
|
|
148
|
+
...bgSx
|
|
149
|
+
},
|
|
150
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_Header.default, {
|
|
151
|
+
sx: {
|
|
152
|
+
position: "absolute",
|
|
153
|
+
top: 20,
|
|
154
|
+
left: 0,
|
|
155
|
+
right: 0,
|
|
156
|
+
zIndex: 10,
|
|
157
|
+
background: "transparent",
|
|
158
|
+
"& .header-container": {
|
|
159
|
+
height: "auto"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
hideNavMenu: true,
|
|
163
|
+
brand: null,
|
|
164
|
+
description: null,
|
|
165
|
+
addons: buildIns => buildIns.filter(addon => ["locale-selector", "theme-mode-toggle", "session-user"].includes(addon.key))
|
|
166
|
+
}), centerContent]
|
|
167
|
+
});
|
|
168
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TCheckoutSessionExpanded } from '@blocklet/payment-types';
|
|
2
|
+
interface VendorInfo {
|
|
3
|
+
success: boolean;
|
|
4
|
+
status: 'delivered' | 'pending' | 'failed';
|
|
5
|
+
progress: number;
|
|
6
|
+
message: string;
|
|
7
|
+
appUrl?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
vendorType: string;
|
|
11
|
+
}
|
|
12
|
+
interface SuccessViewProps {
|
|
13
|
+
submit: {
|
|
14
|
+
vendorStatus: {
|
|
15
|
+
payment_status: string;
|
|
16
|
+
session_status: string;
|
|
17
|
+
vendors: VendorInfo[];
|
|
18
|
+
error: string | null;
|
|
19
|
+
isAllCompleted: boolean;
|
|
20
|
+
hasFailed: boolean;
|
|
21
|
+
} | null;
|
|
22
|
+
result: {
|
|
23
|
+
checkoutSession: TCheckoutSessionExpanded;
|
|
24
|
+
} | null;
|
|
25
|
+
};
|
|
26
|
+
session: TCheckoutSessionExpanded | null | undefined;
|
|
27
|
+
}
|
|
28
|
+
export default function SuccessView({ submit, session }: SuccessViewProps): import("react").JSX.Element;
|
|
29
|
+
export {};
|