Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(router): fail refund with bad request error for duplicate refund_id in refunds create flow #5282

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
8 changes: 1 addition & 7 deletions crates/router/src/core/refunds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,13 +836,7 @@ pub async fn validate_and_create_refund(
}
Err(err) => {
if err.current_context().is_db_unique_violation() {
db.find_refund_by_merchant_id_refund_id(
merchant_account.merchant_id.as_str(),
refund_id.as_str(),
merchant_account.storage_scheme,
)
.await
.to_not_found_response(errors::ApiErrorResponse::RefundNotFound)?
Err(errors::ApiErrorResponse::DuplicateRefundRequest)?
} else {
return Err(err)
.change_context(errors::ApiErrorResponse::RefundNotFound)
Expand Down
Loading