mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
fix(router): fail refund with bad request error for duplicate refund_id in refunds create flow (#5282)
This commit is contained in:
committed by
GitHub
parent
68adda036d
commit
f63a678d71
@ -836,13 +836,7 @@ pub async fn validate_and_create_refund(
|
|||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
if err.current_context().is_db_unique_violation() {
|
if err.current_context().is_db_unique_violation() {
|
||||||
db.find_refund_by_merchant_id_refund_id(
|
Err(errors::ApiErrorResponse::DuplicateRefundRequest)?
|
||||||
merchant_account.merchant_id.as_str(),
|
|
||||||
refund_id.as_str(),
|
|
||||||
merchant_account.storage_scheme,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.to_not_found_response(errors::ApiErrorResponse::RefundNotFound)?
|
|
||||||
} else {
|
} else {
|
||||||
return Err(err)
|
return Err(err)
|
||||||
.change_context(errors::ApiErrorResponse::RefundNotFound)
|
.change_context(errors::ApiErrorResponse::RefundNotFound)
|
||||||
|
|||||||
Reference in New Issue
Block a user