mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(connector): unified errorCode and errorMessage map error reason as errorMessage in Stripe Connector (#1797)
Co-authored-by: Sahkal Poddar <sahkal.poddar@juspay.in> Co-authored-by: swangi-kumari <swangi.12015941@lpu.in>
This commit is contained in:
@ -202,12 +202,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,12 +320,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,12 +434,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -553,12 +556,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -684,12 +688,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -829,12 +834,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -939,12 +945,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1068,12 +1075,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1176,12 +1184,13 @@ impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::Ref
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1270,12 +1279,13 @@ impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::Refun
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1405,12 +1415,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1498,12 +1509,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1614,12 +1626,13 @@ impl
|
|||||||
code: response
|
code: response
|
||||||
.error
|
.error
|
||||||
.code
|
.code
|
||||||
|
.clone()
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
|
||||||
message: response
|
message: response
|
||||||
.error
|
.error
|
||||||
.message
|
.code
|
||||||
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
.unwrap_or_else(|| consts::NO_ERROR_MESSAGE.to_string()),
|
||||||
reason: None,
|
reason: response.error.message,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2037,8 +2037,8 @@ impl<F, T>
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|error| types::ErrorResponse {
|
.map(|error| types::ErrorResponse {
|
||||||
code: error.code.to_owned(),
|
code: error.code.to_owned(),
|
||||||
message: error.message.to_owned(),
|
message: error.code.to_owned(),
|
||||||
reason: None,
|
reason: Some(error.message.to_owned()),
|
||||||
status_code: item.http_code,
|
status_code: item.http_code,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -54,8 +54,7 @@ async fn should_fail_recurring_payment_due_to_authentication(
|
|||||||
Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_
|
Event::Assert(Assert::IsPresent("man_")),// mandate id starting with man_
|
||||||
Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),
|
Event::Trigger(Trigger::Click(By::Css("#pm-mandate-btn a"))),
|
||||||
Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
|
Event::Trigger(Trigger::Click(By::Id("card-submit-btn"))),
|
||||||
Event::Assert(Assert::IsPresent("authentication_required: Your card was declined. This transaction requires authentication.")),
|
Event::Assert(Assert::IsPresent("authentication_required: authentication_required")),
|
||||||
|
|
||||||
]).await?;
|
]).await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user