24 lines
756 B
Python
24 lines
756 B
Python
from pydantic import BaseModel, constr, condecimal
|
|
from typing import Optional
|
|
|
|
class PaymentCreateSchema(BaseModel):
|
|
amount: condecimal(gt=0) # Amount must be greater than 0
|
|
currency: constr(min_length=3, max_length=3) # Currency code must be 3 characters
|
|
description: str
|
|
return_url: str
|
|
capture: bool = True
|
|
metadata: Optional[dict] = None
|
|
|
|
class PaymentResponseSchema(BaseModel):
|
|
id: str
|
|
status: str
|
|
confirmation_url: str
|
|
|
|
class PaymentStatusSchema(BaseModel):
|
|
id: str
|
|
status: str
|
|
amount: condecimal(gt=0)
|
|
currency: constr(min_length=3, max_length=3) # Currency code must be 3 characters
|
|
description: str
|
|
created_at: str # ISO format date string
|
|
confirmation_url: Optional[str] = None |