mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
refactor(payments): attempt to address unintended 5xx and 4xx in payments (#1376)
This commit is contained in:
committed by
GitHub
parent
71c0d4c500
commit
cf64862dac
@ -26,6 +26,7 @@ use self::{
|
||||
helpers::authenticate_client_secret,
|
||||
operations::{payment_complete_authorize, BoxedOperation, Operation},
|
||||
};
|
||||
use super::errors::StorageErrorExt;
|
||||
use crate::{
|
||||
configs::settings::PaymentMethodTypeTokenFilter,
|
||||
core::{
|
||||
@ -104,7 +105,7 @@ where
|
||||
validate_result.merchant_id,
|
||||
)
|
||||
.await
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.to_not_found_response(errors::ApiErrorResponse::CustomerNotFound)
|
||||
.attach_printable("Failed while fetching/creating customer")?;
|
||||
|
||||
let connector = get_connector_choice(
|
||||
@ -1090,7 +1091,7 @@ pub async fn list_payments(
|
||||
) -> RouterResponse<api::PaymentListResponse> {
|
||||
use futures::stream::StreamExt;
|
||||
|
||||
use crate::{core::errors::utils::StorageErrorExt, types::transformers::ForeignFrom};
|
||||
use crate::types::transformers::ForeignFrom;
|
||||
|
||||
helpers::validate_payment_list_request(&constraints)?;
|
||||
let merchant_id = &merchant.merchant_id;
|
||||
|
||||
Reference in New Issue
Block a user