fix(update_trackers): handle preprocessing steps status update (#1496)

Co-authored-by: Sangamesh <sangamesh.kulkarni@juspay.in>
This commit is contained in:
Narayan Bhat
2023-06-22 09:22:09 +05:30
committed by GitHub
parent 424e77c912
commit b45231468d
9 changed files with 58 additions and 39 deletions

View File

@ -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,