Files
Airwallex/airwallex-sdk/airwallex/models/financial_transaction.py
zqq61 4f53889a8e feat: Airwallex 发卡管理后台完整实现
- 后端: FastAPI + SQLAlchemy + SQLite, JWT认证, 代理支持的AirwallexClient
- 前端: React 18 + Vite + Ant Design 5, 中文界面
- 功能: 卡片管理, 持卡人管理, 交易记录, API令牌, 系统设置, 审计日志
- 第三方API: X-API-Key认证, 权限控制
- Docker部署: docker-compose编排前后端
2026-03-15 23:05:08 +08:00

30 lines
1.8 KiB
Python

"""
Models for the Airwallex financial transaction API.
"""
from typing import Optional
from datetime import datetime
from pydantic import Field
from .base import AirwallexModel
class FinancialTransaction(AirwallexModel):
"""Model for an Airwallex financial transaction."""
resource_name: str = "financial_transactions"
id: str = Field(..., description="ID of the transaction")
amount: float = Field(..., description="Gross amount of the transaction")
net: float = Field(..., description="Net amount of the transaction")
fee: float = Field(..., description="Fee paid for the transaction")
currency: str = Field(..., description="Currency of the transaction (3-letter ISO-4217 code)")
status: str = Field(..., description="Status of the transaction (PENDING, SETTLED, CANCELLED)")
description: Optional[str] = Field(None, description="Description of the transaction")
batch_id: Optional[str] = Field(None, description="Batch ID of the settlement the transaction belongs to")
client_rate: Optional[float] = Field(None, description="Client rate for the transaction")
currency_pair: Optional[str] = Field(None, description="Currency pair that the client_rate is quoted in")
source_id: Optional[str] = Field(None, description="Source ID of the transaction")
source_type: Optional[str] = Field(None, description="Type of the source transaction")
transaction_type: Optional[str] = Field(None, description="Type of the transaction")
funding_source_id: Optional[str] = Field(None, description="ID of the funding source")
created_at: datetime = Field(..., description="Transaction creation timestamp")
estimated_settled_at: Optional[datetime] = Field(None, description="Estimated settlement timestamp")
settled_at: Optional[datetime] = Field(None, description="Actual settlement timestamp")