Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(refunds): add success RefundStatus in should_call_refund check (#2081)

Kritik Modi9cae5de5ffa2
diff --git a/crates/router/src/connector/bluesnap/transformers.rs b/crates/router/src/connector/bluesnap/transformers.rs
index 32455794e3..e38a4c9342 100644
--- a/crates/router/src/connector/bluesnap/transformers.rs
+++ b/crates/router/src/connector/bluesnap/transformers.rs
@@ -939,7 +939,7 @@ impl From<ErrorDetails> for utils::ErrorCodeAndMessage {
fn from(error: ErrorDetails) -> Self {
Self {
error_code: error.code.to_string(),
- error_message: error.error_name.unwrap_or(error.code.to_string()),
+ error_message: error.error_name.unwrap_or(error.code),
}
}
}
diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs
index ac755cfc13..11ed8faa6f 100644
--- a/crates/router/src/core/refunds.rs
+++ b/crates/router/src/core/refunds.rs
@@ -356,6 +356,7 @@ fn should_call_refund(refund: &diesel_models::refund::Refund, force_sync: bool)
|| !matches!(
refund.refund_status,
diesel_models::enums::RefundStatus::Failure
+ | diesel_models::enums::RefundStatus::Success
);
predicate1 && predicate2