diff --git a/apps/admin/app/dashboard/payment/alipayf2f.tsx b/apps/admin/app/dashboard/payment/alipayf2f.tsx deleted file mode 100644 index 51c5849..0000000 --- a/apps/admin/app/dashboard/payment/alipayf2f.tsx +++ /dev/null @@ -1,256 +0,0 @@ -'use client'; - -import { getAlipayF2FPaymentConfig, updateAlipayF2FPaymentConfig } from '@/services/admin/payment'; -import { useQuery } from '@tanstack/react-query'; -import { Label } from '@workspace/ui/components/label'; -import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectTrigger, - SelectValue, -} from '@workspace/ui/components/select'; -import { Switch } from '@workspace/ui/components/switch'; -import { Table, TableBody, TableCell, TableRow } from '@workspace/ui/components/table'; -import { Textarea } from '@workspace/ui/components/textarea'; -import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input'; -import { unitConversion } from '@workspace/ui/utils'; -import { useTranslations } from 'next-intl'; -import { toast } from 'sonner'; - -export default function AlipayF2F() { - const t = useTranslations('payment'); - - const { data, refetch } = useQuery({ - queryKey: ['getAlipayF2FPaymentConfig'], - queryFn: async () => { - const { data } = await getAlipayF2FPaymentConfig(); - - return data.data; - }, - }); - - async function updateConfig(key: string, value: unknown) { - if (data?.[key] === value) return; - try { - await updateAlipayF2FPaymentConfig({ - ...data, - [key]: value, - } as API.UpdateAlipayF2fRequest); - toast.success(t('saveSuccess')); - refetch(); - } catch (error) { - /* empty */ - } - } - - return ( - - - - - -

{t('enableDescription')}

-
- - { - updateConfig('enable', checked); - }} - /> - -
- - - -

{t('alipayf2f.sandboxDescription')}

-
- - { - updateConfig('config', { - ...data?.config, - sandbox: checked, - }); - }} - /> - -
- - - -

{t('showNameDescription')}

-
- - updateConfig('name', value)} - /> - -
- - - -

{t('iconUrlDescription')}

-
- - updateConfig('icon', value)} - /> - -
- - - -

{t('notifyUrlDescription')}

-
- - updateConfig('domain', value)} - /> - -
- - - -

{t('feeModeDescription')}

-
- - - -
- - - -

{t('feePercentDescription')}

-
- - updateConfig('fee_percent', value)} - suffix='%' - /> - -
- - - -

{t('fixedFeeDescription')}

-
- - unitConversion('centsToDollars', value)} - formatOutput={(value) => unitConversion('dollarsToCents', value)} - onValueBlur={(value) => updateConfig('fee_amount', value)} - /> - -
- - - -

- - - - updateConfig('config', { - ...data?.config, - app_id: value, - }) - } - /> - - - - - -

- - -