mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
refactor(dynamic_routing): change the response type of update gateway score api in open router (#8308)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -148,6 +148,11 @@ pub struct UpdateScorePayload {
|
|||||||
pub payment_id: id_type::PaymentId,
|
pub payment_id: id_type::PaymentId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||||
|
pub struct UpdateScoreResponse {
|
||||||
|
pub message: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
|
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
|
||||||
pub enum TxnStatus {
|
pub enum TxnStatus {
|
||||||
|
|||||||
@ -1958,11 +1958,12 @@ pub async fn update_gateway_score_with_open_router(
|
|||||||
|
|
||||||
match response {
|
match response {
|
||||||
Ok(resp) => {
|
Ok(resp) => {
|
||||||
let update_score_resp = String::from_utf8(resp.response.to_vec()).change_context(
|
let update_score_resp = resp
|
||||||
errors::RoutingError::OpenRouterError(
|
.response
|
||||||
|
.parse_struct::<or_types::UpdateScoreResponse>("UpdateScoreResponse")
|
||||||
|
.change_context(errors::RoutingError::OpenRouterError(
|
||||||
"Failed to parse the response from open_router".into(),
|
"Failed to parse the response from open_router".into(),
|
||||||
),
|
))?;
|
||||||
)?;
|
|
||||||
|
|
||||||
logger::debug!(
|
logger::debug!(
|
||||||
"open_router update_gateway_score response for gateway with id {}: {:?}",
|
"open_router update_gateway_score response for gateway with id {}: {:?}",
|
||||||
|
|||||||
Reference in New Issue
Block a user