From ba8ba8ac44c5a2984a7e8894397bcba875fca42a Mon Sep 17 00:00:00 2001 From: hrithikeshvm Date: Thu, 19 Oct 2023 17:35:34 +0530 Subject: [PATCH] remove session_surcharge_metadata from PaymentData and pass in function --- crates/router/src/core/payments.rs | 7 ++++--- .../router/src/core/payments/operations/payment_approve.rs | 1 - .../router/src/core/payments/operations/payment_cancel.rs | 1 - .../router/src/core/payments/operations/payment_capture.rs | 1 - .../core/payments/operations/payment_complete_authorize.rs | 1 - .../router/src/core/payments/operations/payment_confirm.rs | 1 - .../router/src/core/payments/operations/payment_create.rs | 1 - .../core/payments/operations/payment_method_validate.rs | 1 - .../router/src/core/payments/operations/payment_reject.rs | 1 - .../router/src/core/payments/operations/payment_session.rs | 1 - .../router/src/core/payments/operations/payment_start.rs | 1 - .../router/src/core/payments/operations/payment_status.rs | 1 - .../router/src/core/payments/operations/payment_update.rs | 1 - 13 files changed, 4 insertions(+), 15 deletions(-) diff --git a/crates/router/src/core/payments.rs b/crates/router/src/core/payments.rs index 8b13c3b1dd29..20a571cd94e3 100644 --- a/crates/router/src/core/payments.rs +++ b/crates/router/src/core/payments.rs @@ -214,6 +214,7 @@ where &operation, payment_data, &customer, + None, ) .await? } @@ -791,6 +792,7 @@ where router_data_res } +#[allow(clippy::too_many_arguments)] pub async fn call_multiple_connectors_service( state: &AppState, merchant_account: &domain::MerchantAccount, @@ -799,6 +801,7 @@ pub async fn call_multiple_connectors_service( _operation: &Op, mut payment_data: PaymentData, customer: &Option, + session_surcharge_metadata: Option, ) -> RouterResult> where Op: Debug, @@ -830,8 +833,7 @@ where false, ) .await?; - payment_data.surcharge_details = payment_data - .session_surcharge_details + payment_data.surcharge_details = session_surcharge_metadata .as_ref() .and_then(|surcharge_metadata| { surcharge_metadata.surcharge_results.get( @@ -1477,7 +1479,6 @@ where pub ephemeral_key: Option, pub redirect_response: Option, pub surcharge_details: Option, - pub session_surcharge_details: Option, pub frm_message: Option, pub payment_link_data: Option, } diff --git a/crates/router/src/core/payments/operations/payment_approve.rs b/crates/router/src/core/payments/operations/payment_approve.rs index 032ec9671ea2..a1d50a9049aa 100644 --- a/crates/router/src/core/payments/operations/payment_approve.rs +++ b/crates/router/src/core/payments/operations/payment_approve.rs @@ -252,7 +252,6 @@ impl multiple_capture_data: None, redirect_response, surcharge_details: None, - session_surcharge_details: None, frm_message: frm_response.ok(), payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_cancel.rs b/crates/router/src/core/payments/operations/payment_cancel.rs index 5aebf198c78d..43fdc440e64d 100644 --- a/crates/router/src/core/payments/operations/payment_cancel.rs +++ b/crates/router/src/core/payments/operations/payment_cancel.rs @@ -172,7 +172,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_capture.rs b/crates/router/src/core/payments/operations/payment_capture.rs index fe32c498c141..1cfcbce5532f 100644 --- a/crates/router/src/core/payments/operations/payment_capture.rs +++ b/crates/router/src/core/payments/operations/payment_capture.rs @@ -234,7 +234,6 @@ impl multiple_capture_data, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_complete_authorize.rs b/crates/router/src/core/payments/operations/payment_complete_authorize.rs index c274991b1fe6..0e357f08734e 100644 --- a/crates/router/src/core/payments/operations/payment_complete_authorize.rs +++ b/crates/router/src/core/payments/operations/payment_complete_authorize.rs @@ -247,7 +247,6 @@ impl multiple_capture_data: None, redirect_response, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_confirm.rs b/crates/router/src/core/payments/operations/payment_confirm.rs index 87b669bfa6cd..0e0d6c21479b 100644 --- a/crates/router/src/core/payments/operations/payment_confirm.rs +++ b/crates/router/src/core/payments/operations/payment_confirm.rs @@ -382,7 +382,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_create.rs b/crates/router/src/core/payments/operations/payment_create.rs index a3e3bc838b27..87195510fc68 100644 --- a/crates/router/src/core/payments/operations/payment_create.rs +++ b/crates/router/src/core/payments/operations/payment_create.rs @@ -310,7 +310,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data, }, diff --git a/crates/router/src/core/payments/operations/payment_method_validate.rs b/crates/router/src/core/payments/operations/payment_method_validate.rs index 927bfa80797d..6d97f7b66cd1 100644 --- a/crates/router/src/core/payments/operations/payment_method_validate.rs +++ b/crates/router/src/core/payments/operations/payment_method_validate.rs @@ -198,7 +198,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_reject.rs b/crates/router/src/core/payments/operations/payment_reject.rs index 9431d8620644..415ab3eccfe7 100644 --- a/crates/router/src/core/payments/operations/payment_reject.rs +++ b/crates/router/src/core/payments/operations/payment_reject.rs @@ -158,7 +158,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: frm_response.ok(), payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_session.rs b/crates/router/src/core/payments/operations/payment_session.rs index 808f428de55a..b5ed79b2901f 100644 --- a/crates/router/src/core/payments/operations/payment_session.rs +++ b/crates/router/src/core/payments/operations/payment_session.rs @@ -200,7 +200,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_start.rs b/crates/router/src/core/payments/operations/payment_start.rs index fcc5530108cf..227e7e2f90db 100644 --- a/crates/router/src/core/payments/operations/payment_start.rs +++ b/crates/router/src/core/payments/operations/payment_start.rs @@ -174,7 +174,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, }, diff --git a/crates/router/src/core/payments/operations/payment_status.rs b/crates/router/src/core/payments/operations/payment_status.rs index 16fae7098e0d..d20830d9bc6b 100644 --- a/crates/router/src/core/payments/operations/payment_status.rs +++ b/crates/router/src/core/payments/operations/payment_status.rs @@ -411,7 +411,6 @@ async fn get_tracker_for_sync< redirect_response: None, payment_link_data: None, surcharge_details: None, - session_surcharge_details: None, frm_message: frm_response.ok(), }, None, diff --git a/crates/router/src/core/payments/operations/payment_update.rs b/crates/router/src/core/payments/operations/payment_update.rs index 0be2bc5373d5..a77ede0e6f6a 100644 --- a/crates/router/src/core/payments/operations/payment_update.rs +++ b/crates/router/src/core/payments/operations/payment_update.rs @@ -353,7 +353,6 @@ impl multiple_capture_data: None, redirect_response: None, surcharge_details: None, - session_surcharge_details: None, frm_message: None, payment_link_data: None, },