payment-kit 1.19.11 → 1.19.13
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/api/src/libs/notification/template/one-time-payment-refund-succeeded.ts +274 -0
- package/api/src/libs/notification/template/one-time-payment-succeeded.ts +10 -21
- package/api/src/libs/notification/template/subscription-refund-succeeded.ts +23 -3
- package/api/src/libs/notification/template/subscription-will-renew.ts +15 -2
- package/api/src/libs/session.ts +70 -1
- package/api/src/locales/en.ts +10 -0
- package/api/src/locales/zh.ts +10 -0
- package/api/src/queues/credit-consume.ts +4 -1
- package/api/src/queues/notification.ts +16 -3
- package/api/src/routes/checkout-sessions.ts +9 -0
- package/blocklet.yml +6 -6
- package/package.json +16 -16
- package/screenshots/0ffe164ebe4aa2eb43f8d87f87683f7f.png +0 -0
- package/screenshots/1ef9e15ac36d4af5bef34941000ba3af.png +0 -0
- package/screenshots/3a4cab81c52c29662db8794b05ccc7c7.png +0 -0
- package/screenshots/77ac49b79ae920f0f253ce8c694ffd65.png +0 -0
- package/screenshots/7ea8ef758865ecf6edb712d3534d2974.png +0 -0
- package/src/components/chart.tsx +1 -1
- package/src/components/conditional-section.tsx +11 -1
- package/src/components/customer/credit-overview.tsx +51 -48
- package/src/components/drawer-form.tsx +1 -1
- package/src/components/filter-toolbar.tsx +1 -1
- package/src/components/info-card.tsx +1 -1
- package/src/components/invoice-pdf/pdf.tsx +1 -1
- package/src/components/layout/admin.tsx +0 -4
- package/src/components/metadata/form.tsx +1 -1
- package/src/components/meter/actions.tsx +1 -1
- package/src/components/meter/events-list.tsx +6 -0
- package/src/components/meter/usage-guide.tsx +1 -1
- package/src/components/payment-link/item.tsx +1 -1
- package/src/components/price/form.tsx +0 -19
- package/src/components/pricing-table/product-item.tsx +1 -1
- package/src/components/product/features.tsx +1 -1
- package/src/components/uploader.tsx +1 -1
- package/src/components/webhook/attempts.tsx +1 -1
- package/src/locales/en.tsx +7 -4
- package/src/locales/zh.tsx +6 -2
- package/src/pages/admin/developers/webhooks/detail.tsx +1 -1
- package/src/pages/admin/products/pricing-tables/create.tsx +2 -2
- package/src/pages/checkout/pricing-table.tsx +1 -1
- package/src/pages/customer/index.tsx +30 -14
- package/src/pages/customer/invoice/detail.tsx +1 -1
- package/src/pages/integrations/donations/preview.tsx +4 -4
- package/screenshots/checkout.png +0 -0
- package/screenshots/customer.png +0 -0
- package/screenshots/payment.png +0 -0
- package/screenshots/setting.png +0 -0
- package/screenshots/subscription_detail.png +0 -0
|
@@ -36,7 +36,7 @@ import type { SelectChangeEvent } from '@mui/material/Select';
|
|
|
36
36
|
import { styled } from '@mui/system';
|
|
37
37
|
import { useRequest, useSetState } from 'ahooks';
|
|
38
38
|
import { flatten, isEmpty } from 'lodash';
|
|
39
|
-
import { memo, useEffect, useState } from 'react';
|
|
39
|
+
import { memo, useEffect, useState, Fragment } from 'react';
|
|
40
40
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
41
41
|
import { joinURL } from 'ufo';
|
|
42
42
|
import CreditOverview from '../../components/customer/credit-overview';
|
|
@@ -193,6 +193,10 @@ export default function CustomerHome() {
|
|
|
193
193
|
const { t } = useLocaleContext();
|
|
194
194
|
const { events } = useSessionContext();
|
|
195
195
|
const { settings } = usePaymentContext();
|
|
196
|
+
const [domFilter, setDomFilter] = useSetState<any>({
|
|
197
|
+
credit: '',
|
|
198
|
+
revenue: '',
|
|
199
|
+
});
|
|
196
200
|
const [subscriptionLoading, setSubscriptionLoading] = useState(false);
|
|
197
201
|
const currencies = flatten(
|
|
198
202
|
settings.paymentMethods?.map((method) =>
|
|
@@ -399,7 +403,7 @@ export default function CustomerHome() {
|
|
|
399
403
|
p: 2,
|
|
400
404
|
gap: 2,
|
|
401
405
|
border: '1px solid',
|
|
402
|
-
borderColor: '
|
|
406
|
+
borderColor: 'divider',
|
|
403
407
|
boxShadow: 1,
|
|
404
408
|
}}>
|
|
405
409
|
<Stack
|
|
@@ -481,7 +485,7 @@ export default function CustomerHome() {
|
|
|
481
485
|
|
|
482
486
|
// 独立的Credit Card组件
|
|
483
487
|
const CreditCard = (
|
|
484
|
-
<ConditionalSection skeleton={loadingCard}>
|
|
488
|
+
<ConditionalSection skeleton={loadingCard} onStateChange={(val) => setDomFilter({ credit: val })}>
|
|
485
489
|
<Box className="base-card section section-credit">
|
|
486
490
|
<Box className="section-header" sx={{ mb: 2 }}>
|
|
487
491
|
<Typography variant="h3">{t('admin.creditGrants.title')}</Typography>
|
|
@@ -520,16 +524,28 @@ export default function CustomerHome() {
|
|
|
520
524
|
);
|
|
521
525
|
|
|
522
526
|
const RevenueCard = (
|
|
523
|
-
<ConditionalSection skeleton={loadingCard}>
|
|
527
|
+
<ConditionalSection skeleton={loadingCard} onStateChange={(val) => setDomFilter({ revenue: val })}>
|
|
524
528
|
<Box className="base-card section section-revenue">
|
|
525
529
|
<Box className="section-header">
|
|
526
530
|
<Typography variant="h3">{t('customer.payout.title')}</Typography>
|
|
527
531
|
</Box>
|
|
528
|
-
<
|
|
532
|
+
<Box className="section-body">
|
|
533
|
+
<CustomerRevenueList />
|
|
534
|
+
</Box>
|
|
529
535
|
</Box>
|
|
530
536
|
</ConditionalSection>
|
|
531
537
|
);
|
|
532
538
|
|
|
539
|
+
const cards = [
|
|
540
|
+
{ card: SummaryCard, key: 'summary' },
|
|
541
|
+
{ card: CreditCard, key: 'credit' },
|
|
542
|
+
{ card: SubscriptionCard, key: 'subscription' },
|
|
543
|
+
{ card: InvoiceCard, key: 'invoice' },
|
|
544
|
+
{ card: RevenueCard, key: 'revenue' },
|
|
545
|
+
];
|
|
546
|
+
|
|
547
|
+
const visibleCards = cards.filter(({ card, key }) => card && domFilter[key] !== 'none');
|
|
548
|
+
|
|
533
549
|
return (
|
|
534
550
|
<Content>
|
|
535
551
|
{data?.error && (
|
|
@@ -582,15 +598,12 @@ export default function CustomerHome() {
|
|
|
582
598
|
/>
|
|
583
599
|
)}
|
|
584
600
|
<Root>
|
|
585
|
-
{
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
{InvoiceCard}
|
|
592
|
-
{InvoiceCard && <Divider />}
|
|
593
|
-
{RevenueCard}
|
|
601
|
+
{visibleCards.map(({ card, key }, index, array) => (
|
|
602
|
+
<Fragment key={key}>
|
|
603
|
+
{card}
|
|
604
|
+
{(domFilter[key] ? domFilter[key] === 'visible' : index < array.length - 1) && <Divider />}
|
|
605
|
+
</Fragment>
|
|
606
|
+
))}
|
|
594
607
|
</Root>
|
|
595
608
|
</Content>
|
|
596
609
|
);
|
|
@@ -627,6 +640,9 @@ const Root = styled(Stack)`
|
|
|
627
640
|
gap: 24px;
|
|
628
641
|
display: flex;
|
|
629
642
|
flex-direction: column;
|
|
643
|
+
.section-body {
|
|
644
|
+
padding: 0 1px;
|
|
645
|
+
}
|
|
630
646
|
@media (max-width: ${({ theme }) => theme.breakpoints.values.xl}px) {
|
|
631
647
|
padding: 0px;
|
|
632
648
|
.base-card {
|
|
@@ -170,7 +170,7 @@ export default function CustomerInvoiceDetail() {
|
|
|
170
170
|
variant="outlined"
|
|
171
171
|
color="primary"
|
|
172
172
|
size="small"
|
|
173
|
-
sx={{ borderColor: '
|
|
173
|
+
sx={{ borderColor: 'divider' }}
|
|
174
174
|
disabled={state.paying}
|
|
175
175
|
onClick={onPay}>
|
|
176
176
|
{t('payment.customer.invoice.pay')}
|
|
@@ -25,7 +25,7 @@ function PreviewAvatars({ count }: { count: number }) {
|
|
|
25
25
|
borderRadius: '50%',
|
|
26
26
|
bgcolor: 'grey.200',
|
|
27
27
|
border: '2px solid',
|
|
28
|
-
borderColor: '
|
|
28
|
+
borderColor: 'divider',
|
|
29
29
|
position: 'relative',
|
|
30
30
|
marginLeft: i === 0 ? 0 : '-8px',
|
|
31
31
|
zIndex: count - i,
|
|
@@ -151,7 +151,7 @@ export default function DonationPreview({ config }: { config: TSetting['settings
|
|
|
151
151
|
borderRadius: '50%',
|
|
152
152
|
bgcolor: 'grey.200',
|
|
153
153
|
border: '2px solid',
|
|
154
|
-
borderColor: '
|
|
154
|
+
borderColor: 'divider',
|
|
155
155
|
position: 'relative',
|
|
156
156
|
}}
|
|
157
157
|
/>
|
|
@@ -213,7 +213,7 @@ export default function DonationPreview({ config }: { config: TSetting['settings
|
|
|
213
213
|
variant="outlined"
|
|
214
214
|
size="small"
|
|
215
215
|
sx={{
|
|
216
|
-
borderColor: selectedAmount === amount ? 'primary.main' : '
|
|
216
|
+
borderColor: selectedAmount === amount ? 'primary.main' : 'divider',
|
|
217
217
|
borderWidth: selectedAmount === amount ? 2 : 1,
|
|
218
218
|
color: selectedAmount === amount ? 'primary.main' : 'text.primary',
|
|
219
219
|
}}
|
|
@@ -226,7 +226,7 @@ export default function DonationPreview({ config }: { config: TSetting['settings
|
|
|
226
226
|
variant="outlined"
|
|
227
227
|
size="small"
|
|
228
228
|
sx={{
|
|
229
|
-
borderColor: showCustom ? 'primary.main' : '
|
|
229
|
+
borderColor: showCustom ? 'primary.main' : 'divider',
|
|
230
230
|
borderWidth: showCustom ? 2 : 1,
|
|
231
231
|
color: showCustom ? 'primary.main' : 'text.primary',
|
|
232
232
|
}}
|
package/screenshots/checkout.png
DELETED
|
Binary file
|
package/screenshots/customer.png
DELETED
|
Binary file
|
package/screenshots/payment.png
DELETED
|
Binary file
|
package/screenshots/setting.png
DELETED
|
Binary file
|
|
Binary file
|