payment-kit 1.21.15 → 1.21.17
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/index.ts +2 -0
- package/api/src/integrations/stripe/handlers/invoice.ts +30 -25
- package/api/src/integrations/stripe/handlers/setup-intent.ts +231 -0
- package/api/src/integrations/stripe/handlers/subscription.ts +31 -9
- package/api/src/integrations/stripe/resource.ts +29 -0
- package/api/src/libs/payment.ts +9 -3
- package/api/src/libs/util.ts +17 -0
- package/api/src/queues/vendors/return-processor.ts +52 -75
- package/api/src/queues/vendors/return-scanner.ts +38 -3
- package/api/src/routes/connect/change-payer.ts +148 -0
- package/api/src/routes/connect/shared.ts +30 -0
- package/api/src/routes/invoices.ts +141 -2
- package/api/src/routes/payment-links.ts +2 -1
- package/api/src/routes/subscriptions.ts +130 -3
- package/api/src/routes/vendor.ts +100 -72
- package/api/src/store/models/checkout-session.ts +1 -0
- package/blocklet.yml +1 -1
- package/package.json +6 -6
- package/src/components/invoice-pdf/template.tsx +30 -0
- package/src/components/subscription/payment-method-info.tsx +222 -0
- package/src/global.css +4 -0
- package/src/locales/en.tsx +13 -0
- package/src/locales/zh.tsx +13 -0
- package/src/pages/admin/billing/invoices/detail.tsx +5 -3
- package/src/pages/admin/billing/subscriptions/detail.tsx +16 -0
- package/src/pages/admin/overview.tsx +14 -14
- package/src/pages/admin/products/vendors/create.tsx +6 -40
- package/src/pages/admin/products/vendors/index.tsx +5 -1
- package/src/pages/customer/invoice/detail.tsx +59 -17
- package/src/pages/customer/subscription/detail.tsx +20 -1
|
@@ -52,6 +52,7 @@ import { useSessionContext } from '../../../contexts/session';
|
|
|
52
52
|
import { usePendingAmountForSubscription, useUnpaidInvoicesCheckForSubscription } from '../../../hooks/subscription';
|
|
53
53
|
import { formatSmartDuration, TimeUnit } from '../../../libs/dayjs';
|
|
54
54
|
import { canChangePaymentMethod } from '../../../libs/util';
|
|
55
|
+
import PaymentMethodInfo from '../../../components/subscription/payment-method-info';
|
|
55
56
|
|
|
56
57
|
const fetchData = (id: string | undefined): Promise<TSubscriptionExpanded> => {
|
|
57
58
|
return api.get(`/api/subscriptions/${id}`).then((res) => res.data);
|
|
@@ -622,7 +623,7 @@ export default function CustomerSubscriptionDetail() {
|
|
|
622
623
|
{canChangePaymentMethod(data) && (
|
|
623
624
|
<Button
|
|
624
625
|
variant="text"
|
|
625
|
-
sx={{ color: 'text.link'
|
|
626
|
+
sx={{ color: 'text.link' }}
|
|
626
627
|
size="small"
|
|
627
628
|
onClick={async () => {
|
|
628
629
|
// only check unpaid invoices when overdraft protection is enabled
|
|
@@ -640,6 +641,24 @@ export default function CustomerSubscriptionDetail() {
|
|
|
640
641
|
</Stack>
|
|
641
642
|
}
|
|
642
643
|
/>
|
|
644
|
+
{(data as any).paymentMethodDetails && (
|
|
645
|
+
<InfoRow
|
|
646
|
+
label={t('admin.subscription.payerAddress')}
|
|
647
|
+
value={
|
|
648
|
+
<PaymentMethodInfo
|
|
649
|
+
subscriptionId={id}
|
|
650
|
+
customer={data.customer}
|
|
651
|
+
paymentMethodDetails={(data as any).paymentMethodDetails}
|
|
652
|
+
editable={['active', 'trialing', 'past_due'].includes(data.status)}
|
|
653
|
+
onUpdate={() => {
|
|
654
|
+
refresh();
|
|
655
|
+
checkUnpaidInvoices();
|
|
656
|
+
}}
|
|
657
|
+
paymentMethodType={data.paymentMethod?.type}
|
|
658
|
+
/>
|
|
659
|
+
}
|
|
660
|
+
/>
|
|
661
|
+
)}
|
|
643
662
|
|
|
644
663
|
{data.payment_details && hasDelegateTxHash(data.payment_details, data.paymentMethod) && (
|
|
645
664
|
<InfoRow
|