Skip to content

Commit

Permalink
Refactor(router): addressed pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sahkal committed Jul 11, 2024
1 parent bc1ee45 commit 65972bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/hyperswitch_interfaces/src/integrity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ impl GetIntegrityObject<SyncIntegrityObject> for PaymentsSyncData {
}
}

#[inline]
fn format_mismatch(field: &str, expected: &str, found: &str) -> String {
format!("{} expected {} but found {}", field, expected, found)
}
12 changes: 10 additions & 2 deletions crates/router/src/core/payments/flows/psync_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,23 @@ impl Feature<api::PSync, types::PaymentsSyncData>
types::SyncRequestType::MultipleCaptureSync(pending_connector_capture_id_list),
Ok(services::CaptureSyncMethod::Individual),
) => {
let resp = self
let mut new_router_data = self
.execute_connector_processing_step_for_each_capture(
state,
pending_connector_capture_id_list,
call_connector_action,
connector_integration,
)
.await?;
Ok(resp)
// Initiating Integrity checks
let integrity_result = helpers::check_integrity_based_on_flow(
&new_router_data.request,
&new_router_data.response,
);

new_router_data.integrity_check = integrity_result;

Ok(new_router_data)
}
(types::SyncRequestType::MultipleCaptureSync(_), Err(err)) => Err(err),
_ => {
Expand Down

0 comments on commit 65972bb

Please sign in to comment.