refactor(core): update response for PaymentsDynamicTaxCalculationResponse (#5909)

This commit is contained in:
Swangi Kumari
2024-09-16 19:37:43 +05:30
committed by GitHub
parent 00a7865576
commit 45c19a1729
6 changed files with 140 additions and 4 deletions

View File

@ -4627,6 +4627,21 @@ pub struct PaymentsDynamicTaxCalculationResponse {
pub order_tax_amount: Option<MinorUnit>,
/// shipping cost for the order
pub shipping_cost: Option<MinorUnit>,
/// amount in Base Unit display format
pub display_amount: DisplayAmountOnSdk,
}
#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, ToSchema)]
pub struct DisplayAmountOnSdk {
/// net amount = amount + order_tax_amount + shipping_cost
#[schema(value_type = String)]
pub net_amount: StringMajorUnit,
/// order tax amount calculated by tax connectors
#[schema(value_type = String)]
pub order_tax_amount: Option<StringMajorUnit>,
/// shipping cost for the order
#[schema(value_type = String)]
pub shipping_cost: Option<StringMajorUnit>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]