refactor(process_tracker): Integrate proxy_payments api to process tracker workflow (#7480)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Amisha Prabhat
2025-03-17 10:20:14 +05:30
committed by GitHub
parent 8c85c9c000
commit ba3ad87e06
9 changed files with 296 additions and 79 deletions

View File

@ -573,6 +573,24 @@ impl From<api_models::payments::AmountDetails> for payments::AmountDetails {
}
}
}
#[cfg(feature = "v2")]
impl From<payments::AmountDetails> for api_models::payments::AmountDetailsSetter {
fn from(amount_details: payments::AmountDetails) -> Self {
Self {
order_amount: amount_details.order_amount.into(),
currency: amount_details.currency,
shipping_cost: amount_details.shipping_cost,
order_tax_amount: amount_details
.tax_details
.and_then(|tax_detail| tax_detail.get_default_tax_amount()),
skip_external_tax_calculation: amount_details.skip_external_tax_calculation,
skip_surcharge_calculation: amount_details.skip_surcharge_calculation,
surcharge_amount: amount_details.surcharge_amount,
tax_on_surcharge: amount_details.tax_on_surcharge,
}
}
}
#[cfg(feature = "v2")]
impl From<&api_models::payments::PaymentAttemptAmountDetails>
for payments::payment_attempt::AttemptAmountDetailsSetter