29 lines
758 B
Python
29 lines
758 B
Python
from __future__ import annotations
|
|
from uuid import UUID
|
|
from pydantic import BaseModel, Field
|
|
|
|
class CheckoutOrderRequest(BaseModel):
|
|
cart_item_codes: list[str] = Field(min_length=1)
|
|
coupon_code: str | None = None
|
|
currency: str = "INR"
|
|
|
|
class CheckoutOrderResponse(BaseModel):
|
|
razorpay_order_id: str
|
|
amount: float
|
|
currency: str
|
|
receipt: str
|
|
base_subtotal: float
|
|
total_discounts: float
|
|
convenience_fee: float = 0.0
|
|
convenience_fee_rate: float = 0.0
|
|
taxable_amount: float
|
|
gst_amount: float
|
|
grand_total: float
|
|
|
|
class CheckoutVerifyRequest(BaseModel):
|
|
razorpay_order_id: str
|
|
razorpay_payment_id: str
|
|
razorpay_signature: str
|
|
billing_profile_id: UUID | None = None
|
|
currency: str = "INR"
|