feat(core): Add record attempt operation for revenue recovery webhooks (#7236)

Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
chikke srujan
2025-03-07 19:34:47 +05:30
committed by GitHub
parent 3cf529c4dc
commit 24aa00341f
18 changed files with 1024 additions and 63 deletions

View File

@ -569,3 +569,33 @@ impl From<api_models::payments::AmountDetails> for payments::AmountDetails {
}
}
}
#[cfg(feature = "v2")]
impl From<&api_models::payments::PaymentAttemptAmountDetails>
for payments::payment_attempt::AttemptAmountDetailsSetter
{
fn from(amount: &api_models::payments::PaymentAttemptAmountDetails) -> Self {
Self {
net_amount: amount.net_amount,
amount_to_capture: amount.amount_to_capture,
surcharge_amount: amount.surcharge_amount,
tax_on_surcharge: amount.tax_on_surcharge,
amount_capturable: amount.amount_capturable,
shipping_cost: amount.shipping_cost,
order_tax_amount: amount.order_tax_amount,
}
}
}
#[cfg(feature = "v2")]
impl From<&api_models::payments::RecordAttemptErrorDetails>
for payments::payment_attempt::ErrorDetails
{
fn from(error: &api_models::payments::RecordAttemptErrorDetails) -> Self {
Self {
code: error.code.clone(),
message: error.message.clone(),
reason: Some(error.message.clone()),
unified_code: None,
unified_message: None,
}
}
}