Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/api_models/src/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ pub struct RefundResponse {
/// The connector used for the refund and the corresponding payment
#[schema(example = "stripe")]
pub connector: String,
/// The id of business profile for this refund
pub profile_id: Option<String>,
/// The merchant_connector_id of the processor through which this payment went through
pub merchant_connector_id: Option<String>,
}

#[derive(Debug, Clone, Eq, PartialEq, Deserialize, Serialize, ToSchema)]
Expand Down
2 changes: 2 additions & 0 deletions crates/router/src/core/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ pub async fn validate_and_create_refund(
.set_attempt_id(payment_attempt.attempt_id.clone())
.set_refund_reason(req.reason)
.set_profile_id(payment_intent.profile_id.clone())
.set_merchant_connector_id(payment_attempt.merchant_connector_id.clone())
.to_owned();

let refund = match db
Expand Down Expand Up @@ -776,6 +777,7 @@ impl ForeignFrom<storage::Refund> for api::RefundResponse {
created_at: Some(refund.created_at),
updated_at: Some(refund.updated_at),
connector: refund.connector,
merchant_connector_id: refund.merchant_connector_id,
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions openapi/openapi_spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11674,6 +11674,12 @@
},
"profile_id": {
"type": "string",
"description": "The id of business profile for this refund",
"nullable": true
},
"merchant_connector_id": {
"type": "string",
"description": "The merchant_connector_id of the processor through which this payment went through",
"nullable": true
}
}
Expand Down