mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
fix(core): do not construct request if it is already available (#3826)
This commit is contained in:
@ -338,30 +338,31 @@ where
|
||||
],
|
||||
);
|
||||
|
||||
let connector_request = connector_request.or(connector_integration
|
||||
.build_request(req, &state.conf.connectors)
|
||||
.map_err(|error| {
|
||||
if matches!(
|
||||
error.current_context(),
|
||||
&errors::ConnectorError::RequestEncodingFailed
|
||||
| &errors::ConnectorError::RequestEncodingFailedWithReason(_)
|
||||
) {
|
||||
metrics::REQUEST_BUILD_FAILURE.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[metrics::request::add_attributes(
|
||||
"connector",
|
||||
req.connector.to_string(),
|
||||
)],
|
||||
)
|
||||
}
|
||||
error
|
||||
})?);
|
||||
let connector_request = match connector_request {
|
||||
Some(connector_request) => Some(connector_request),
|
||||
None => connector_integration
|
||||
.build_request(req, &state.conf.connectors)
|
||||
.map_err(|error| {
|
||||
if matches!(
|
||||
error.current_context(),
|
||||
&errors::ConnectorError::RequestEncodingFailed
|
||||
| &errors::ConnectorError::RequestEncodingFailedWithReason(_)
|
||||
) {
|
||||
metrics::REQUEST_BUILD_FAILURE.add(
|
||||
&metrics::CONTEXT,
|
||||
1,
|
||||
&[metrics::request::add_attributes(
|
||||
"connector",
|
||||
req.connector.to_string(),
|
||||
)],
|
||||
)
|
||||
}
|
||||
error
|
||||
})?,
|
||||
};
|
||||
|
||||
match connector_request {
|
||||
Some(request) => {
|
||||
logger::debug!(connector_request=?request);
|
||||
|
||||
let masked_request_body = match &request.body {
|
||||
Some(request) => match request {
|
||||
RequestContent::Json(i)
|
||||
@ -1828,7 +1829,7 @@ pub fn build_redirection_form(
|
||||
|
||||
threeDSsecureInterface.on('challenge', function(e) {{
|
||||
console.log('Challenged');
|
||||
document.getElementById('loader-wrapper').style.display = 'none';
|
||||
document.getElementById('loader-wrapper').style.display = 'none';
|
||||
}});
|
||||
|
||||
threeDSsecureInterface.on('complete', function(e) {{
|
||||
|
||||
Reference in New Issue
Block a user