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

feat(refunds): add connector field in refund response (#1059)

Abhishek Marrivagu3fe24b325503
diff --git a/crates/api_models/src/refunds.rs b/crates/api_models/src/refunds.rs
index cf36c9c1fe..d07e7c86b1 100644
--- a/crates/api_models/src/refunds.rs
+++ b/crates/api_models/src/refunds.rs
@@ -120,6 +120,9 @@ pub struct RefundResponse {
/// The timestamp at which refund is updated
#[serde(with = "common_utils::custom_serde::iso8601::option")]
pub updated_at: Option<PrimitiveDateTime>,
+ /// The connector used for the refund and the corresponding payment
+ #[schema(example = "stripe")]
+ pub connector: String,
}
#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
diff --git a/crates/router/src/core/refunds.rs b/crates/router/src/core/refunds.rs
index e72f4cc021..38b9511be9 100644
--- a/crates/router/src/core/refunds.rs
+++ b/crates/router/src/core/refunds.rs
@@ -669,6 +669,7 @@ impl ForeignFrom<storage::Refund> for api::RefundResponse {
error_code: refund.refund_error_code,
created_at: Some(refund.created_at),
updated_at: Some(refund.updated_at),
+ connector: refund.connector,
}
}
}