mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
fix(update_trackers): handle preprocessing steps status update (#1496)
Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in>
This commit is contained in:
@ -553,13 +553,15 @@ where
|
||||
payment_data.sessions_token.push(session_token);
|
||||
};
|
||||
|
||||
let connector_request = if should_continue_further {
|
||||
// In case of authorize flow, pre-task and post-tasks are being called in build request
|
||||
// if we do not want to proceed further, then the function will return Ok(None, false)
|
||||
let (connector_request, should_continue_further) = if should_continue_further {
|
||||
// Check if the actual flow specific request can be built with available data
|
||||
router_data
|
||||
.build_flow_specific_connector_request(state, &connector, call_connector_action.clone())
|
||||
.await?
|
||||
} else {
|
||||
None
|
||||
(None, false)
|
||||
};
|
||||
|
||||
// Update the payment trackers just before calling the connector
|
||||
@ -576,11 +578,12 @@ where
|
||||
)
|
||||
.await?;
|
||||
|
||||
// The status of payment_attempt and intent will be updated in the previous step
|
||||
// This field will be used by the connector
|
||||
router_data.status = payment_data.payment_attempt.status;
|
||||
|
||||
let router_data_res = if should_continue_further {
|
||||
// The status of payment_attempt and intent will be updated in the previous step
|
||||
// update this in router_data.
|
||||
// This is added because few connector integrations do not update the status,
|
||||
// and rely on previous status set in router_data
|
||||
router_data.status = payment_data.payment_attempt.status;
|
||||
router_data
|
||||
.decide_flows(
|
||||
state,
|
||||
|
||||
Reference in New Issue
Block a user