payment-kit 1.13.22 → 1.13.24
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/integrations/stripe/handlers/invoice.ts +129 -101
- package/api/src/jobs/event.ts +27 -13
- package/api/src/jobs/invoice.ts +8 -8
- package/api/src/jobs/payment.ts +1 -1
- package/api/src/jobs/subscription.ts +1 -1
- package/api/src/jobs/webhook.ts +26 -19
- package/api/src/libs/audit.ts +3 -3
- package/api/src/libs/event.ts +3 -0
- package/api/src/libs/util.ts +5 -0
- package/api/src/routes/connect/pay.ts +1 -1
- package/api/src/routes/subscriptions.ts +15 -0
- package/api/src/store/models/types.ts +1 -0
- package/blocklet.yml +2 -2
- package/package.json +4 -3
- package/src/components/actions.tsx +4 -10
- package/src/components/blockchain/tx.tsx +38 -9
- package/src/components/click-boundary.tsx +7 -0
- package/src/components/confirm.tsx +2 -18
- package/src/components/customer/actions.tsx +3 -2
- package/src/components/invoice/action.tsx +3 -2
- package/src/components/payment-intent/actions.tsx +4 -3
- package/src/components/payment-intent/list.tsx +2 -2
- package/src/components/payment-link/actions.tsx +22 -10
- package/src/components/payment-link/item.tsx +18 -15
- package/src/components/payment-method/stripe.tsx +7 -4
- package/src/components/price/actions.tsx +9 -6
- package/src/components/price/form.tsx +4 -1
- package/src/components/product/actions.tsx +3 -2
- package/src/components/subscription/actions/index.tsx +3 -2
- package/src/components/subscription/items/actions.tsx +17 -14
- package/src/libs/util.ts +21 -5
- package/src/locales/en.tsx +6 -0
- package/src/pages/admin/billing/subscriptions/detail.tsx +1 -1
- package/src/pages/admin/payments/intents/detail.tsx +1 -6
- package/src/pages/admin/products/products/create.tsx +8 -4
- package/src/pages/admin/settings/payment-methods/create.tsx +3 -0
|
@@ -34,7 +34,7 @@ export default function ProductsCreate() {
|
|
|
34
34
|
metadata: [],
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
|
-
const { control, handleSubmit } = methods;
|
|
37
|
+
const { control, handleSubmit, getValues } = methods;
|
|
38
38
|
|
|
39
39
|
const prices = useFieldArray({ control, name: 'prices' });
|
|
40
40
|
const getPrice = (index: number) => methods.getValues().prices[index];
|
|
@@ -79,10 +79,14 @@ export default function ProductsCreate() {
|
|
|
79
79
|
expanded
|
|
80
80
|
style={{ fontWeight: 'bold', width: '50%' }}
|
|
81
81
|
addons={<PriceActions onDuplicate={() => prices.append(price)} onRemove={() => prices.remove(index)} />}
|
|
82
|
-
trigger={(expanded: boolean) =>
|
|
82
|
+
trigger={(expanded: boolean) => {
|
|
83
|
+
if (expanded) {
|
|
84
|
+
return t('admin.price.detail');
|
|
85
|
+
}
|
|
86
|
+
|
|
83
87
|
// @ts-ignore
|
|
84
|
-
|
|
85
|
-
}>
|
|
88
|
+
return formatPrice(getPrice(index), settings.baseCurrency, getValues().unit_label, 1, false);
|
|
89
|
+
}}>
|
|
86
90
|
<PriceForm prefix={`prices.${index}`} />
|
|
87
91
|
</Collapse>
|
|
88
92
|
<Divider sx={{ mt: 2, mb: 4 }} />
|
|
@@ -9,11 +9,13 @@ import { dispatch } from 'use-bus';
|
|
|
9
9
|
|
|
10
10
|
import DrawerForm from '../../../../components/drawer-form';
|
|
11
11
|
import PaymentMethodForm from '../../../../components/payment-method/form';
|
|
12
|
+
import { useSettingsContext } from '../../../../contexts/settings';
|
|
12
13
|
import api from '../../../../libs/api';
|
|
13
14
|
import { formatError } from '../../../../libs/util';
|
|
14
15
|
|
|
15
16
|
export default function PaymentMethodCreate() {
|
|
16
17
|
const { t } = useLocaleContext();
|
|
18
|
+
const settings = useSettingsContext();
|
|
17
19
|
|
|
18
20
|
const methods = useForm<TPaymentMethod>({
|
|
19
21
|
defaultValues: {
|
|
@@ -27,6 +29,7 @@ export default function PaymentMethodCreate() {
|
|
|
27
29
|
explorer_host: '',
|
|
28
30
|
},
|
|
29
31
|
stripe: {
|
|
32
|
+
dashboard: settings.livemode ? 'https://dashboard.stripe.com' : 'https://dashboard.stripe.com/test',
|
|
30
33
|
publishable_key: '',
|
|
31
34
|
secret_key: '',
|
|
32
35
|
},
|