@blocklet/payment-react 1.13.262 → 1.13.264
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/donate.d.ts +3 -1
- package/es/checkout/donate.js +4 -3
- package/es/components/pricing-table.js +2 -9
- package/es/payment/index.js +1 -1
- package/es/payment/success.js +1 -1
- package/lib/checkout/donate.d.ts +3 -1
- package/lib/checkout/donate.js +4 -2
- package/lib/components/pricing-table.js +2 -9
- package/lib/payment/index.js +1 -1
- package/lib/payment/success.js +3 -0
- package/package.json +3 -3
- package/src/checkout/donate.tsx +4 -2
- package/src/components/pricing-table.tsx +2 -9
- package/src/payment/index.tsx +1 -1
- package/src/payment/success.tsx +1 -1
package/es/checkout/donate.d.ts
CHANGED
|
@@ -10,11 +10,13 @@ export type DonateHistory = {
|
|
|
10
10
|
export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
11
11
|
settings: DonationSettings;
|
|
12
12
|
livemode?: boolean;
|
|
13
|
+
timeout?: number;
|
|
13
14
|
};
|
|
14
|
-
declare function CheckoutDonate({ settings, livemode, onPaid, onError }: DonateProps): import("react").JSX.Element | null;
|
|
15
|
+
declare function CheckoutDonate({ settings, livemode, timeout, onPaid, onError }: DonateProps): import("react").JSX.Element | null;
|
|
15
16
|
declare namespace CheckoutDonate {
|
|
16
17
|
var defaultProps: {
|
|
17
18
|
livemode: boolean;
|
|
19
|
+
timeout: number;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export default CheckoutDonate;
|
package/es/checkout/donate.js
CHANGED
|
@@ -122,7 +122,7 @@ function SupporterTable({ supporters = [], total = 0, currency, method }) {
|
|
|
122
122
|
)) }) })
|
|
123
123
|
] });
|
|
124
124
|
}
|
|
125
|
-
export default function CheckoutDonate({ settings, livemode, onPaid, onError }) {
|
|
125
|
+
export default function CheckoutDonate({ settings, livemode, timeout, onPaid, onError }) {
|
|
126
126
|
const [state, setState] = useSetState({
|
|
127
127
|
open: false,
|
|
128
128
|
supporterLoaded: false,
|
|
@@ -145,7 +145,7 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError })
|
|
|
145
145
|
supporters.runAsync().catch(console.error);
|
|
146
146
|
setTimeout(() => {
|
|
147
147
|
setState({ open: false });
|
|
148
|
-
},
|
|
148
|
+
}, timeout);
|
|
149
149
|
};
|
|
150
150
|
if (donation.error) {
|
|
151
151
|
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: formatError(donation.error) });
|
|
@@ -203,5 +203,6 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError })
|
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
205
|
CheckoutDonate.defaultProps = {
|
|
206
|
-
livemode: true
|
|
206
|
+
livemode: true,
|
|
207
|
+
timeout: 5e3
|
|
207
208
|
};
|
|
@@ -68,15 +68,6 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
68
68
|
.price-table-wrap:has(> div:nth-child(3)) {
|
|
69
69
|
max-width: 1080px !important;
|
|
70
70
|
}
|
|
71
|
-
.price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
|
|
72
|
-
width: 90% !important;
|
|
73
|
-
}
|
|
74
|
-
.price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
|
|
75
|
-
width: 45% !important;
|
|
76
|
-
}
|
|
77
|
-
.price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
|
|
78
|
-
width: 30% !important;
|
|
79
|
-
}
|
|
80
71
|
}
|
|
81
72
|
`;
|
|
82
73
|
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(
|
|
@@ -167,6 +158,8 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
167
158
|
borderColor: mode === "select" && x.is_selected ? "primary.main" : "#ddd",
|
|
168
159
|
boxShadow: "0 8px 16px rgba(0, 0, 0, 20%)"
|
|
169
160
|
},
|
|
161
|
+
width: "320px",
|
|
162
|
+
maxWidth: "360px",
|
|
170
163
|
padding: "20px",
|
|
171
164
|
position: "relative"
|
|
172
165
|
},
|
package/es/payment/index.js
CHANGED
|
@@ -259,7 +259,7 @@ export function PaymentInner({
|
|
|
259
259
|
invoiceId: state.checkoutSession.invoice_id,
|
|
260
260
|
subscriptionId: state.checkoutSession.subscription_id,
|
|
261
261
|
message: paymentLink?.after_completion?.hosted_confirmation?.custom_message || t(
|
|
262
|
-
`payment.checkout.completed.${
|
|
262
|
+
`payment.checkout.completed.${state.checkoutSession.submit_type === "donate" ? "donate" : state.checkoutSession.mode}`
|
|
263
263
|
)
|
|
264
264
|
}
|
|
265
265
|
),
|
package/es/payment/success.js
CHANGED
|
@@ -28,7 +28,7 @@ export default function PaymentSuccess({ mode, message, action, payee, invoiceId
|
|
|
28
28
|
/* @__PURE__ */ jsx("div", { className: "icon-fix" })
|
|
29
29
|
] }) }),
|
|
30
30
|
/* @__PURE__ */ jsx(Typography, { variant: "h5", color: "text.primary", mb: 3, children: message }),
|
|
31
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1", color: "text.secondary", textAlign: "center", children: t("payment.checkout.completed.tip", { payee }) }),
|
|
31
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", color: "text.secondary", textAlign: "center", sx: { fontSize: "14px" }, children: t("payment.checkout.completed.tip", { payee }) }),
|
|
32
32
|
next
|
|
33
33
|
]
|
|
34
34
|
}
|
package/lib/checkout/donate.d.ts
CHANGED
|
@@ -10,11 +10,13 @@ export type DonateHistory = {
|
|
|
10
10
|
export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
11
11
|
settings: DonationSettings;
|
|
12
12
|
livemode?: boolean;
|
|
13
|
+
timeout?: number;
|
|
13
14
|
};
|
|
14
|
-
declare function CheckoutDonate({ settings, livemode, onPaid, onError }: DonateProps): import("react").JSX.Element | null;
|
|
15
|
+
declare function CheckoutDonate({ settings, livemode, timeout, onPaid, onError }: DonateProps): import("react").JSX.Element | null;
|
|
15
16
|
declare namespace CheckoutDonate {
|
|
16
17
|
var defaultProps: {
|
|
17
18
|
livemode: boolean;
|
|
19
|
+
timeout: number;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
export default CheckoutDonate;
|
package/lib/checkout/donate.js
CHANGED
|
@@ -190,6 +190,7 @@ function SupporterTable({
|
|
|
190
190
|
function CheckoutDonate({
|
|
191
191
|
settings,
|
|
192
192
|
livemode,
|
|
193
|
+
timeout,
|
|
193
194
|
onPaid,
|
|
194
195
|
onError
|
|
195
196
|
}) {
|
|
@@ -217,7 +218,7 @@ function CheckoutDonate({
|
|
|
217
218
|
setState({
|
|
218
219
|
open: false
|
|
219
220
|
});
|
|
220
|
-
},
|
|
221
|
+
}, timeout);
|
|
221
222
|
};
|
|
222
223
|
if (donation.error) {
|
|
223
224
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Alert, {
|
|
@@ -286,5 +287,6 @@ function CheckoutDonate({
|
|
|
286
287
|
});
|
|
287
288
|
}
|
|
288
289
|
CheckoutDonate.defaultProps = {
|
|
289
|
-
livemode: true
|
|
290
|
+
livemode: true,
|
|
291
|
+
timeout: 5e3
|
|
290
292
|
};
|
|
@@ -87,15 +87,6 @@ function PricingTable({
|
|
|
87
87
|
.price-table-wrap:has(> div:nth-child(3)) {
|
|
88
88
|
max-width: 1080px !important;
|
|
89
89
|
}
|
|
90
|
-
.price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
|
|
91
|
-
width: 90% !important;
|
|
92
|
-
}
|
|
93
|
-
.price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
|
|
94
|
-
width: 45% !important;
|
|
95
|
-
}
|
|
96
|
-
.price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
|
|
97
|
-
width: 30% !important;
|
|
98
|
-
}
|
|
99
90
|
}
|
|
100
91
|
`;
|
|
101
92
|
return /* @__PURE__ */(0, _jsxRuntime.jsx)(Root, {
|
|
@@ -173,6 +164,8 @@ function PricingTable({
|
|
|
173
164
|
borderColor: mode === "select" && x.is_selected ? "primary.main" : "#ddd",
|
|
174
165
|
boxShadow: "0 8px 16px rgba(0, 0, 0, 20%)"
|
|
175
166
|
},
|
|
167
|
+
width: "320px",
|
|
168
|
+
maxWidth: "360px",
|
|
176
169
|
padding: "20px",
|
|
177
170
|
position: "relative"
|
|
178
171
|
},
|
package/lib/payment/index.js
CHANGED
|
@@ -338,7 +338,7 @@ function PaymentInner({
|
|
|
338
338
|
action: state.checkoutSession.mode,
|
|
339
339
|
invoiceId: state.checkoutSession.invoice_id,
|
|
340
340
|
subscriptionId: state.checkoutSession.subscription_id,
|
|
341
|
-
message: paymentLink?.after_completion?.hosted_confirmation?.custom_message || t(`payment.checkout.completed.${
|
|
341
|
+
message: paymentLink?.after_completion?.hosted_confirmation?.custom_message || t(`payment.checkout.completed.${state.checkoutSession.submit_type === "donate" ? "donate" : state.checkoutSession.mode}`)
|
|
342
342
|
}), !completed && /* @__PURE__ */(0, _jsxRuntime.jsx)(_form.default, {
|
|
343
343
|
checkoutSession: state.checkoutSession,
|
|
344
344
|
paymentMethods,
|
package/lib/payment/success.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.264",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@babel/core": "^7.24.5",
|
|
92
92
|
"@babel/preset-env": "^7.24.5",
|
|
93
93
|
"@babel/preset-react": "^7.24.1",
|
|
94
|
-
"@blocklet/payment-types": "1.13.
|
|
94
|
+
"@blocklet/payment-types": "1.13.264",
|
|
95
95
|
"@storybook/addon-essentials": "^7.6.19",
|
|
96
96
|
"@storybook/addon-interactions": "^7.6.19",
|
|
97
97
|
"@storybook/addon-links": "^7.6.19",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"vite-plugin-babel": "^1.2.0",
|
|
121
121
|
"vite-plugin-node-polyfills": "^0.21.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "cd570450d39c6918d49bf67d29c4907705e69078"
|
|
124
124
|
}
|
package/src/checkout/donate.tsx
CHANGED
|
@@ -42,6 +42,7 @@ export type DonateHistory = {
|
|
|
42
42
|
export type DonateProps = Pick<CheckoutProps, 'onPaid' | 'onError'> & {
|
|
43
43
|
settings: DonationSettings;
|
|
44
44
|
livemode?: boolean;
|
|
45
|
+
timeout?: number;
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
const donationCache: { [key: string]: Promise<TPaymentLink> } = {};
|
|
@@ -173,7 +174,7 @@ function SupporterTable({ supporters = [], total = 0, currency, method }: Donate
|
|
|
173
174
|
);
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
export default function CheckoutDonate({ settings, livemode, onPaid, onError }: DonateProps) {
|
|
177
|
+
export default function CheckoutDonate({ settings, livemode, timeout, onPaid, onError }: DonateProps) {
|
|
177
178
|
const [state, setState] = useSetState({
|
|
178
179
|
open: false,
|
|
179
180
|
supporterLoaded: false,
|
|
@@ -202,7 +203,7 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError }:
|
|
|
202
203
|
|
|
203
204
|
setTimeout(() => {
|
|
204
205
|
setState({ open: false });
|
|
205
|
-
},
|
|
206
|
+
}, timeout);
|
|
206
207
|
};
|
|
207
208
|
|
|
208
209
|
if (donation.error) {
|
|
@@ -263,4 +264,5 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError }:
|
|
|
263
264
|
|
|
264
265
|
CheckoutDonate.defaultProps = {
|
|
265
266
|
livemode: true,
|
|
267
|
+
timeout: 5000,
|
|
266
268
|
};
|
|
@@ -89,15 +89,6 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
89
89
|
.price-table-wrap:has(> div:nth-child(3)) {
|
|
90
90
|
max-width: 1080px !important;
|
|
91
91
|
}
|
|
92
|
-
.price-table-wrap:has(> div:nth-child(1)) > .price-table-item {
|
|
93
|
-
width: 90% !important;
|
|
94
|
-
}
|
|
95
|
-
.price-table-wrap:has(> div:nth-child(2)) > .price-table-item {
|
|
96
|
-
width: 45% !important;
|
|
97
|
-
}
|
|
98
|
-
.price-table-wrap:has(> div:nth-child(3)) > .price-table-item {
|
|
99
|
-
width: 30% !important;
|
|
100
|
-
}
|
|
101
92
|
}
|
|
102
93
|
`;
|
|
103
94
|
return (
|
|
@@ -187,6 +178,8 @@ export default function PricingTable({ table, alignItems, interval, mode, onSele
|
|
|
187
178
|
borderColor: mode === 'select' && x.is_selected ? 'primary.main' : '#ddd',
|
|
188
179
|
boxShadow: '0 8px 16px rgba(0, 0, 0, 20%)',
|
|
189
180
|
},
|
|
181
|
+
width: '320px',
|
|
182
|
+
maxWidth: '360px',
|
|
190
183
|
|
|
191
184
|
padding: '20px',
|
|
192
185
|
position: 'relative',
|
package/src/payment/index.tsx
CHANGED
|
@@ -307,7 +307,7 @@ export function PaymentInner({
|
|
|
307
307
|
paymentLink?.after_completion?.hosted_confirmation?.custom_message ||
|
|
308
308
|
t(
|
|
309
309
|
`payment.checkout.completed.${
|
|
310
|
-
|
|
310
|
+
state.checkoutSession.submit_type === 'donate' ? 'donate' : state.checkoutSession.mode
|
|
311
311
|
}`
|
|
312
312
|
)
|
|
313
313
|
}
|
package/src/payment/success.tsx
CHANGED
|
@@ -54,7 +54,7 @@ export default function PaymentSuccess({ mode, message, action, payee, invoiceId
|
|
|
54
54
|
<Typography variant="h5" color="text.primary" mb={3}>
|
|
55
55
|
{message}
|
|
56
56
|
</Typography>
|
|
57
|
-
<Typography variant="body1" color="text.secondary" textAlign="center">
|
|
57
|
+
<Typography variant="body1" color="text.secondary" textAlign="center" sx={{ fontSize: '14px' }}>
|
|
58
58
|
{t('payment.checkout.completed.tip', { payee })}
|
|
59
59
|
</Typography>
|
|
60
60
|
{next}
|