Skip to content

Commit

Permalink
remove session_surcharge_metadata from PaymentData and pass in function
Browse files Browse the repository at this point in the history
  • Loading branch information
hrithikesh026 committed Oct 19, 2023
1 parent 4ac8f95 commit ba8ba8a
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 15 deletions.
7 changes: 4 additions & 3 deletions crates/router/src/core/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ where
&operation,
payment_data,
&customer,
None,
)
.await?
}
Expand Down Expand Up @@ -791,6 +792,7 @@ where
router_data_res
}

#[allow(clippy::too_many_arguments)]
pub async fn call_multiple_connectors_service<F, Op, Req, Ctx>(
state: &AppState,
merchant_account: &domain::MerchantAccount,
Expand All @@ -799,6 +801,7 @@ pub async fn call_multiple_connectors_service<F, Op, Req, Ctx>(
_operation: &Op,
mut payment_data: PaymentData<F>,
customer: &Option<domain::Customer>,
session_surcharge_metadata: Option<SurchargeMetadata>,
) -> RouterResult<PaymentData<F>>
where
Op: Debug,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -1477,7 +1479,6 @@ where
pub ephemeral_key: Option<ephemeral_key::EphemeralKey>,
pub redirect_response: Option<api_models::payments::RedirectResponse>,
pub surcharge_details: Option<SurchargeDetailsResponse>,
pub session_surcharge_details: Option<SurchargeMetadata>,
pub frm_message: Option<FraudCheck>,
pub payment_link_data: Option<api_models::payments::PaymentLinkResponse>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response,
surcharge_details: None,
session_surcharge_details: None,
frm_message: frm_response.ok(),
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: frm_response.ok(),
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
multiple_capture_data: None,
redirect_response: None,
surcharge_details: None,
session_surcharge_details: None,
frm_message: None,
payment_link_data: None,
},
Expand Down

0 comments on commit ba8ba8a

Please sign in to comment.