mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +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(
|
headers.extend(
|
||||||
external_latency
|
external_latency
|
||||||
.map(|latency| vec![(X_HS_LATENCY.to_string(), latency.to_string())])
|
.map(|latency| vec![(X_HS_LATENCY.to_string(), latency.to_string())])
|
||||||
.unwrap_or(vec![]),
|
.unwrap_or_default(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let output = Ok(match payment_request {
|
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)?;
|
response.change_context(api_error_response::ApiErrorResponse::InternalServerError)?;
|
||||||
|
|
||||||
// Error is already logged
|
// Error is already logged
|
||||||
Ok(match applepay_response {
|
match applepay_response {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
utils::check_existence_and_add_domain_to_db(
|
utils::check_existence_and_add_domain_to_db(
|
||||||
&state,
|
&state,
|
||||||
@ -95,17 +95,20 @@ pub async fn verify_merchant_creds_for_applepay(
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.change_context(api_error_response::ApiErrorResponse::InternalServerError)?;
|
.change_context(api_error_response::ApiErrorResponse::InternalServerError)?;
|
||||||
services::api::ApplicationResponse::Json(ApplepayMerchantResponse {
|
Ok(services::api::ApplicationResponse::Json(
|
||||||
status_message: "Applepay verification Completed".to_string(),
|
ApplepayMerchantResponse {
|
||||||
})
|
status_message: "Applepay verification Completed".to_string(),
|
||||||
|
},
|
||||||
|
))
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
logger::error!(?error);
|
logger::error!(?error);
|
||||||
services::api::ApplicationResponse::Json(ApplepayMerchantResponse {
|
Err(api_error_response::ApiErrorResponse::InvalidRequestData {
|
||||||
status_message: "Applepay verification Failed".to_string(),
|
message: "Applepay verification Failed".to_string(),
|
||||||
})
|
}
|
||||||
|
.into())
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_verified_apple_domains_with_mid_mca_id(
|
pub async fn get_verified_apple_domains_with_mid_mca_id(
|
||||||
|
|||||||
Reference in New Issue
Block a user