mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
refactor(router): throw bad request error on applepay verification failure (#2607)
This commit is contained in:
@ -449,7 +449,7 @@ where
|
||||
headers.extend(
|
||||
external_latency
|
||||
.map(|latency| vec![(X_HS_LATENCY.to_string(), latency.to_string())])
|
||||
.unwrap_or(vec![]),
|
||||
.unwrap_or_default(),
|
||||
);
|
||||
}
|
||||
let output = Ok(match payment_request {
|
||||
|
||||
@ -85,7 +85,7 @@ pub async fn verify_merchant_creds_for_applepay(
|
||||
response.change_context(api_error_response::ApiErrorResponse::InternalServerError)?;
|
||||
|
||||
// Error is already logged
|
||||
Ok(match applepay_response {
|
||||
match applepay_response {
|
||||
Ok(_) => {
|
||||
utils::check_existence_and_add_domain_to_db(
|
||||
&state,
|
||||
@ -95,17 +95,20 @@ pub async fn verify_merchant_creds_for_applepay(
|
||||
)
|
||||
.await
|
||||
.change_context(api_error_response::ApiErrorResponse::InternalServerError)?;
|
||||
services::api::ApplicationResponse::Json(ApplepayMerchantResponse {
|
||||
status_message: "Applepay verification Completed".to_string(),
|
||||
})
|
||||
Ok(services::api::ApplicationResponse::Json(
|
||||
ApplepayMerchantResponse {
|
||||
status_message: "Applepay verification Completed".to_string(),
|
||||
},
|
||||
))
|
||||
}
|
||||
Err(error) => {
|
||||
logger::error!(?error);
|
||||
services::api::ApplicationResponse::Json(ApplepayMerchantResponse {
|
||||
status_message: "Applepay verification Failed".to_string(),
|
||||
})
|
||||
Err(api_error_response::ApiErrorResponse::InvalidRequestData {
|
||||
message: "Applepay verification Failed".to_string(),
|
||||
}
|
||||
.into())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_verified_apple_domains_with_mid_mca_id(
|
||||
|
||||
Reference in New Issue
Block a user