mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
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:
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user