This commit is contained in:
2026-05-22 22:57:05 +03:00
parent 61c50eecc1
commit aa25c6dec5
7 changed files with 82 additions and 31 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/index.html vendored
View File

@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ЭКСА — Ваш мост в мир цифровых активов</title> <title>ЭКСА — Ваш мост в мир цифровых активов</title>
<script type="module" crossorigin src="/assets/index-CqflMUD0.js"></script> <script type="module" crossorigin src="/assets/index-BSmqh004.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D6a7E682.css"> <link rel="stylesheet" crossorigin href="/assets/index-CbqAOC8U.css">
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>

View File

@@ -108,7 +108,17 @@ export function createOrder(payload: CreateOrderPayload): Promise<OrderResult> {
}, true) }, true)
} }
export type OrderStatus = 'pending' | 'completed' | 'cancelled' | 'failed' export type OrderStatus = 'pending' | 'rejected' | 'completed' | 'cancelled' | 'error'
export type PaymentStatus =
| 'pending'
| 'money_accepted'
| 'web3_processing'
| 'web3_hash_error'
| 'web3_balance_problem'
| 'receipt_error'
| 'completed'
| 'usdt_delivered'
export interface Order { export interface Order {
id: string id: string
@@ -140,7 +150,7 @@ export interface Payment {
updated_at: string updated_at: string
user_id: string user_id: string
order_id: string order_id: string
status: OrderStatus status: PaymentStatus
receipt_cloudekassir_id: string receipt_cloudekassir_id: string
receipt_cloudekassir_link: string receipt_cloudekassir_link: string
itpay_payment_id: string itpay_payment_id: string

View File

@@ -3,4 +3,4 @@ export { usePaymentQuote } from './hooks/usePaymentQuote'
export { usePaymentQuoteByRub } from './hooks/usePaymentQuoteByRub' export { usePaymentQuoteByRub } from './hooks/usePaymentQuoteByRub'
export { useCreateOrder } from './hooks/useCreateOrder' export { useCreateOrder } from './hooks/useCreateOrder'
export { useOrders } from './hooks/useOrders' export { useOrders } from './hooks/useOrders'
export type { PaymentConfig, PaymentQuote, CreateOrderPayload, OrderResult, Order, Payment, OrderWithPayment, OrderStatus } from './api/paymentApi' export type { PaymentConfig, PaymentQuote, CreateOrderPayload, OrderResult, Order, Payment, OrderWithPayment, OrderStatus, PaymentStatus } from './api/paymentApi'

View File

@@ -120,15 +120,51 @@
} }
.status_cancelled { .status_cancelled {
background: rgba(138, 138, 154, 0.18);
color: #a0a0b0;
}
.status_rejected {
background: rgba(255, 77, 77, 0.15); background: rgba(255, 77, 77, 0.15);
color: #ff4d4d; color: #ff4d4d;
} }
.status_failed { .status_error {
background: rgba(255, 140, 66, 0.15);
color: #ff8c42;
}
/* payment statuses */
.status_money_accepted {
background: rgba(74, 109, 255, 0.15);
color: #4a6dff;
}
.status_web3_processing {
background: rgba(155, 109, 255, 0.15);
color: #9b6dff;
}
.status_web3_hash_error {
background: rgba(255, 77, 77, 0.15); background: rgba(255, 77, 77, 0.15);
color: #ff4d4d; color: #ff4d4d;
} }
.status_web3_balance_problem {
background: rgba(255, 140, 66, 0.15);
color: #ff8c42;
}
.status_receipt_error {
background: rgba(255, 77, 77, 0.15);
color: #ff4d4d;
}
.status_usdt_delivered {
background: rgba(0, 196, 140, 0.15);
color: var(--success, #00c48c);
}
/* ── Accordion item ── */ /* ── Accordion item ── */
.accordionItem { .accordionItem {
background: rgba(255, 255, 255, 0.04); background: rgba(255, 255, 255, 0.04);

View File

@@ -2,21 +2,26 @@ import { useState } from 'react'
import { WalletHeader } from '@widgets/wallet-header' import { WalletHeader } from '@widgets/wallet-header'
import { Footer } from '@widgets/footer' import { Footer } from '@widgets/footer'
import { useOrders } from '@features/payment' import { useOrders } from '@features/payment'
import type { OrderWithPayment, OrderStatus } from '@features/payment' import type { OrderWithPayment, OrderStatus, PaymentStatus } from '@features/payment'
import styles from './TransactionsPage.module.css' import styles from './TransactionsPage.module.css'
const ORDER_STATUS_LABELS: Record<OrderStatus, string> = { const ORDER_STATUS_LABELS: Record<OrderStatus, string> = {
pending: 'Ожидание', pending: 'Ожидание',
completed: 'Выполнена', rejected: 'Отклонён',
cancelled: 'Отменена', completed: 'Выполнен',
failed: 'Ошибка', cancelled: 'Отменён',
error: 'Ошибка',
} }
const PAYMENT_STATUS_LABELS: Record<OrderStatus, string> = { const PAYMENT_STATUS_LABELS: Record<PaymentStatus, string> = {
pending: 'Ожидание', pending: 'Ожидание',
completed: 'Оплачен', money_accepted: 'Деньги получены',
cancelled: 'Отменён', web3_processing: 'Обработка в сети',
failed: 'Ошибка', web3_hash_error: 'Ошибка хэша',
web3_balance_problem: 'Проблема с балансом',
receipt_error: 'Ошибка чека',
completed: 'Завершён',
usdt_delivered: 'USDT отправлен',
} }
function formatDate(iso: string) { function formatDate(iso: string) {
@@ -36,9 +41,9 @@ function truncateHash(hash: string) {
return `${hash.slice(0, 8)}${hash.slice(-6)}` return `${hash.slice(0, 8)}${hash.slice(-6)}`
} }
function StatusBadge({ status, labels }: { status: OrderStatus; labels: Record<OrderStatus, string> }) { function StatusBadge({ status, labels }: { status: string; labels: Record<string, string> }) {
return ( return (
<span className={`${styles.statusBadge} ${styles[`status_${status}`]}`}> <span className={`${styles.statusBadge} ${styles[`status_${status}`] ?? ''}`}>
{labels[status] ?? status} {labels[status] ?? status}
</span> </span>
) )