🐛 fix(payment): Update payment information
This commit is contained in:
parent
5c710e1add
commit
70d6a38a29
@ -30,6 +30,7 @@ import {
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
} from '@workspace/ui/components/sheet';
|
||||
import { MarkdownEditor } from '@workspace/ui/custom-components/editor';
|
||||
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
||||
import { Icon } from '@workspace/ui/custom-components/icon';
|
||||
import { unitConversion } from '@workspace/ui/utils';
|
||||
@ -75,6 +76,7 @@ export default function PaymentForm<T>({
|
||||
fee_mode: z.coerce.number().min(0).max(2),
|
||||
fee_percent: z.coerce.number().optional(),
|
||||
fee_amount: z.coerce.number().optional(),
|
||||
description: z.string().optional(),
|
||||
});
|
||||
|
||||
const form = useForm<z.infer<typeof formSchema>>({
|
||||
@ -376,6 +378,23 @@ export default function PaymentForm<T>({
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name='description'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('description')}</FormLabel>
|
||||
<FormControl>
|
||||
<MarkdownEditor
|
||||
value={field.value}
|
||||
onChange={(value) => form.setValue(field.name, value as string)}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
@ -63,6 +63,7 @@ export const useGlobalStore = create<GlobalStore>((set) => ({
|
||||
verify_code_interval: 60,
|
||||
},
|
||||
oauth_methods: [],
|
||||
web_ad: false,
|
||||
},
|
||||
user: undefined,
|
||||
setCommon: (common) =>
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Smazat",
|
||||
"deleteSuccess": "Úspěšně smazáno",
|
||||
"deleteWarning": "Opravdu chcete smazat tuto platební metodu? Tuto akci nelze vrátit zpět.",
|
||||
"description": "Popis",
|
||||
"descriptionPlaceholder": "Zadejte popis platební metody",
|
||||
"domain": "Doména",
|
||||
"domainPlaceholder": "volitelné, např. {example}",
|
||||
"edit": "Upravit",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Löschen",
|
||||
"deleteSuccess": "Erfolgreich gelöscht",
|
||||
"deleteWarning": "Sind Sie sicher, dass Sie diese Zahlungsmethode löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||
"description": "Beschreibung",
|
||||
"descriptionPlaceholder": "Geben Sie die Beschreibung der Zahlungsmethode ein",
|
||||
"domain": "Domain",
|
||||
"domainPlaceholder": "optional, z.B. {example}",
|
||||
"edit": "Bearbeiten",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Delete",
|
||||
"deleteSuccess": "Deleted successfully",
|
||||
"deleteWarning": "Are you sure you want to delete this payment method? This action cannot be undone.",
|
||||
"description": "Description",
|
||||
"descriptionPlaceholder": "Enter payment method description",
|
||||
"domain": "Domain",
|
||||
"domainPlaceholder": "optional, e.g. {example}",
|
||||
"edit": "Edit",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Eliminar",
|
||||
"deleteSuccess": "Eliminado con éxito",
|
||||
"deleteWarning": "¿Está seguro de que desea eliminar este método de pago? Esta acción no se puede deshacer.",
|
||||
"description": "Descripción",
|
||||
"descriptionPlaceholder": "Ingrese la descripción del método de pago",
|
||||
"domain": "Dominio",
|
||||
"domainPlaceholder": "opcional, p. ej. {example}",
|
||||
"edit": "Editar",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Eliminar",
|
||||
"deleteSuccess": "Eliminado con éxito",
|
||||
"deleteWarning": "¿Está seguro de que desea eliminar este método de pago? Esta acción no se puede deshacer.",
|
||||
"description": "Descripción",
|
||||
"descriptionPlaceholder": "Ingresa la descripción del método de pago",
|
||||
"domain": "Dominio",
|
||||
"domainPlaceholder": "opcional, p. ej. {example}",
|
||||
"edit": "Editar",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "حذف",
|
||||
"deleteSuccess": "با موفقیت حذف شد",
|
||||
"deleteWarning": "آیا مطمئن هستید که میخواهید این روش پرداخت را حذف کنید؟ این عمل قابل بازگشت نیست.",
|
||||
"description": "توضیحات",
|
||||
"descriptionPlaceholder": "توضیحات روش پرداخت را وارد کنید",
|
||||
"domain": "دامنه",
|
||||
"domainPlaceholder": "اختیاری، به عنوان مثال {example}",
|
||||
"edit": "ویرایش",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Poista",
|
||||
"deleteSuccess": "Poisto onnistui",
|
||||
"deleteWarning": "Oletko varma, että haluat poistaa tämän maksutavan? Tätä toimintoa ei voi peruuttaa.",
|
||||
"description": "Kuvaus",
|
||||
"descriptionPlaceholder": "Syötä maksutavan kuvaus",
|
||||
"domain": "Verkkotunnus",
|
||||
"domainPlaceholder": "valinnainen, esim. {esimerkki}",
|
||||
"edit": "Muokkaa",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Supprimer",
|
||||
"deleteSuccess": "Supprimé avec succès",
|
||||
"deleteWarning": "Êtes-vous sûr de vouloir supprimer ce mode de paiement ? Cette action ne peut pas être annulée.",
|
||||
"description": "Description",
|
||||
"descriptionPlaceholder": "Entrez la description du mode de paiement",
|
||||
"domain": "Domaine",
|
||||
"domainPlaceholder": "facultatif, par exemple {exemple}",
|
||||
"edit": "Modifier",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "हटाएं",
|
||||
"deleteSuccess": "सफलता से हटाया गया",
|
||||
"deleteWarning": "क्या आप वास्तव में इस भुगतान विधि को हटाना चाहते हैं? यह क्रिया पूर्ववत नहीं की जा सकती।",
|
||||
"description": "विवरण",
|
||||
"descriptionPlaceholder": "भुगतान विधि का विवरण दर्ज करें",
|
||||
"domain": "डोमेन",
|
||||
"domainPlaceholder": "वैकल्पिक, जैसे कि {example}",
|
||||
"edit": "संपादित करें",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Törlés",
|
||||
"deleteSuccess": "Sikeresen törölve",
|
||||
"deleteWarning": "Biztosan törölni szeretné ezt a fizetési módot? Ez a művelet nem vonható vissza.",
|
||||
"description": "Leírás",
|
||||
"descriptionPlaceholder": "Írja be a fizetési mód leírását",
|
||||
"domain": "Domain",
|
||||
"domainPlaceholder": "opcionális, pl. {példa}",
|
||||
"edit": "Szerkesztés",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "削除",
|
||||
"deleteSuccess": "削除成功",
|
||||
"deleteWarning": "この支払い方法を削除してもよろしいですか?この操作は元に戻せません。",
|
||||
"description": "説明",
|
||||
"descriptionPlaceholder": "支払い方法の説明を入力してください",
|
||||
"domain": "ドメイン",
|
||||
"domainPlaceholder": "任意、例:{example}",
|
||||
"edit": "編集",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "삭제",
|
||||
"deleteSuccess": "삭제 성공",
|
||||
"deleteWarning": "이 결제 수단을 삭제하시겠습니까? 이 작업은 취소할 수 없습니다.",
|
||||
"description": "설명",
|
||||
"descriptionPlaceholder": "결제 수단 설명을 입력하세요",
|
||||
"domain": "도메인",
|
||||
"domainPlaceholder": "선택 사항, 예: {example}",
|
||||
"edit": "편집",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Slett",
|
||||
"deleteSuccess": "Slettet med suksess",
|
||||
"deleteWarning": "Er du sikker på at du vil slette denne betalingsmetoden? Denne handlingen kan ikke angres.",
|
||||
"description": "Beskrivelse",
|
||||
"descriptionPlaceholder": "Skriv inn beskrivelse av betalingsmetode",
|
||||
"domain": "Domene",
|
||||
"domainPlaceholder": "valgfritt, f.eks. {example}",
|
||||
"edit": "Rediger",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Usuń",
|
||||
"deleteSuccess": "Usunięto pomyślnie",
|
||||
"deleteWarning": "Czy na pewno chcesz usunąć tę metodę płatności? Ta akcja jest nieodwracalna.",
|
||||
"description": "Opis",
|
||||
"descriptionPlaceholder": "Wprowadź opis metody płatności",
|
||||
"domain": "Domena",
|
||||
"domainPlaceholder": "opcjonalnie, np. {example}",
|
||||
"edit": "Edytuj",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Excluir",
|
||||
"deleteSuccess": "Excluído com sucesso",
|
||||
"deleteWarning": "Você tem certeza de que deseja excluir este método de pagamento? Esta ação não pode ser desfeita.",
|
||||
"description": "Descrição",
|
||||
"descriptionPlaceholder": "Insira a descrição do método de pagamento",
|
||||
"domain": "Domínio",
|
||||
"domainPlaceholder": "opcional, por exemplo, {exemplo}",
|
||||
"edit": "Editar",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Șterge",
|
||||
"deleteSuccess": "Șters cu succes",
|
||||
"deleteWarning": "Ești sigur că vrei să ștergi această metodă de plată? Această acțiune nu poate fi anulată.",
|
||||
"description": "Descriere",
|
||||
"descriptionPlaceholder": "Introduceți descrierea metodei de plată",
|
||||
"domain": "Domeniu",
|
||||
"domainPlaceholder": "opțional, de exemplu {example}",
|
||||
"edit": "Editează",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Удалить",
|
||||
"deleteSuccess": "Успешно удалено",
|
||||
"deleteWarning": "Вы уверены, что хотите удалить этот способ оплаты? Это действие нельзя отменить.",
|
||||
"description": "Описание",
|
||||
"descriptionPlaceholder": "Введите описание метода оплаты",
|
||||
"domain": "Домен",
|
||||
"domainPlaceholder": "необязательно, например, {example}",
|
||||
"edit": "Редактировать",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "ลบ",
|
||||
"deleteSuccess": "ลบสำเร็จ",
|
||||
"deleteWarning": "คุณแน่ใจหรือไม่ว่าต้องการลบวิธีการชำระเงินนี้? การกระทำนี้ไม่สามารถย้อนกลับได้",
|
||||
"description": "คำอธิบาย",
|
||||
"descriptionPlaceholder": "กรอกคำอธิบายวิธีการชำระเงิน",
|
||||
"domain": "โดเมน",
|
||||
"domainPlaceholder": "ไม่บังคับ เช่น {example}",
|
||||
"edit": "แก้ไข",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Sil",
|
||||
"deleteSuccess": "Başarıyla silindi",
|
||||
"deleteWarning": "Bu ödeme yöntemini silmek istediğinize emin misiniz? Bu işlem geri alınamaz.",
|
||||
"description": "Açıklama",
|
||||
"descriptionPlaceholder": "Ödeme yöntemi açıklamasını girin",
|
||||
"domain": "Alan Adı",
|
||||
"domainPlaceholder": "isteğe bağlı, örn. {example}",
|
||||
"edit": "Düzenle",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Видалити",
|
||||
"deleteSuccess": "Успішно видалено",
|
||||
"deleteWarning": "Ви впевнені, що хочете видалити цей спосіб оплати? Цю дію не можна скасувати.",
|
||||
"description": "Опис",
|
||||
"descriptionPlaceholder": "Введіть опис способу оплати",
|
||||
"domain": "Домен",
|
||||
"domainPlaceholder": "необов'язково, наприклад, {example}",
|
||||
"edit": "Редагувати",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "Xóa",
|
||||
"deleteSuccess": "Xóa thành công",
|
||||
"deleteWarning": "Bạn có chắc chắn muốn xóa phương thức thanh toán này không? Hành động này không thể hoàn tác.",
|
||||
"description": "Mô tả",
|
||||
"descriptionPlaceholder": "Nhập mô tả phương thức thanh toán",
|
||||
"domain": "Miền",
|
||||
"domainPlaceholder": "tùy chọn, ví dụ: {example}",
|
||||
"edit": "Chỉnh Sửa",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "删除",
|
||||
"deleteSuccess": "删除成功",
|
||||
"deleteWarning": "您确定要删除此支付方式吗?此操作无法撤销。",
|
||||
"description": "描述",
|
||||
"descriptionPlaceholder": "输入支付方式描述",
|
||||
"domain": "域名",
|
||||
"domainPlaceholder": "可选,例如 {example}",
|
||||
"edit": "编辑",
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
"delete": "刪除",
|
||||
"deleteSuccess": "刪除成功",
|
||||
"deleteWarning": "您確定要刪除此付款方式嗎?此操作無法撤銷。",
|
||||
"description": "描述",
|
||||
"descriptionPlaceholder": "輸入付款方式描述",
|
||||
"domain": "域名",
|
||||
"domainPlaceholder": "可選,例如 {example}",
|
||||
"edit": "編輯",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// @ts-ignore
|
||||
|
||||
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as ads from './ads';
|
||||
|
||||
5
apps/admin/services/admin/typings.d.ts
vendored
5
apps/admin/services/admin/typings.d.ts
vendored
@ -233,6 +233,7 @@ declare namespace API {
|
||||
type CreatePaymentMethodRequest = {
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
@ -964,6 +965,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
@ -974,6 +976,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
@ -987,6 +990,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
domain: string;
|
||||
config: Record<string, any>;
|
||||
@ -1524,6 +1528,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// @ts-ignore
|
||||
|
||||
|
||||
// API 更新时间:
|
||||
// API 唯一标识:
|
||||
import * as auth from './auth';
|
||||
|
||||
3
apps/admin/services/common/typings.d.ts
vendored
3
apps/admin/services/common/typings.d.ts
vendored
@ -364,6 +364,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
@ -374,6 +375,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
@ -387,6 +389,7 @@ declare namespace API {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
domain: string;
|
||||
config: Record<string, any>;
|
||||
|
||||
@ -25,7 +25,7 @@ export default function Content({ subscription }: { subscription?: API.Subscribe
|
||||
const [params, setParams] = useState<API.PortalPurchaseRequest>({
|
||||
quantity: 1,
|
||||
subscribe_id: 0,
|
||||
payment: '',
|
||||
payment: -1,
|
||||
coupon: '',
|
||||
platform: 'email',
|
||||
identifier: '',
|
||||
|
||||
@ -27,11 +27,7 @@ const DurationSelector: React.FC<DurationSelectorProps> = ({
|
||||
[onChange],
|
||||
);
|
||||
|
||||
const DurationOption: React.FC<{ value: string; label: string; discount?: number }> = ({
|
||||
value,
|
||||
label,
|
||||
discount,
|
||||
}) => (
|
||||
const DurationOption: React.FC<{ value: string; label: string }> = ({ value, label }) => (
|
||||
<div className='relative'>
|
||||
<RadioGroupItem value={value} id={value} className='peer sr-only' />
|
||||
<Label
|
||||
@ -39,11 +35,14 @@ const DurationSelector: React.FC<DurationSelectorProps> = ({
|
||||
className='border-muted bg-popover hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary relative flex h-full flex-col items-center justify-center gap-2 rounded-md border-2 p-2'
|
||||
>
|
||||
{label}
|
||||
{discount && <Badge variant='destructive'>-{discount}%</Badge>}
|
||||
</Label>
|
||||
</div>
|
||||
);
|
||||
|
||||
// 查找当前选中项的折扣信息
|
||||
const currentDiscount = discounts.find((item) => item.quantity === quantity)?.discount;
|
||||
const discountPercentage = currentDiscount ? 100 - currentDiscount : 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className='font-semibold'>{t('purchaseDuration')}</div>
|
||||
@ -58,10 +57,19 @@ const DurationSelector: React.FC<DurationSelectorProps> = ({
|
||||
key={item.quantity}
|
||||
value={String(item.quantity)}
|
||||
label={`${item.quantity} / ${t(unitTime)}`}
|
||||
discount={100 - item.discount}
|
||||
/>
|
||||
))}
|
||||
</RadioGroup>
|
||||
<div className='flex items-center justify-between'>
|
||||
<span className='text-muted-foreground text-sm'>{t('discountInfo')}:</span>
|
||||
{discountPercentage > 0 ? (
|
||||
<Badge variant='destructive' className='h-6 text-sm'>
|
||||
-{discountPercentage}% {t('discount')}
|
||||
</Badge>
|
||||
) : (
|
||||
<span className='text-muted-foreground h-6 text-sm'>--</span>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { getAvailablePaymentMethods } from '@/services/user/portal';
|
||||
// import { getAvailablePaymentMethods } from '@/services/user/payment';
|
||||
// import { getAvailablePaymentMethods } from '@/services/user/payment';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Label } from '@workspace/ui/components/label';
|
||||
import { RadioGroup, RadioGroupItem } from '@workspace/ui/components/radio-group';
|
||||
@ -11,8 +9,8 @@ import Image from 'next/image';
|
||||
import React, { memo } from 'react';
|
||||
|
||||
interface PaymentMethodsProps {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
value: number;
|
||||
onChange: (value: number) => void;
|
||||
balance?: boolean;
|
||||
}
|
||||
|
||||
@ -24,9 +22,9 @@ const PaymentMethods: React.FC<PaymentMethodsProps> = ({ value, onChange, balanc
|
||||
queryFn: async () => {
|
||||
const { data } = await getAvailablePaymentMethods();
|
||||
const methods = data.data?.list || [];
|
||||
if (!value && methods[0]?.mark) onChange(methods[0]?.mark);
|
||||
if (!value && methods[0]?.id) onChange(methods[0]?.id);
|
||||
if (balance) return methods;
|
||||
return methods.filter((item) => item.mark !== 'balance');
|
||||
return methods.filter((item) => item.id !== -1);
|
||||
},
|
||||
});
|
||||
return (
|
||||
@ -34,26 +32,26 @@ const PaymentMethods: React.FC<PaymentMethodsProps> = ({ value, onChange, balanc
|
||||
<div className='font-semibold'>{t('paymentMethod')}</div>
|
||||
<RadioGroup
|
||||
className='grid grid-cols-2 gap-2 md:grid-cols-5'
|
||||
value={value}
|
||||
onValueChange={onChange}
|
||||
value={String(value)}
|
||||
onValueChange={(val) => onChange(Number(val))}
|
||||
>
|
||||
{data?.map((item) => (
|
||||
<div key={item.mark}>
|
||||
<RadioGroupItem value={item.mark} id={item.mark} className='peer sr-only' />
|
||||
<div key={item.id}>
|
||||
<RadioGroupItem value={String(item.id)} id={String(item.id)} className='peer sr-only' />
|
||||
<Label
|
||||
htmlFor={item.mark}
|
||||
htmlFor={String(item.id)}
|
||||
className='border-muted bg-popover hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary flex flex-col items-center justify-between rounded-md border-2 py-2'
|
||||
>
|
||||
<div className='mb-3 size-12'>
|
||||
<Image
|
||||
src={item.icon || `/payment/${item.mark}.svg`}
|
||||
src={item.icon || `/payment/balance.svg`}
|
||||
width={48}
|
||||
height={48}
|
||||
alt={item.name || t(`methods.${item.mark}`)}
|
||||
alt={item.name}
|
||||
/>
|
||||
</div>
|
||||
<span className='w-full overflow-hidden text-ellipsis whitespace-nowrap text-center'>
|
||||
{item.name || t(`methods.${item.mark}`)}
|
||||
{item.name}
|
||||
</span>
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
@ -29,7 +29,7 @@ export default function Purchase({ subscribe, setSubscribe }: Readonly<PurchaseP
|
||||
const [params, setParams] = useState<Partial<API.PurchaseOrderRequest>>({
|
||||
quantity: 1,
|
||||
subscribe_id: 0,
|
||||
payment: 'balance',
|
||||
payment: -1,
|
||||
coupon: '',
|
||||
});
|
||||
const [loading, startTransition] = useTransition();
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
|
||||
import useGlobalStore from '@/config/use-global';
|
||||
import { recharge } from '@/services/user/order';
|
||||
import { getAvailablePaymentMethods } from '@/services/user/payment';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Button, ButtonProps } from '@workspace/ui/components/button';
|
||||
import {
|
||||
Dialog,
|
||||
@ -13,15 +11,13 @@ import {
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from '@workspace/ui/components/dialog';
|
||||
import { Label } from '@workspace/ui/components/label';
|
||||
import { RadioGroup, RadioGroupItem } from '@workspace/ui/components/radio-group';
|
||||
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
|
||||
import { unitConversion } from '@workspace/ui/utils';
|
||||
import { LoaderCircle } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import Image from 'next/image';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useEffect, useState, useTransition } from 'react';
|
||||
import { useState, useTransition } from 'react';
|
||||
import PaymentMethods from './payment-methods';
|
||||
|
||||
export default function Recharge(props: Readonly<ButtonProps>) {
|
||||
const t = useTranslations('subscribe');
|
||||
@ -34,27 +30,9 @@ export default function Recharge(props: Readonly<ButtonProps>) {
|
||||
|
||||
const [params, setParams] = useState<API.RechargeOrderRequest>({
|
||||
amount: 0,
|
||||
payment: '',
|
||||
payment: 1,
|
||||
});
|
||||
|
||||
const { data: paymentMethods } = useQuery({
|
||||
enabled: open,
|
||||
queryKey: ['getAvailablePaymentMethods'],
|
||||
queryFn: async () => {
|
||||
const { data } = await getAvailablePaymentMethods();
|
||||
return data.data?.list || [];
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (paymentMethods?.length) {
|
||||
setParams((prev) => ({
|
||||
...prev,
|
||||
payment: paymentMethods.find((item) => item.mark !== 'balance')?.mark as string,
|
||||
}));
|
||||
}
|
||||
}, [paymentMethods]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger asChild>
|
||||
@ -86,43 +64,10 @@ export default function Recharge(props: Readonly<ButtonProps>) {
|
||||
suffix={currency.currency_unit}
|
||||
/>
|
||||
</div>
|
||||
<div className='font-semibold'>{t('paymentMethod')}</div>
|
||||
<RadioGroup
|
||||
className='grid grid-cols-5 gap-2'
|
||||
<PaymentMethods
|
||||
value={params.payment}
|
||||
onValueChange={(value) => {
|
||||
setParams({
|
||||
...params,
|
||||
payment: value,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{paymentMethods
|
||||
?.filter((item) => item.mark !== 'balance')
|
||||
?.map((item) => {
|
||||
return (
|
||||
<div key={item.mark}>
|
||||
<RadioGroupItem value={item.mark} id={item.mark} className='peer sr-only' />
|
||||
<Label
|
||||
htmlFor={item.mark}
|
||||
className='border-muted bg-popover hover:bg-accent hover:text-accent-foreground peer-data-[state=checked]:border-primary [&:has([data-state=checked])]:border-primary flex flex-col items-center justify-between rounded-md border-2 py-2'
|
||||
>
|
||||
<div className='mb-3 size-12'>
|
||||
<Image
|
||||
src={item.icon || `/payment/${item.mark}.svg`}
|
||||
width={48}
|
||||
height={48}
|
||||
alt={item.name!}
|
||||
/>
|
||||
</div>
|
||||
<span className='w-full overflow-hidden text-ellipsis whitespace-nowrap text-center'>
|
||||
{item.name || t(`methods.${item.mark}`)}
|
||||
</span>
|
||||
</Label>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</RadioGroup>
|
||||
onChange={(value) => setParams({ ...params, payment: value })}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
className='fixed bottom-0 left-0 w-full rounded-none md:relative md:mt-6'
|
||||
|
||||
@ -35,7 +35,7 @@ export default function Renewal({ id, subscribe }: Readonly<RenewalProps>) {
|
||||
const router = useRouter();
|
||||
const [params, setParams] = useState<Partial<API.RenewalOrderRequest>>({
|
||||
quantity: 1,
|
||||
payment: 'balance',
|
||||
payment: -1,
|
||||
coupon: '',
|
||||
user_subscribe_id: id,
|
||||
});
|
||||
|
||||
@ -28,7 +28,7 @@ export default function ResetTraffic({ id, replacement }: Readonly<ResetTrafficP
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
const router = useRouter();
|
||||
const [params, setParams] = useState<API.ResetTrafficOrderRequest>({
|
||||
payment: 'balance',
|
||||
payment: -1,
|
||||
user_subscribe_id: id,
|
||||
});
|
||||
const [loading, startTransition] = useTransition();
|
||||
|
||||
@ -69,6 +69,7 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
||||
verify_code_interval: 60,
|
||||
},
|
||||
oauth_methods: [],
|
||||
web_ad: false,
|
||||
},
|
||||
user: undefined,
|
||||
setCommon: (common) =>
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Rychlost připojení",
|
||||
"productDetail": "Detaily produktu"
|
||||
},
|
||||
"discount": "Sleva",
|
||||
"discountInfo": "Informace o slevě",
|
||||
"enterAmount": "Zadejte částku dobití",
|
||||
"enterCoupon": "Zadejte kód kupónu",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Verbindungsgeschwindigkeit",
|
||||
"productDetail": "Produktdetails"
|
||||
},
|
||||
"discount": "Rabatt",
|
||||
"discountInfo": "Rabattinformationen",
|
||||
"enterAmount": "Geben Sie den Aufladebetrag ein",
|
||||
"enterCoupon": "Gutscheincode eingeben",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Connection Speed",
|
||||
"productDetail": "Product Details"
|
||||
},
|
||||
"discount": "Discount",
|
||||
"discountInfo": "Discount Info",
|
||||
"enterAmount": "Enter recharge amount",
|
||||
"enterCoupon": "Enter Coupon Code",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Velocidad de conexión",
|
||||
"productDetail": "Detalles del producto"
|
||||
},
|
||||
"discount": "Descuento",
|
||||
"discountInfo": "Información del Descuento",
|
||||
"enterAmount": "Ingrese el monto de recarga",
|
||||
"enterCoupon": "Introduce el código de cupón",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Velocidad de conexión",
|
||||
"productDetail": "Detalles del producto"
|
||||
},
|
||||
"discount": "Descuento",
|
||||
"discountInfo": "Información del Descuento",
|
||||
"enterAmount": "Ingresa el monto de recarga",
|
||||
"enterCoupon": "Ingresa el código de cupón",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "سرعت اتصال",
|
||||
"productDetail": "جزئیات محصول"
|
||||
},
|
||||
"discount": "تخفیف",
|
||||
"discountInfo": "اطلاعات تخفیف",
|
||||
"enterAmount": "مبلغ شارژ را وارد کنید",
|
||||
"enterCoupon": "کد تخفیف را وارد کنید",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Yhteysnopeus",
|
||||
"productDetail": "Tuotteen tiedot"
|
||||
},
|
||||
"discount": "Alennus",
|
||||
"discountInfo": "Alennustiedot",
|
||||
"enterAmount": "Syötä latausmäärä",
|
||||
"enterCoupon": "Syötä alennuskoodi",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Vitesse de connexion",
|
||||
"productDetail": "Détails du produit"
|
||||
},
|
||||
"discount": "Remise",
|
||||
"discountInfo": "Informations sur la remise",
|
||||
"enterAmount": "Entrez le montant de la recharge",
|
||||
"enterCoupon": "Entrez le code promo",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "कनेक्शन गति",
|
||||
"productDetail": "उत्पाद विवरण"
|
||||
},
|
||||
"discount": "छूट",
|
||||
"discountInfo": "छूट जानकारी",
|
||||
"enterAmount": "रिचार्ज राशि दर्ज करें",
|
||||
"enterCoupon": "कूपन कोड दर्ज करें",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Kapcsolati sebesség",
|
||||
"productDetail": "Termék részletei"
|
||||
},
|
||||
"discount": "Kedvezmény",
|
||||
"discountInfo": "Kedvezmény Információ",
|
||||
"enterAmount": "Adja meg a feltöltési összeget",
|
||||
"enterCoupon": "Adja meg a kuponkódot",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "接続速度",
|
||||
"productDetail": "商品詳細"
|
||||
},
|
||||
"discount": "割引",
|
||||
"discountInfo": "割引情報",
|
||||
"enterAmount": "リチャージ金額を入力してください",
|
||||
"enterCoupon": "クーポンコードを入力",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "연결 속도",
|
||||
"productDetail": "제품 세부 정보"
|
||||
},
|
||||
"discount": "할인",
|
||||
"discountInfo": "할인 정보",
|
||||
"enterAmount": "충전 금액을 입력하세요",
|
||||
"enterCoupon": "쿠폰 코드 입력",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Tilkoblingshastighet",
|
||||
"productDetail": "Produktdetaljer"
|
||||
},
|
||||
"discount": "Rabatt",
|
||||
"discountInfo": "Rabattinformasjon",
|
||||
"enterAmount": "Skriv inn påfyllingsbeløp",
|
||||
"enterCoupon": "Skriv inn kupongkode",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Prędkość połączenia",
|
||||
"productDetail": "Szczegóły produktu"
|
||||
},
|
||||
"discount": "Zniżka",
|
||||
"discountInfo": "Informacje o zniżce",
|
||||
"enterAmount": "Wprowadź kwotę doładowania",
|
||||
"enterCoupon": "Wprowadź kod kuponu",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Velocidade de conexão",
|
||||
"productDetail": "Detalhes do produto"
|
||||
},
|
||||
"discount": "Desconto",
|
||||
"discountInfo": "Informações sobre o Desconto",
|
||||
"enterAmount": "Digite o valor da recarga",
|
||||
"enterCoupon": "Insira o Código do Cupom",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Viteza de conectare",
|
||||
"productDetail": "Detalii produs"
|
||||
},
|
||||
"discount": "Reducere",
|
||||
"discountInfo": "Informații despre reducere",
|
||||
"enterAmount": "Introduceți suma de reîncărcare",
|
||||
"enterCoupon": "Introduceți codul cuponului",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Скорость соединения",
|
||||
"productDetail": "Детали продукта"
|
||||
},
|
||||
"discount": "Скидка",
|
||||
"discountInfo": "Информация о скидке",
|
||||
"enterAmount": "Введите сумму пополнения",
|
||||
"enterCoupon": "Введите промокод",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "ความเร็วในการเชื่อมต่อ",
|
||||
"productDetail": "รายละเอียดสินค้า"
|
||||
},
|
||||
"discount": "ส่วนลด",
|
||||
"discountInfo": "ข้อมูลส่วนลด",
|
||||
"enterAmount": "กรอกจำนวนเงินที่ต้องการเติม",
|
||||
"enterCoupon": "กรอกรหัสคูปอง",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Bağlantı Hızı",
|
||||
"productDetail": "Ürün Detayları"
|
||||
},
|
||||
"discount": "İndirim",
|
||||
"discountInfo": "İndirim Bilgisi",
|
||||
"enterAmount": "Yükleme tutarını girin",
|
||||
"enterCoupon": "Kupon Kodunu Girin",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Швидкість з'єднання",
|
||||
"productDetail": "Деталі товару"
|
||||
},
|
||||
"discount": "Знижка",
|
||||
"discountInfo": "Інформація про знижку",
|
||||
"enterAmount": "Введіть суму поповнення",
|
||||
"enterCoupon": "Введіть код купона",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "Tốc độ kết nối",
|
||||
"productDetail": "Chi tiết sản phẩm"
|
||||
},
|
||||
"discount": "Giảm giá",
|
||||
"discountInfo": "Thông tin giảm giá",
|
||||
"enterAmount": "Nhập số tiền nạp",
|
||||
"enterCoupon": "Nhập Mã Phiếu Giảm Giá",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "连接速度",
|
||||
"productDetail": "商品详情"
|
||||
},
|
||||
"discount": "折扣",
|
||||
"discountInfo": "折扣信息",
|
||||
"enterAmount": "输入充值金额",
|
||||
"enterCoupon": "输入优惠券代码",
|
||||
"methods": {
|
||||
|
||||
@ -27,6 +27,8 @@
|
||||
"connectionSpeed": "連接速度",
|
||||
"productDetail": "商品詳情"
|
||||
},
|
||||
"discount": "折扣",
|
||||
"discountInfo": "折扣資訊",
|
||||
"enterAmount": "輸入充值金額",
|
||||
"enterCoupon": "輸入優惠券代碼",
|
||||
"methods": {
|
||||
|
||||
@ -2,6 +2,21 @@
|
||||
/* eslint-disable */
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** Get Ads GET /v1/common/ads */
|
||||
export async function getAds(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.GetAdsParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.GetAdsResponse }>('/v1/common/ads', {
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Get Tos Content GET /v1/common/application */
|
||||
export async function getApplication(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.GetAppcationResponse }>('/v1/common/application', {
|
||||
|
||||
71
apps/user/services/common/typings.d.ts
vendored
71
apps/user/services/common/typings.d.ts
vendored
@ -13,6 +13,10 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type AlipayNotifyResponse = {
|
||||
return_code: string;
|
||||
};
|
||||
|
||||
type Announcement = {
|
||||
id: number;
|
||||
title: string;
|
||||
@ -149,6 +153,19 @@ declare namespace API {
|
||||
domain_suffix_list: string;
|
||||
};
|
||||
|
||||
type EPayNotifyRequest = {
|
||||
pid: number;
|
||||
trade_no: string;
|
||||
out_trade_no: string;
|
||||
type: string;
|
||||
name: string;
|
||||
money: string;
|
||||
trade_status: string;
|
||||
param: string;
|
||||
sign: string;
|
||||
sign_type: string;
|
||||
};
|
||||
|
||||
type Follow = {
|
||||
id: number;
|
||||
ticket_id: number;
|
||||
@ -158,6 +175,20 @@ declare namespace API {
|
||||
created_at: number;
|
||||
};
|
||||
|
||||
type GetAdsParams = {
|
||||
device: string;
|
||||
position: string;
|
||||
};
|
||||
|
||||
type GetAdsRequest = {
|
||||
device: string;
|
||||
position: string;
|
||||
};
|
||||
|
||||
type GetAdsResponse = {
|
||||
list: Ads[];
|
||||
};
|
||||
|
||||
type GetAppcationResponse = {
|
||||
config: ApplicationConfig;
|
||||
applications: ApplicationResponseInfo[];
|
||||
@ -176,6 +207,7 @@ declare namespace API {
|
||||
subscribe: SubscribeConfig;
|
||||
verify_code: PubilcVerifyCodeConfig;
|
||||
oauth_methods: string[];
|
||||
web_ad: boolean;
|
||||
};
|
||||
|
||||
type GetStatResponse = {
|
||||
@ -331,7 +363,8 @@ declare namespace API {
|
||||
type PaymenMethod = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
@ -341,7 +374,8 @@ declare namespace API {
|
||||
type PaymentConfig = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
@ -351,6 +385,31 @@ declare namespace API {
|
||||
enable: boolean;
|
||||
};
|
||||
|
||||
type PaymentMethodDetail = {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
domain: string;
|
||||
config: Record<string, any>;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
fee_amount: number;
|
||||
enable: boolean;
|
||||
notify_url: string;
|
||||
};
|
||||
|
||||
type PlatformInfo = {
|
||||
platform: string;
|
||||
platform_url: string;
|
||||
platform_field_description: Record<string, any>;
|
||||
};
|
||||
|
||||
type PlatformResponse = {
|
||||
list: PlatformInfo[];
|
||||
};
|
||||
|
||||
type PreOrderResponse = {
|
||||
price: number;
|
||||
amount: number;
|
||||
@ -383,7 +442,7 @@ declare namespace API {
|
||||
type PurchaseOrderRequest = {
|
||||
subscribe_id: number;
|
||||
quantity: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
coupon?: string;
|
||||
};
|
||||
|
||||
@ -443,7 +502,7 @@ declare namespace API {
|
||||
|
||||
type RechargeOrderRequest = {
|
||||
amount: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
};
|
||||
|
||||
type RechargeOrderResponse = {
|
||||
@ -464,7 +523,7 @@ declare namespace API {
|
||||
type RenewalOrderRequest = {
|
||||
user_subscribe_id: number;
|
||||
quantity: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
coupon?: string;
|
||||
};
|
||||
|
||||
@ -481,7 +540,7 @@ declare namespace API {
|
||||
|
||||
type ResetTrafficOrderRequest = {
|
||||
user_subscribe_id: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
};
|
||||
|
||||
type ResetTrafficOrderResponse = {
|
||||
|
||||
60
apps/user/services/user/typings.d.ts
vendored
60
apps/user/services/user/typings.d.ts
vendored
@ -13,6 +13,10 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type AlipayNotifyResponse = {
|
||||
return_code: string;
|
||||
};
|
||||
|
||||
type Announcement = {
|
||||
id: number;
|
||||
title: string;
|
||||
@ -177,6 +181,19 @@ declare namespace API {
|
||||
domain_suffix_list: string;
|
||||
};
|
||||
|
||||
type EPayNotifyRequest = {
|
||||
pid: number;
|
||||
trade_no: string;
|
||||
out_trade_no: string;
|
||||
type: string;
|
||||
name: string;
|
||||
money: string;
|
||||
trade_status: string;
|
||||
param: string;
|
||||
sign: string;
|
||||
sign_type: string;
|
||||
};
|
||||
|
||||
type Follow = {
|
||||
id: number;
|
||||
ticket_id: number;
|
||||
@ -372,7 +389,8 @@ declare namespace API {
|
||||
type PaymenMethod = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
@ -382,7 +400,8 @@ declare namespace API {
|
||||
type PaymentConfig = {
|
||||
id: number;
|
||||
name: string;
|
||||
mark: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon?: string;
|
||||
domain?: string;
|
||||
config: Record<string, any>;
|
||||
@ -392,11 +411,36 @@ declare namespace API {
|
||||
enable: boolean;
|
||||
};
|
||||
|
||||
type PaymentMethodDetail = {
|
||||
id: number;
|
||||
name: string;
|
||||
platform: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
domain: string;
|
||||
config: Record<string, any>;
|
||||
fee_mode: number;
|
||||
fee_percent: number;
|
||||
fee_amount: number;
|
||||
enable: boolean;
|
||||
notify_url: string;
|
||||
};
|
||||
|
||||
type PlatformInfo = {
|
||||
platform: string;
|
||||
platform_url: string;
|
||||
platform_field_description: Record<string, any>;
|
||||
};
|
||||
|
||||
type PlatformResponse = {
|
||||
list: PlatformInfo[];
|
||||
};
|
||||
|
||||
type PortalPurchaseRequest = {
|
||||
identifier: string;
|
||||
platform: string;
|
||||
password?: string;
|
||||
payment: string;
|
||||
payment: number;
|
||||
subscribe_id: number;
|
||||
quantity: number;
|
||||
coupon?: string;
|
||||
@ -418,7 +462,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type PrePurchaseOrderRequest = {
|
||||
payment: string;
|
||||
payment: number;
|
||||
subscribe_id: number;
|
||||
quantity: number;
|
||||
coupon?: string;
|
||||
@ -463,7 +507,7 @@ declare namespace API {
|
||||
type PurchaseOrderRequest = {
|
||||
subscribe_id: number;
|
||||
quantity: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
coupon?: string;
|
||||
};
|
||||
|
||||
@ -607,7 +651,7 @@ declare namespace API {
|
||||
|
||||
type RechargeOrderRequest = {
|
||||
amount: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
};
|
||||
|
||||
type RechargeOrderResponse = {
|
||||
@ -628,7 +672,7 @@ declare namespace API {
|
||||
type RenewalOrderRequest = {
|
||||
user_subscribe_id: number;
|
||||
quantity: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
coupon?: string;
|
||||
};
|
||||
|
||||
@ -638,7 +682,7 @@ declare namespace API {
|
||||
|
||||
type ResetTrafficOrderRequest = {
|
||||
user_subscribe_id: number;
|
||||
payment: string;
|
||||
payment: number;
|
||||
};
|
||||
|
||||
type ResetTrafficOrderResponse = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user