fix(connector): [ADYEN] Pass through split refund data when payment charges are unavailable (#11473)

This commit is contained in:
DEEPANSHU BANSAL
2026-03-11 10:34:35 +05:30
committed by GitHub
parent ebf11ae4c4
commit 1ac0a801bb
2 changed files with 15 additions and 14 deletions

View File

@@ -743,7 +743,21 @@ pub fn get_split_refunds(
Ok(None)
}
}
_ => Ok(None),
// If charges data is unavailable, pass through merchant-provided split refund data without validation
_ => {
if let Some(common_types::refunds::SplitRefund::AdyenSplitRefund(
split_refund_request,
)) = split_refund_input.refund_request.clone()
{
Ok(Some(
router_request_types::SplitRefundsRequest::AdyenSplitRefund(
split_refund_request,
),
))
} else {
Ok(None)
}
}
}
}
Some(common_types::payments::SplitPaymentsRequest::XenditSplitPayment(_)) => {

View File

@@ -237,19 +237,6 @@ pub fn validate_adyen_charge_refund(
.find(|payment_split_item| refund_split_reference == payment_split_item.reference);
if let Some(payment_split_item) = matching_payment_split_item {
if let Some((refund_amount, payment_amount)) =
refund_split_item.amount.zip(payment_split_item.amount)
{
if refund_amount > payment_amount {
return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
message: format!(
"Invalid refund amount for split item, reference: {refund_split_reference}",
),
}));
}
}
if let Some((refund_account, payment_account)) = refund_split_item
.account
.as_ref()