@blocklet/payment-react 1.13.123 → 1.13.125
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/api.js +0 -1
- package/es/components/confirm.d.ts +14 -0
- package/es/components/confirm.js +31 -0
- package/es/components/pricing-table.js +77 -67
- package/es/contexts/payment.d.ts +4 -2
- package/es/index.d.ts +4 -1
- package/es/index.js +7 -1
- package/es/locales/en.js +5 -1
- package/es/locales/zh.js +4 -0
- package/es/payment/form/index.js +2 -2
- package/es/payment/index.js +3 -3
- package/es/portal/invoice/list.d.ts +6 -0
- package/es/portal/invoice/list.js +84 -0
- package/es/portal/payment/list.d.ts +6 -0
- package/es/portal/payment/list.js +84 -0
- package/es/util.d.ts +4 -0
- package/es/util.js +56 -0
- package/lib/api.js +0 -1
- package/lib/components/confirm.d.ts +14 -0
- package/lib/components/confirm.js +49 -0
- package/lib/components/pricing-table.js +143 -135
- package/lib/contexts/payment.d.ts +4 -2
- package/lib/index.d.ts +4 -1
- package/lib/index.js +24 -0
- package/lib/locales/en.js +5 -1
- package/lib/locales/zh.js +4 -0
- package/lib/payment/form/index.js +2 -2
- package/lib/payment/index.js +3 -3
- package/lib/portal/invoice/list.d.ts +6 -0
- package/lib/portal/invoice/list.js +150 -0
- package/lib/portal/payment/list.d.ts +6 -0
- package/lib/portal/payment/list.js +149 -0
- package/lib/util.d.ts +4 -0
- package/lib/util.js +62 -1
- package/package.json +3 -3
- package/src/api.ts +1 -1
- package/src/components/confirm.tsx +39 -0
- package/src/components/pricing-table.tsx +125 -113
- package/src/contexts/payment.tsx +2 -2
- package/src/index.ts +6 -0
- package/src/locales/en.tsx +5 -1
- package/src/locales/zh.tsx +4 -0
- package/src/payment/form/index.tsx +5 -3
- package/src/payment/index.tsx +3 -3
- package/src/portal/invoice/list.tsx +122 -0
- package/src/portal/payment/list.tsx +120 -0
- package/src/util.ts +60 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EventHandler } from 'react';
|
|
2
|
+
declare function ConfirmDialog({ onConfirm, onCancel, title, message, loading, }: {
|
|
3
|
+
onConfirm: EventHandler<any>;
|
|
4
|
+
onCancel: EventHandler<any>;
|
|
5
|
+
title: string | React.ReactNode;
|
|
6
|
+
message: string | React.ReactNode;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
declare namespace ConfirmDialog {
|
|
10
|
+
var defaultProps: {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export default ConfirmDialog;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
module.exports = ConfirmDialog;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _Dialog = require("@arcblock/ux/lib/Dialog");
|
|
9
|
+
var _context = require("@arcblock/ux/lib/Locale/context");
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
function ConfirmDialog({
|
|
12
|
+
onConfirm,
|
|
13
|
+
onCancel,
|
|
14
|
+
title,
|
|
15
|
+
message,
|
|
16
|
+
loading
|
|
17
|
+
}) {
|
|
18
|
+
const {
|
|
19
|
+
t
|
|
20
|
+
} = (0, _context.useLocaleContext)();
|
|
21
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.Confirm, {
|
|
22
|
+
open: true,
|
|
23
|
+
title,
|
|
24
|
+
onConfirm,
|
|
25
|
+
onCancel,
|
|
26
|
+
confirmButton: {
|
|
27
|
+
text: t("common.confirm"),
|
|
28
|
+
props: {
|
|
29
|
+
color: "error",
|
|
30
|
+
size: "small",
|
|
31
|
+
variant: "contained",
|
|
32
|
+
disabled: !!loading
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
cancelButton: {
|
|
36
|
+
text: t("common.cancel"),
|
|
37
|
+
props: {
|
|
38
|
+
color: "inherit",
|
|
39
|
+
size: "small"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
43
|
+
children: message
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
ConfirmDialog.defaultProps = {
|
|
48
|
+
loading: false
|
|
49
|
+
};
|
|
@@ -10,6 +10,7 @@ var _Toast = _interopRequireDefault(require("@arcblock/ux/lib/Toast"));
|
|
|
10
10
|
var _iconsMaterial = require("@mui/icons-material");
|
|
11
11
|
var _lab = require("@mui/lab");
|
|
12
12
|
var _material = require("@mui/material");
|
|
13
|
+
var _system = require("@mui/system");
|
|
13
14
|
var _ahooks = require("ahooks");
|
|
14
15
|
var _react = require("react");
|
|
15
16
|
var _amount = _interopRequireDefault(require("../payment/amount"));
|
|
@@ -78,151 +79,158 @@ function PricingTable({
|
|
|
78
79
|
_Toast.default.error((0, _util.formatError)(err));
|
|
79
80
|
}
|
|
80
81
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
sm: 2
|
|
88
|
-
},
|
|
89
|
-
gap: {
|
|
90
|
-
xs: 3,
|
|
91
|
-
sm: mode === "select" ? 3 : 5
|
|
82
|
+
const Root = (0, _system.styled)(_material.Box)`
|
|
83
|
+
@media (max-width: ${({
|
|
84
|
+
theme
|
|
85
|
+
}) => theme.breakpoints.values.sm}px) {
|
|
86
|
+
.price-table-item {
|
|
87
|
+
width: 90% !important;
|
|
92
88
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Root, {
|
|
92
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
93
|
+
direction: "column",
|
|
94
|
+
alignItems: alignItems === "center" ? "center" : "flex-start",
|
|
95
|
+
sx: {
|
|
96
|
+
pt: {
|
|
97
|
+
xs: 4,
|
|
98
|
+
sm: 2
|
|
99
|
+
},
|
|
100
|
+
gap: {
|
|
101
|
+
xs: 3,
|
|
102
|
+
sm: mode === "select" ? 3 : 5
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
value:
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
children: [Object.keys(recurring).length > 1 && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ToggleButtonGroup, {
|
|
106
|
+
color: "primary",
|
|
107
|
+
value: state.interval,
|
|
108
|
+
onChange: (_, value) => {
|
|
109
|
+
if (value !== null) {
|
|
110
|
+
setState({
|
|
111
|
+
interval: value
|
|
112
|
+
});
|
|
113
|
+
}
|
|
109
114
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
action = x.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
boxShadow: "0 8px
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
115
|
+
exclusive: true,
|
|
116
|
+
children: Object.keys(recurring).map(x => /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ToggleButton, {
|
|
117
|
+
value: x,
|
|
118
|
+
sx: {
|
|
119
|
+
textTransform: "capitalize"
|
|
120
|
+
},
|
|
121
|
+
children: (0, _util.formatRecurring)(recurring[x], true, "", locale)
|
|
122
|
+
}, x))
|
|
123
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
124
|
+
flexWrap: "wrap",
|
|
125
|
+
direction: "row",
|
|
126
|
+
gap: "calc(10px + 3%)",
|
|
127
|
+
justifyContent: alignItems === "center" ? "center" : "flex-start",
|
|
128
|
+
children: grouped[state.interval]?.map(x => {
|
|
129
|
+
let action = x.subscription_data?.trial_period_days ? t("payment.checkout.try") : t("payment.checkout.subscription");
|
|
130
|
+
if (mode === "select") {
|
|
131
|
+
action = x.is_selected ? t("payment.checkout.selected") : t("payment.checkout.select");
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Fade, {
|
|
134
|
+
in: true,
|
|
135
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
136
|
+
padding: 4,
|
|
137
|
+
spacing: 2,
|
|
138
|
+
direction: "column",
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
className: "price-table-item",
|
|
141
|
+
sx: {
|
|
142
|
+
width: "30%",
|
|
143
|
+
cursor: "pointer",
|
|
144
|
+
borderWidth: "1px",
|
|
145
|
+
borderStyle: "solid",
|
|
146
|
+
borderColor: mode === "select" && x.is_selected ? "primary.main" : "#eee",
|
|
147
|
+
borderRadius: 1,
|
|
148
|
+
transition: "border-color 0.3s ease 0s, box-shadow 0.3s ease 0s",
|
|
149
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 20%)",
|
|
150
|
+
"&:hover": {
|
|
151
|
+
borderColor: mode === "select" && x.is_selected ? "primary.main" : "#ddd",
|
|
152
|
+
boxShadow: "0 8px 16px rgba(0, 0, 0, 20%)"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
156
|
+
textAlign: "center",
|
|
157
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
158
|
+
direction: "row",
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
spacing: 1,
|
|
161
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
162
|
+
variant: "h5",
|
|
163
|
+
color: "text.primary",
|
|
164
|
+
fontWeight: 600,
|
|
165
|
+
children: x.product.name
|
|
166
|
+
}), x.is_highlight && /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
167
|
+
label: x.highlight_text,
|
|
168
|
+
color: "default",
|
|
169
|
+
size: "small"
|
|
170
|
+
})]
|
|
171
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
172
|
+
color: "text.secondary",
|
|
173
|
+
children: x.product.description
|
|
174
|
+
})]
|
|
175
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
150
176
|
direction: "row",
|
|
151
177
|
alignItems: "center",
|
|
152
178
|
spacing: 1,
|
|
153
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
179
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_amount.default, {
|
|
180
|
+
amount: (0, _util.formatPriceAmount)(x.price, table.currency, x.product.unit_label)
|
|
181
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
182
|
+
direction: "column",
|
|
183
|
+
alignItems: "flex-start",
|
|
184
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
185
|
+
component: "span",
|
|
186
|
+
color: "text.secondary",
|
|
187
|
+
fontSize: "0.8rem",
|
|
188
|
+
children: t("payment.checkout.per")
|
|
189
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
190
|
+
component: "span",
|
|
191
|
+
color: "text.secondary",
|
|
192
|
+
fontSize: "0.8rem",
|
|
193
|
+
children: (0, _util.formatRecurring)(x.price.recurring, false, "", locale)
|
|
194
|
+
})]
|
|
162
195
|
})]
|
|
163
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
196
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_lab.LoadingButton, {
|
|
197
|
+
fullWidth: true,
|
|
198
|
+
size: "large",
|
|
199
|
+
variant: x.is_highlight || x.is_selected ? "contained" : "outlined",
|
|
200
|
+
color: x.is_highlight || x.is_selected ? "primary" : "info",
|
|
201
|
+
sx: {
|
|
202
|
+
fontSize: "1.2rem"
|
|
203
|
+
},
|
|
204
|
+
loading: state.loading === x.price_id,
|
|
205
|
+
disabled: x.is_disabled,
|
|
206
|
+
onClick: () => handleSelect(x.price_id),
|
|
207
|
+
children: action
|
|
208
|
+
}), x.product.features.length > 0 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
176
209
|
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
children:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
210
|
+
children: t("payment.checkout.include")
|
|
211
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.List, {
|
|
212
|
+
dense: true,
|
|
213
|
+
children: x.product.features.map(f => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.ListItem, {
|
|
214
|
+
disableGutters: true,
|
|
215
|
+
disablePadding: true,
|
|
216
|
+
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
217
|
+
sx: {
|
|
218
|
+
minWidth: 25
|
|
219
|
+
},
|
|
220
|
+
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_iconsMaterial.CheckOutlined, {
|
|
221
|
+
color: "success",
|
|
222
|
+
fontSize: "small"
|
|
223
|
+
})
|
|
224
|
+
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
225
|
+
primary: f.name
|
|
226
|
+
})]
|
|
227
|
+
}, f.name))
|
|
186
228
|
})]
|
|
187
229
|
})]
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
color: x.is_highlight || x.is_selected ? "primary" : "info",
|
|
194
|
-
sx: {
|
|
195
|
-
fontSize: "1.2rem"
|
|
196
|
-
},
|
|
197
|
-
loading: state.loading === x.price_id,
|
|
198
|
-
disabled: x.is_disabled,
|
|
199
|
-
onClick: () => handleSelect(x.price_id),
|
|
200
|
-
children: action
|
|
201
|
-
}), x.product.features.length > 0 && /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
202
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
203
|
-
children: t("payment.checkout.include")
|
|
204
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.List, {
|
|
205
|
-
dense: true,
|
|
206
|
-
children: x.product.features.map(f => /* @__PURE__ */(0, _jsxRuntime.jsxs)(_material.ListItem, {
|
|
207
|
-
disableGutters: true,
|
|
208
|
-
disablePadding: true,
|
|
209
|
-
children: [/* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
210
|
-
sx: {
|
|
211
|
-
minWidth: 25
|
|
212
|
-
},
|
|
213
|
-
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_iconsMaterial.CheckOutlined, {
|
|
214
|
-
color: "success",
|
|
215
|
-
fontSize: "small"
|
|
216
|
-
})
|
|
217
|
-
}), /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
218
|
-
primary: f.name
|
|
219
|
-
})]
|
|
220
|
-
}, f.name))
|
|
221
|
-
})]
|
|
222
|
-
})]
|
|
223
|
-
})
|
|
224
|
-
}, x.price_id);
|
|
225
|
-
})
|
|
226
|
-
})]
|
|
230
|
+
})
|
|
231
|
+
}, x.price_id);
|
|
232
|
+
})
|
|
233
|
+
})]
|
|
234
|
+
})
|
|
227
235
|
});
|
|
228
236
|
}
|
|
@@ -7,8 +7,10 @@ export interface Settings {
|
|
|
7
7
|
}
|
|
8
8
|
export type PaymentContextType = {
|
|
9
9
|
livemode: boolean;
|
|
10
|
-
session:
|
|
11
|
-
|
|
10
|
+
session: import('@arcblock/did-connect/lib/types').SessionContext['session'] & {
|
|
11
|
+
user: any;
|
|
12
|
+
};
|
|
13
|
+
connect: import('@arcblock/did-connect/lib/types').SessionContext['connectApi'];
|
|
12
14
|
prefix: string;
|
|
13
15
|
settings: Settings;
|
|
14
16
|
refresh: () => void;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import api from './api';
|
|
2
2
|
import CheckoutForm from './checkout/form';
|
|
3
3
|
import CheckoutTable from './checkout/table';
|
|
4
|
+
import ConfirmDialog from './components/confirm';
|
|
4
5
|
import FormInput from './components/input';
|
|
5
6
|
import Livemode from './components/livemode';
|
|
6
7
|
import PricingTable from './components/pricing-table';
|
|
@@ -11,7 +12,9 @@ import Amount from './payment/amount';
|
|
|
11
12
|
import PhoneInput from './payment/form/phone';
|
|
12
13
|
import Payment from './payment/index';
|
|
13
14
|
import ProductSkeleton from './payment/product-skeleton';
|
|
15
|
+
import CustomerInvoiceList from './portal/invoice/list';
|
|
16
|
+
import CustomerPaymentList from './portal/payment/list';
|
|
14
17
|
export * from './util';
|
|
15
18
|
export * from './contexts/payment';
|
|
16
19
|
export { translations, createTranslator } from './locales';
|
|
17
|
-
export { api, dayjs, FormInput, PhoneInput, Status, Livemode, Switch, CheckoutForm, CheckoutTable, Payment, PricingTable, ProductSkeleton, Amount, };
|
|
20
|
+
export { api, dayjs, FormInput, PhoneInput, Status, Livemode, Switch, ConfirmDialog, CheckoutForm, CheckoutTable, Payment, PricingTable, ProductSkeleton, Amount, CustomerInvoiceList, CustomerPaymentList, };
|
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var _exportNames = {
|
|
|
7
7
|
api: true,
|
|
8
8
|
CheckoutForm: true,
|
|
9
9
|
CheckoutTable: true,
|
|
10
|
+
ConfirmDialog: true,
|
|
10
11
|
FormInput: true,
|
|
11
12
|
Livemode: true,
|
|
12
13
|
PricingTable: true,
|
|
@@ -17,6 +18,8 @@ var _exportNames = {
|
|
|
17
18
|
PhoneInput: true,
|
|
18
19
|
Payment: true,
|
|
19
20
|
ProductSkeleton: true,
|
|
21
|
+
CustomerInvoiceList: true,
|
|
22
|
+
CustomerPaymentList: true,
|
|
20
23
|
translations: true,
|
|
21
24
|
createTranslator: true
|
|
22
25
|
};
|
|
@@ -38,6 +41,24 @@ Object.defineProperty(exports, "CheckoutTable", {
|
|
|
38
41
|
return _table.default;
|
|
39
42
|
}
|
|
40
43
|
});
|
|
44
|
+
Object.defineProperty(exports, "ConfirmDialog", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _confirm.default;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "CustomerInvoiceList", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () {
|
|
53
|
+
return _list.default;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "CustomerPaymentList", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _list2.default;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
41
62
|
Object.defineProperty(exports, "FormInput", {
|
|
42
63
|
enumerable: true,
|
|
43
64
|
get: function () {
|
|
@@ -113,6 +134,7 @@ Object.defineProperty(exports, "translations", {
|
|
|
113
134
|
var _api = _interopRequireDefault(require("./api"));
|
|
114
135
|
var _form = _interopRequireDefault(require("./checkout/form"));
|
|
115
136
|
var _table = _interopRequireDefault(require("./checkout/table"));
|
|
137
|
+
var _confirm = _interopRequireDefault(require("./components/confirm"));
|
|
116
138
|
var _input = _interopRequireDefault(require("./components/input"));
|
|
117
139
|
var _livemode = _interopRequireDefault(require("./components/livemode"));
|
|
118
140
|
var _pricingTable = _interopRequireDefault(require("./components/pricing-table"));
|
|
@@ -123,6 +145,8 @@ var _amount = _interopRequireDefault(require("./payment/amount"));
|
|
|
123
145
|
var _phone = _interopRequireDefault(require("./payment/form/phone"));
|
|
124
146
|
var _index = _interopRequireDefault(require("./payment/index"));
|
|
125
147
|
var _productSkeleton = _interopRequireDefault(require("./payment/product-skeleton"));
|
|
148
|
+
var _list = _interopRequireDefault(require("./portal/invoice/list"));
|
|
149
|
+
var _list2 = _interopRequireDefault(require("./portal/payment/list"));
|
|
126
150
|
var _util = require("./util");
|
|
127
151
|
Object.keys(_util).forEach(function (key) {
|
|
128
152
|
if (key === "default" || key === "__esModule") return;
|
package/lib/locales/en.js
CHANGED
|
@@ -153,6 +153,7 @@ module.exports = (0, _flat.default)({
|
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
customer: {
|
|
156
|
+
payments: "Payment History",
|
|
156
157
|
invoices: "Invoice History",
|
|
157
158
|
details: "Billing Details",
|
|
158
159
|
update: "Update Information",
|
|
@@ -208,7 +209,10 @@ module.exports = (0, _flat.default)({
|
|
|
208
209
|
pay: "Pay this invoice",
|
|
209
210
|
paySuccess: "You have successfully paid the invoice",
|
|
210
211
|
payError: "Failed to paid the invoice",
|
|
211
|
-
empty: "Seems you do not have any
|
|
212
|
+
empty: "Seems you do not have any invoice here"
|
|
213
|
+
},
|
|
214
|
+
payment: {
|
|
215
|
+
empty: "Seems you do not have any payment here"
|
|
212
216
|
},
|
|
213
217
|
subscriptions: {
|
|
214
218
|
title: "Manage subscriptions",
|
package/lib/locales/zh.js
CHANGED
|
@@ -153,6 +153,7 @@ module.exports = (0, _flat.default)({
|
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
customer: {
|
|
156
|
+
payments: "\u652F\u4ED8\u5386\u53F2",
|
|
156
157
|
invoices: "\u53D1\u7968\u5386\u53F2",
|
|
157
158
|
details: "\u8BA1\u8D39\u8BE6\u60C5",
|
|
158
159
|
update: "\u66F4\u65B0\u5BA2\u6237\u4FE1\u606F",
|
|
@@ -208,6 +209,9 @@ module.exports = (0, _flat.default)({
|
|
|
208
209
|
pay: "\u652F\u4ED8\u6B64\u53D1\u7968",
|
|
209
210
|
paySuccess: "\u652F\u4ED8\u6210\u529F",
|
|
210
211
|
payError: "\u652F\u4ED8\u5931\u8D25",
|
|
212
|
+
empty: "\u4F60\u6CA1\u6709\u4EFB\u4F55\u53D1\u7968"
|
|
213
|
+
},
|
|
214
|
+
payment: {
|
|
211
215
|
empty: "\u4F60\u6CA1\u6709\u4EFB\u4F55\u652F\u4ED8"
|
|
212
216
|
},
|
|
213
217
|
subscriptions: {
|
|
@@ -204,9 +204,9 @@ function PaymentForm({
|
|
|
204
204
|
await handleConnected();
|
|
205
205
|
} else {
|
|
206
206
|
connect.open({
|
|
207
|
+
containerEl: void 0,
|
|
207
208
|
action: checkoutSession.mode,
|
|
208
|
-
prefix: (0, _ufo.joinURL)((0, _util.getPrefix)(), "/api/did"),
|
|
209
|
-
timeout: 5 * 60 * 1e3,
|
|
209
|
+
prefix: (0, _ufo.joinURL)(window.location.origin, (0, _util.getPrefix)(), "/api/did"),
|
|
210
210
|
extraParams: {
|
|
211
211
|
checkoutSessionId: checkoutSession.id
|
|
212
212
|
},
|
package/lib/payment/index.js
CHANGED
|
@@ -363,18 +363,18 @@ const Root = exports.Root = (0, _system.styled)(_material.Box)`
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
.cko-payment-card-unselect {
|
|
366
|
-
border: 2px solid #
|
|
366
|
+
border: 2px solid #ddd;
|
|
367
367
|
padding: 5px 10px;
|
|
368
368
|
margin: 5px 0;
|
|
369
369
|
cursor: pointer;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
.cko-payment-card:nth-child(odd) {
|
|
373
|
-
margin-right:
|
|
373
|
+
margin-right: 16px;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
376
|
.cko-payment-card-unselect:nth-child(odd) {
|
|
377
|
-
margin-right:
|
|
377
|
+
margin-right: 16px;
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
.cko-payment-card::after {
|