mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
feat(router): send 2xx payments response for all the connector http responses (2xx, 4xx etc.) (#1924)
This commit is contained in:
committed by
GitHub
parent
35963e279a
commit
0ab6827f6c
@ -71,6 +71,28 @@ where
|
||||
),
|
||||
}
|
||||
}
|
||||
Ok(api::ApplicationResponse::JsonWithHeaders((response, headers))) => {
|
||||
let response = S::try_from(response);
|
||||
match response {
|
||||
Ok(response) => match serde_json::to_string(&response) {
|
||||
Ok(res) => api::http_response_json_with_headers(res, headers),
|
||||
Err(_) => api::http_response_err(
|
||||
r#"{
|
||||
"error": {
|
||||
"message": "Error serializing response from connector"
|
||||
}
|
||||
}"#,
|
||||
),
|
||||
},
|
||||
Err(_) => api::http_response_err(
|
||||
r#"{
|
||||
"error": {
|
||||
"message": "Error converting juspay response to stripe response"
|
||||
}
|
||||
}"#,
|
||||
),
|
||||
}
|
||||
}
|
||||
Ok(api::ApplicationResponse::StatusOk) => api::http_response_ok(),
|
||||
Ok(api::ApplicationResponse::TextPlain(text)) => api::http_response_plaintext(text),
|
||||
Ok(api::ApplicationResponse::FileData((file_data, content_type))) => {
|
||||
|
||||
Reference in New Issue
Block a user